blob: e0eef694fad6d18ab42543f5c1d38c73d11a21a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
attribute vec3 g_Position;
attribute vec3 g_TexCoord0;
attribute vec3 g_Tangent;
attribute vec3 g_Binormal;
attribute vec3 g_Normal;
uniform mat4 world;
uniform mat4 worldInverseTranspose;
uniform mat4 worldViewProj;
uniform mat4 viewInverse;
varying vec2 texCoord;
varying vec3 worldEyeVec;
varying vec3 worldNormal;
varying vec3 worldTangent;
varying vec3 worldBinorm;
void main() {
gl_Position = worldViewProj * vec4(g_Position.xyz, 1.);
texCoord.xy = g_TexCoord0.xy;
worldNormal = (worldInverseTranspose * vec4(g_Normal, 1.)).xyz;
worldTangent = (worldInverseTranspose * vec4(g_Tangent, 1.)).xyz;
worldBinorm = (worldInverseTranspose * vec4(g_Binormal, 1.)).xyz;
vec3 worldPos = (world * vec4(g_Position, 1.)).xyz;
worldEyeVec = normalize(worldPos - viewInverse[3].xyz);
}
|