Jump to content
  • Advertisement
Sign in to follow this  
WhardieJones

1 Effect File?

This topic is 4494 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

Is it possible to put all one's shaders into 1 effect file? If so, is there an example anywhere I can see? Right now I have a whole bunch of state specific global variables and I keep each technique in a different effect file but managing all this is starting to get heavy.

Share this post


Link to post
Share on other sites
Advertisement
Your effects can be placed in 1 file...
You will have different methods that will be different vertex shaders and pixel shaders and then different techniques that will be used for different, well techniques...


void DiffuseVS(){};
void DiffusePS(){};
technique Diffuse
{
pass p0
{
vertexshader = compile vs_1_1 DiffuseVS();
pixelshader = compile ps_1_1 DiffusePS();
}
}

void ShadowVS(){};
void ShadowPS(){};
technique Diffuse
{
pass p0
{
vertexshader = compile vs_2_1 ShadowVS();
pixelshader = compile ps_2_1 ShadowPS();
}
}



And so on, this is just a prototype of the idea.

I hope this helps.
Take care.

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!