Sign in to follow this  
BlackGhost

Vertex shader problem

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this