Jump to content
  • Advertisement
Sign in to follow this  
darc koder

HLSL Multiple Techniques Problem

This topic is 2591 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,


I'm trying to use multiple techniques in my fx file. I've written two different techniques one just for Ambient light and the other one is for all other light types. Vertex Shader is the same for bith techniques but pixel shader is different.


technique TexAmbientTech

{

pass T0

{

vertexShader = compile vs_3_0 TexLightVS();

pixelShader = compile ps_3_0 TexAmbientPS();

}

}

technique TexLightTech

{

pass P0

{

vertexShader = compile vs_3_0 TexLightVS();

pixelShader = compile ps_3_0 TexLightPS();

}

}




Now the problem is no matter which technique do i specify the program uses only that technique that occours first. Suppose if i want to use TexLight Techinique and do


effect->SetTechnique("TexLight");


still TexAmbient is being used.



I cant figure out the problem. Can anyone please tell me what am i doing wrong?



Regards

Share this post


Link to post
Share on other sites
Advertisement
The SetTechnique call can fail.

Try to compile the effect file with fxc to see if there are any compilation errors on the TexLightPS shader.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!