Sign in to follow this  

Shader naming conventions

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

Interesting topic.
When I started using shaders, I chose names based on who would have used the shader - for example, I had level.vsh and level.psh, particle.vsh and particle.psh.
Then I realized that vertex and pixel shader do not actually need to be coupled: a simple textured level and a model would probably use the same pixel shader, but different vertex shaders. Furthermore, the really important thing in vertex shader is the vertex type that uses it.
So I decided this: at the beginning of a vertex shader name I write the name of the vertex type that uses it. For example, I could have Model_Skinned.vsh and Model_AnimatedSky.vsh: both use the same vertex type (SModelVertex), but the first one is used by a skinned mesh while the second one is used by an animated sky (it could move the texture coords to simulate coulds movement).
Pixel shader names are much simpler, but I'm still thinking about them.

I hope I got the topic right because I'm really out of my mind today o_O

Share this post


Link to post
Share on other sites
cool,
yeah ive decided to go [vertextype]_[behavior].vsh for the vertex shaders, like vertex3lt_default.vsh for the default shader for lit vertices. or vertex2tc_notrans.vsh for a special case shader my font parser uses, which requires the vertices to be pretransformed into camera space.

as for pixel shaders, i went with [inputs]_[operation preformed].psh, like tex0_copy.psh for the shader that simply copys the texel at stage 0 to r0. or tex0diff_blend.psh which blends the texel w/ the diffuse color.

my naming convention could use improvement but this is a good start, thanks for the reply! made me feel special :).

Share this post


Link to post
Share on other sites

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