Jump to content
  • Advertisement
Sign in to follow this  
M4573R

Pixel shader runs, but vertex doesn't

This topic is 3117 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 never run into this problem before. I have a shader set and the vertex shader doesn't do anything, but the pixel shader still runs. It compiles fine, and all the function calls I checked returned S_OK. I may have missed something, but I can't imagine it half working.

Share this post


Link to post
Share on other sites
Advertisement
I'm not using D3DFVF_XYZRHW. My vertex shader isn't running because my animations no longer work and the camera doesn't work unless I set the view matrix inside directx.

Share this post


Link to post
Share on other sites
I've narrowed it down to a chunk of code. Depending on what I comment out, the vertex shader will start to work. BUT I still don't get ANY compile errors!
What in the code would cause the vertex shader to not run!?


float4 pos = IN.position;
float3 nrm = IN.normal;


if( gSkin )
{
float3 Pos = float3(0,0,0);
nrm = float3(0,0,0);

float BlendWeightsArray[4] = (float[4])IN.BlendWeights;
int IndexArray[4] = (int[4])IN.BlendIndices;

for( int iBone = 0; iBone < NumBones; iBone++ )
{
Pos += mul(IN.position , WorldMatrixArray[IndexArray[iBone]]) * BlendWeightsArray[iBone];
nrm += mul(IN.normal , WorldMatrixArray[IndexArray[iBone]]) * BlendWeightsArray[iBone];
}

pos = float4(Pos,1.0);
}

Share this post


Link to post
Share on other sites
Upon further fiddling, I've noticed my vertex shader breaks whenever I try to use TEXCOORD3 and above. I have other programs that use shaders with more texcoords than that on many different computers. Why would my shader break like that? From what I can see, the device is set up the same way I've done it before and there's nothing fishy in the shader.

Share this post


Link to post
Share on other sites
What shader model are you using? Your card may be struggling with the loop. Try using a constant value instead of NumBones and see if that changes anything.

Share this post


Link to post
Share on other sites
I tried that. This same loop and shader code runs fine in other programs. I'm using shader 2.0. Numbones is passed to the vertex shader as 4 all the time btw. Its bone weights per vertex.

Share this post


Link to post
Share on other sites
That's the odd part, I have other programs with more complex shaders that run on all the same computers. I've tried 2 different laptops, and 3 different desktops. There's got to be some massive problem I'm missing. However I've heard the latest shader compiler in the SDK is bugged somewhat; maybe this is another problem. Is there ANY way that the device could be set up in a specific way that would cause the shader to break with a certain number of texcoords? I still get no compile errors and no shader errors when using the direct3d debugger.

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.

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

Sign me up!