您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

24 行
558 B

#version 100
// Input vertex attributes
attribute vec3 vertexPosition;
// Input uniform values
uniform mat4 projection;
uniform mat4 view;
// Output vertex attributes (to fragment shader)
varying vec3 fragPosition;
void main()
{
// Calculate fragment position based on model transformations
fragPosition = vertexPosition;
// Remove translation from the view matrix
mat4 rotView = mat4(mat3(view));
vec4 clipPos = projection*rotView*vec4(vertexPosition, 1.0);
// Calculate final vertex position
gl_Position = clipPos.xyzw;
}