9
votes
4answers
970 views

Avoid if statements in DirectX 10 shaders?

I have heard that if statements should be avoid in shaders, because both parts of the statements will be execute, and than the wrong will be dropped (which harms the performance). It's still a ...
4
votes
1answer
538 views

Pass large array to pixel shader

I am trying to write a Pixelshader for a curve effect in Direct2d. A curve effect maps each color channel value to a different value by using a look up table. For this effect I would need to pass 3 ...
1
vote
1answer
265 views

screen coordinate not working with pixel values

I have a very simple effect file shown below. I am using this to draw 2D lines, however it is not behaving how I expected and I can't seem to get my head round why. If I draw a line that goes from ...
2
votes
2answers
660 views

HLSL: how to get/set effectvariable to an array of structs with Direct3D10

HLSL Code: //Lights struct Light { float3 pos; float3 dir; int type; } m_aLights[3]; How can I get/set an effectvariable to m_aLights with Direct3D10? Thanks