0
votes
0answers
76 views

Why do the order of struct members between vertex and pixel shader must be reversed?

This has been driving me crazy for the last two days but it is finally working, however I really don't see why the order of struct members should be reversed. Why do members of PS_INPUT must be ...
9
votes
4answers
1k 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
645 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
274 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
772 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