summaryrefslogtreecommitdiffstats
path: root/tests/RenderScriptTests/SceneGraph/res/raw/diffuse.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/RenderScriptTests/SceneGraph/res/raw/diffuse.glsl')
-rw-r--r--tests/RenderScriptTests/SceneGraph/res/raw/diffuse.glsl19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/RenderScriptTests/SceneGraph/res/raw/diffuse.glsl b/tests/RenderScriptTests/SceneGraph/res/raw/diffuse.glsl
new file mode 100644
index 0000000..5d8938b
--- /dev/null
+++ b/tests/RenderScriptTests/SceneGraph/res/raw/diffuse.glsl
@@ -0,0 +1,19 @@
+varying vec3 varWorldPos;
+varying vec3 varWorldNormal;
+varying vec2 varTex0;
+
+void main() {
+
+ vec3 V = normalize(UNI_cameraPos.xyz - varWorldPos.xyz);
+ vec3 worldNorm = (varWorldNormal);
+
+ vec3 light0Vec = V;
+ vec3 light0R = reflect(light0Vec, worldNorm);
+ float light0_Diffuse = dot(worldNorm, light0Vec);
+
+ vec2 t0 = varTex0.xy;
+ lowp vec4 col = texture2D(UNI_Tex0, t0).rgba;
+ col.xyz = col.xyz * light0_Diffuse * 1.2;
+ gl_FragColor = col; //vec4(0.0, 1.0, 0.0, 0.0);
+}
+