【发布时间】:2012-03-06 17:33:51
【问题描述】:
在this 问题中,我询问了如何创建“镜像”纹理,现在我想将这个“镜像”图像在 y 轴上围绕图像高度向下移动。 我用不同的 HEIGHT 值尝试了类似的方法,但找不到合适的解决方案:
// Vertex Shader
uniform highp mat4 u_modelViewMatrix;
uniform highp mat4 u_projectionMatrix;
attribute highp vec4 a_position;
attribute lowp vec4 a_color;
attribute highp vec2 a_texcoord;
varying lowp vec4 v_color;
varying highp vec2 v_texCoord;
void main()
{
highp vec4 pos = a_position;
pos.y = pos.y - HEIGHT;
gl_Position = (u_projectionMatrix * u_modelViewMatrix) * pos;
v_color = a_color;
v_texCoord = vec2(a_texcoord.x, 1.0 - a_texcoord.y);
}
【问题讨论】:
标签: opengl-es glsl vertex-shader