Jump to content
  • Advertisement
Sign in to follow this  
BlackGhost

Vertex shader problem

This topic is 4993 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!