着色器是否有“最佳”命名约定? 如果没有,有哪些流行的选择?
例如
* .vert * .vertex * .vsh
* .fragie * .pixel * .fsh * .psh
我没有几何和细分的例子
答案 0 :(得分:4)
我认为有多种名称可供选择的原因是,根据GLSL spec,着色器不是文件,它们是字符串。几乎每个应用程序从文件加载的字符串,但仍然是字符串。
尽管如此,他们的示例应用程序中Orange Book的作者已经确定了.vert和.frag。我认为这是一次非常有意义的投票。我也认为它在简洁(更多的是.fragment)和清晰(更多的是.fsh)之间取得了正确的音符。
答案 1 :(得分:2)
参考GLSL编译器可以识别以下扩展名:
Usage: glslangValidator [option]... [file]...
'file' can end in .<stage> for auto-stage classification, where <stage> is:
.conf to provide a config file that replaces the default configuration
(see -c option below for generating a template)
.vert for a vertex shader
.tesc for a tessellation control shader
.tese for a tessellation evaluation shader
.geom for a geometry shader
.frag for a fragment shader
.comp for a compute shader
.mesh for a mesh shader
.task for a task shader
.rgen for a ray generation shader
.rint for a ray intersection shader
.rahit for a ray any hit shader
.rchit for a ray closest hit shader
.rmiss for a ray miss shader
.rcall for a ray callable shader
.glsl for .vert.glsl, .tesc.glsl, ..., .comp.glsl compound suffixes
.hlsl for .vert.hlsl, .tesc.hlsl, ..., .comp.hlsl compound suffixes