Skip to main content
GameDev.net gamedev.net
🔒 Locked

HLSL Multiple Techniques Problem

Started by darc koder Nov 12, 2011 at 11:42 AM 1 replies 1.5k views
Original Post
darc koder
darc koder
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
Nik02
Nik02
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
TomKQT
TomKQT
You are trying to set technique "TexLight", but your effect file defines "TexLightTech".

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.