HLSL Multiple Techniques Problem

Started by
1 comment, last by TomKQT 12 years, 5 months ago
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
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.

Niko Suni

You are trying to set technique "TexLight", but your effect file defines "TexLightTech".

This topic is closed to new replies.

Advertisement