GLSL 着色器的正确文件扩展名是什么? [英] What is the correct file extension for GLSL shaders?

查看:19
本文介绍了GLSL 着色器的正确文件扩展名是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习 glsl 着色,并且遇到了不同的文件格式.我见过有人给他们的顶点和片段着色器 .vert.frag 扩展.但我也看到了 .vsh.fsh 扩展,甚至两个着色器都在一个 .glsl 文件中.所以我想知道是否有标准的文件格式,或者哪种方式是正确的"?

I'm learning glsl shading and I've come across different file formats. I've seen people giving their vertex and fragment shaders .vert and .frag extensions. But I've also seen .vsh and .fsh extensions, and even both shaders together in a single .glsl file. So I'm wondering if there is a standard file format, or which way is the 'correct' one?

推荐答案

Khronos 创建的 glslang 编译器基于扩展对着色器阶段做出了假设,但除此之外并没有标准扩展(而且相当多的项目使自己上去).glslang 编译器关闭了 .vert.tesc(TESsellation 控制着色器)、.tese(TESsellation 评估着色器)、.geom.frag.comp.

The glslang compiler created by Khronos makes assumptions about the shader stage based on the extension, but there is no standard extension outside of this (and quite a few projects make up their own). The glslang compiler keys off of .vert, .tesc (TESsellation Control shaders), .tese (TESsellation Evaluation shaders), .geom, .frag, and .comp.

但这对于任何形式的标准扩展都是如此.

But that's about it for any form of standard extension.

这篇关于GLSL 着色器的正确文件扩展名是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆