Search code examples
glslshaderhlsl

Standard naming convention for shaders


Is there a "best" naming convention for shaders? If not, what are the popular options?

For example

*.vert *.vertex *.vsh

*.frag *.pixel *.fsh *.psh

I dont have examples for geometry and tesselation


Solution

  • I think the reason why there's such a variety of names to choose from is because, according to the GLSL spec, shaders aren't files, they're character strings. Strings which nearly every application loads from a file, but strings nonetheless.

    That said, the authors of the Orange Book in their sample applications have settled upon .vert and .frag. I think that's a pretty meaningful vote. I also think it strikes the right note between succinct (moreso than .fragment) and legible (moreso than .fsh).