openGL之API学习(七十五)opengl扩展GL

    xiaoxiao2022-06-24  202

    static const char* pFS = " \n\ #version 410 \n\ \n\ #extension GL_EXT_gpu_shader4 : enable \n\ \n\ out uvec3 FragColor; \n\ \n\ uniform uint gDrawIndex; \n\ uniform uint gObjectIndex; \n\ \n\ void main() \n\ { \n\ FragColor = uvec3(gObjectIndex, gDrawIndex,gl_PrimitiveID + 1); \n\ }";

    片段着色器中使用到了扩展GL_EXT_gpu_shader4,该扩展在https://www.khronos.org/opengl/wiki/OpenGL_Extension和https://www.khronos.org/registry/OpenGL/index_gl.php中有记载。

    更详细的说明在https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_gpu_shader4.txt。

    opengl的扩展一般分两类:一类是通用的扩展,所有的开发商都支持。一类是专用扩展,可能只有少数或部分开发商支持,这些扩展也可能不会出现在API的规范文档中。

     

     

     


    最新回复(0)