Shader naming conventions

Started by
2 comments, last by hlivingstone 19 years, 6 months ago
Hi, I'm trying to decide upon a shader file naming convention (using good-ole asm shaders). I haven't seen much about this anywhere, so I thought I'd ask what conventions ya'll use for yours.
Advertisement
okay, i would have though somebody would have replied by now, but apperently not. well thats a shame...for anyone who's intrested, I'll post whatever convention i decide upon, when i decide it.
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
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 :).

This topic is closed to new replies.

Advertisement