Jump to content
  • Advertisement
Sign in to follow this  
rpsathe

variables not set in effects file

This topic is 4655 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 am running into a weird problem of having only a few variables mapped correctly from my .cpp file to .fx file. I have a bunch of calls like pEffect->SetValue("g_LightDir", &LightDir[0], sizeof(D3DXVECTOR3)*MAX_LIGHTS); pEffect->SetValue("g_LightDiffuse", LightDiff, sizeof(D3DXVECTOR4)*MAX_LIGHTS); pEffect->SetValue("g_LightSpecular", LightDiff, sizeof(D3DXVECTOR4)*MAX_LIGHTS); pEffect->SetFloat("g_LightAmbient", LightAmbient); pEffect->SetMatrix("g_mWorldViewProjection", &mWorldViewPr); pEffect->SetMatrix("g_mWorld", &world); pEffect->SetFloat("g_fTime", fTime); Only one variable is seen in HLSL debugger correctly and that is set using pEffect->SetInt("g_nActiveVS", nNumActiveVS); The other variables set using SetInt are also not seen... Any ideas of what could be gonig wrong? Thanks -Rahul

Share this post


Link to post
Share on other sites
Advertisement
I've never experienced this exact problem, but I've had a similar one caused by declaring but never using the variables in my shader code. When it was compiled, it just got rid of the variables that were never used so they didn't exist to be set.

Share this post


Link to post
Share on other sites
Are all of those Set*() calls actually returning successful? Also, have you checked the Debug Output? If anything weird is going on, this will tell you exactly what and why.

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!