
What are some good resources for learning HLSL? [closed]
The last time I tried learning HLSL, I made a few shaders and mostly understood what I was doing, but I still felt like I was stumbling in the dark. Most of what I learned I got from various …
What are the pros and cons of HLSL vs GLSL vs cg? [closed]
HLSL if you're going exclusively on Microsoft platforms. Now first developping in HLSL for windows to use DirectX and then convert to GLSL for linux and mac could be the better …
What does ddx (hlsl) actually do? - Game Development Stack …
What does ddx (hlsl) actually do? Ask Question Asked 12 years, 3 months ago Modified 6 years, 11 months ago
hlsl - Computing pixel's screen position in a vertex shader: right or ...
As you are using hlsl I presume you use DirectX. You can use the input semantic VPOS (DX9) or SV_Position (DX>=10): MSDN - VPOS & SV_POSITION semantics When you pass the …
Random number hlsl - Game Development Stack Exchange
How do you generate a random number in HLSL? I'm asking because I want to try gpu ray tracing. You need to generate random directions in a pixel shader. So I want randFloat(), …
What are registers in HLSL for? - Game Development Stack Exchange
A given shader model exposes a particular set of registers to HLSL; these registers are underlying hardware registers on the GPU, like CPU registers, but have more refined scopes (for …
In HLSL, what is the difference between "static const" and "#define ...
Dec 16, 2014 · It basically doesn't matter. #define uses token-pasting to insert the specified value into the shader code whereever it occurs; the shader itself will see the token as if you simply …
SV_POSITION in pixel shader - Game Development Stack Exchange
Jun 14, 2012 · SV_Position in the pixel shader gives you the the center point of the pixel being shaded, in a [0, bufferWidth] x [0, bufferHeight] range. (It can also be used in centroid mode …
Inverting matrix in HLSL - Game Development Stack Exchange
HLSL does not provide a function for invert but it does provide for transpose. So if your matrix is orthogonal you can just use transpose. Also if you have scaling and is uniform you won't need …
What are screen space derivatives and when would I use them?
Oct 3, 2016 · 28 I see the ddx and ddy glsl functions and the hlsl equivalents come up in shader code every now and then. I'm currently using them to do bump mapping without a tangent or …