skateshop basics
[carveJwlIkooP6JGAAIwe30JlM.git] / shaders / model_entity.fs
diff --git a/shaders/model_entity.fs b/shaders/model_entity.fs
new file mode 100644 (file)
index 0000000..b14d120
--- /dev/null
@@ -0,0 +1,22 @@
+uniform sampler2D uTexMain;
+uniform vec3 uCamera;
+
+in vec4 aColour;
+in vec2 aUv;
+in vec3 aNorm;
+in vec3 aCo;
+in vec3 aWorldCo;
+
+#include "common_world.glsl"
+#include "motion_vectors_fs.glsl"
+
+void main()
+{
+   compute_motion_vectors();
+
+   vec3 qnorm     = normalize(floor(aNorm*2.0)*0.5) + vec3(0.001,0.0,0.0);
+   vec3 diffuse   = texture( uTexMain, aUv ).rgb;
+   vec3 composite = world_compute_lighting( diffuse, qnorm, aWorldCo, 1.0 );
+
+   oColour = vec4( composite, 1.0 );
+}