About Store Forum Documentation Contact



Post Reply 
One App, Two Custom Shaders ?
Author Message
3DRaddict Offline
Member

Post: #1
One App, Two Custom Shaders ?
I have one application which is using two meshes, each with their own custom shader. Each shader has its own set of user parameters.
My question is how do I, codewise, get the shaders to be correctly applied, each to their corresponding mesh, without any interference between the two (which I'm currently getting)
08-30-2014 11:23 AM
Visit this user's website Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #2
RE: One App, Two Custom Shaders ?
Well, I can answer my own question...the solution was staring me in the face the whole time! blushing
1) Edit the "material_user_shader.enum.h" file to add your own second shader:
Code:
/******************************************************************************/
enum MATERIAL_USER_SHADER
{
   MUS_DEFAULT,
   MUS_CUSTOM ,
   MUS_CUSTOM2,
};
/******************************************************************************/

2)If you are using the Tutorial Shaders as a template for your own then in the "CompileShaders()" and "GetShader()" functions, make the references to your second shader a different name from the default "Custom Shader"
08-31-2014 09:51 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #3
RE: One App, Two Custom Shaders ?
Appreciate the feedback, always nice to know should we need to do something similar smile
08-31-2014 10:08 AM
Find all posts by this user Quote this message in a reply
Post Reply