7
$\begingroup$

I am mainly using Unity but I think that it's not related to this engine, and I am wondering what's the difference between using tex2D and Sample for sampling a texture.

$\endgroup$

1 Answer 1

7
$\begingroup$

They represent the same operation, but Sample is what it's called in D3D10 and newer versions of HLSL, while tex2D is what it's called in D3D9 HLSL, and NVIDIA's (defunct) Cg language. By the way, the operation is also called texture in GLSL.

$\endgroup$
2
  • $\begingroup$ Thanks Nathan ! Is this just a new call or does it also include some performance boost. I mean what does this call imply compared to the D3D9 version ? $\endgroup$
    – MaT
    Commented Dec 19, 2016 at 7:13
  • 1
    $\begingroup$ @MaT It implies you're using D3D10+. ;) It's literally the same operation in hardware; they just redesigned the API and called it a different name. $\endgroup$ Commented Dec 19, 2016 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.