Jump to content
  • Advertisement
Sign in to follow this  
ankhd

HLSL Question

This topic is 3883 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

Hi all. If the D3DXCreateEffectFromFile reports this ID3DXEffect: Warning! Failed to create shader on this device (probably because shader version is unsupported) and the cause of this error is when I try to make a for loop with a dynamic value. Eg. uniform extern int gNumVertInfluences = 2; //set dynamically. int NumBones = gNumVertInfluences-1; for(int iBone = 0; iBone < NumBones; iBone++) { //do stuff } the above give the error and this bit works int NumBones = 3; for(int iBone = 0; iBone < NumBones; iBone++) { //do stuff } Does this mean if I want to have meshes with 2 or 4 blends I will need to make two sharders or is there something wrong, no error is return when I set value in the shader. my video card is a ATI Radeon 9550 / X1050 Series has the following for skinning int the caps MaxVertexBlendMatrixIndex 37. MaxVertexBlendMatrices 4. MaxVertexShaderConst 256. VertexShaderVersion 2.0. PixelShader1xMaxValue 3.40282E+038. PixelShaderVersion 2.0.

Share this post


Link to post
Share on other sites
Advertisement
Dynamic branching and looping is not supported in SM2 and below. You need SM3 or higher to achieve dynamic branching.

In SM2 and below, all loops and braches are resolved statically at shader compile time. A loop based on a variable set at runtime cannot be statically resolved and thus requires dynamic branching/looping.

If you have a SM3 card or higher, try compiling with ps_3_0 and vs_3_0.

Share this post


Link to post
Share on other sites
Ah is that what dynamic branching is ok Thanks.
I'll make two shaders one for 2 blend the other for 3.
Is this a good Idea or should I just stay with 2 blends. The ones with 4 blend look the same, when useing 2 blends. In the 3 meshes Ive tested looks ok, so far.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!