summaryrefslogtreecommitdiffstats
path: root/o3d/compiler/glsl_validator/shaders/shiny-teapot.vert
diff options
context:
space:
mode:
Diffstat (limited to 'o3d/compiler/glsl_validator/shaders/shiny-teapot.vert')
-rw-r--r--o3d/compiler/glsl_validator/shaders/shiny-teapot.vert26
1 files changed, 26 insertions, 0 deletions
diff --git a/o3d/compiler/glsl_validator/shaders/shiny-teapot.vert b/o3d/compiler/glsl_validator/shaders/shiny-teapot.vert
new file mode 100644
index 0000000..e0eef69
--- /dev/null
+++ b/o3d/compiler/glsl_validator/shaders/shiny-teapot.vert
@@ -0,0 +1,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);
+}