Arce 发表于 2021-7-11 10:50:41

GLSL 最简单的Shader

const char *vertexShader = {
"void main() {\n\
gl_TexCoord = gl_MultiTexCoord0;\n\
gl_Position = ftransform();\n\
}\n"
};

const char *fragmentShader = {
"uniform sampler2D sampler;//纹理\n\
void main() {\n\
gl_FragColor = texture2D(sampler, gl_TexCoord.st);//原图\n\
}\n"
};
  
文档来源:51CTO技术博客https://blog.51cto.com/u_15298588/3034122
页: [1]
查看完整版本: GLSL 最简单的Shader