折腾了一段时间mac上的OpenGL Shader Builder,写出了第一个shader program
:魔毯(copy:))
Program
Demo01.fs
uniform sampler2D tex;
void main()
{
gl_FragColor = texture2D(tex, gl_TexCoord[0].xy);
}
Demo01.vs
uniform float time;
void main()
{
vec4 vertex= gl_Vertex;
vertex.z=sin(vertex.x*1.5+time*5.0) * 0.25;
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_Position = gl_ModelViewProjectionMatrix*vertex;
}
Sybomls
如下图: