【发布时间】:2010-12-04 17:47:30
【问题描述】:
我有一个顶点和片段着色器,我想显示纯色而不是纹理。
我有以下顶点和片段着色器。
static const char* meshVertexShader = " \
\
attribute vec4 vertexPosition; \
attribute vec4 vertexNormal; \
attribute vec2 vertexTexCoord; \
\
varying vec2 texCoord; \
varying vec4 normal; \
\
uniform mat4 modelViewProjectionMatrix; \
\
void main() \
{ \
gl_Position = modelViewProjectionMatrix * vertexPosition; \
normal = vertexNormal; \
texCoord = vertexTexCoord; \
} \
";
static const char* fragmentShader = " \
\
precision mediump float; \
\
varying vec2 texCoord; \
varying vec4 normal; \
\
uniform sampler2D texSampler2D; \
\
void main() \
{ \
gl_FragColor = texture2D(texSampler2D, texCoord); \
} \
";
如何修改片段着色器以不显示纹理? (对不起我的英语)。
谢谢。
【问题讨论】:
标签: opengl-es fragment-shader vertex-shader opengl-es-2.0