Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

File naming convention for GLSL shaders

📅 2014-Jul-29 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ glsl ⬩ 📚 Archive

Vertex, fragment and geometry shader programs can be written in GLSL. These are usually written in separate files. Any filename and extension can be used for GLSL shader files since the language standard does not enforce anything.

I found it convenient to name the shader programs as foo.vs.glsl, foo.fs.glsl and I found this convention used in the source code from the book The OpenGL Superbible. The .glsl is recognized by many editors and GLSL syntax highlighting is automatically applied when you open those files.

© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘📧