Sign in to follow this  

1 Effect File?

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

This topic is 4300 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.

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