Sign in to follow this  
WhardieJones

1 Effect File?

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this