Jump to content
  • Advertisement
Sign in to follow this  
hlivingstone

Shader naming conventions

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

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!