aboutsummaryrefslogtreecommitdiff
path: root/shaders/moon.fp
diff options
context:
space:
mode:
Diffstat (limited to 'shaders/moon.fp')
-rw-r--r--shaders/moon.fp13
1 files changed, 13 insertions, 0 deletions
diff --git a/shaders/moon.fp b/shaders/moon.fp
new file mode 100644
index 0000000..18242d2
--- /dev/null
+++ b/shaders/moon.fp
@@ -0,0 +1,13 @@
+uniform sampler2D tex;
+
+varying vec3 fragmentNormal ;
+varying vec3 lightVector ;
+
+void main() {
+ float f = dot( normalize( fragmentNormal ), normalize( lightVector ) );
+ vec4 color = texture2D( tex, gl_TexCoord[0].xy );
+
+ f = ( 1.0f / (1.0f + exp( -f * 150.0f ) ) ) ;
+
+ gl_FragColor = f * color;
+}