# HLSL Multiple Techniques Problem

This topic is 2899 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 on other sites
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 on other sites
You are trying to set technique "TexLight", but your effect file defines "TexLightTech".

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 15
• 21
• 23
• 11
• 25