Jump to content
  • Advertisement
Sign in to follow this  

Vertex shader problem

This topic is 5390 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've just started playing with fx files under DirectX 9.0, and have the weirdest problem that I hope someone more experienced in these matters can help me with. I have an elementary vertex shader in my fx file, which simply implements diffuse lighting: VS_OUTPUT ProcessBallVertex( float4 vPos : POSITION, float3 vNormal : NORMAL) { VS_OUTPUT ret; ret.Position = mul(vPos, gWorldViewProjection); float4 ambient; float4 l = normalize(float4(-1.0f, -0.0f, 1.0f, 1.0f)); // light dir float4 dif = float4(0.8f, 0.5f, 0.0f, 1.0f); // diffuse color ret.Color = dif * dot(vNormal, l); return ret; } I don't get anything on screen when I run with this shader enabled. However, when I try to debug the shader, I find out that the positions and colors returned are correct and, more importantly, the object is displayed and lit normally under debugging mode! It can't be because of the REF driver, for if I start the application without debugging in REF mode it still doesn't display the object. I'm basing my application on the DirectX sample framework and use the #define DEBUG_VS/PS directives to enable/disable debugging, so I don't know if any additional code gets executed because of them that might cause the problem to appear (I couldn't find anything in the framework's source though). If anyone has any idea of what is going on, it would be much appreciated, thanks.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!