|
From: <cn...@us...> - 2010-02-23 08:44:49
|
Revision: 677
http://hgengine.svn.sourceforge.net/hgengine/?rev=677&view=rev
Author: cnlohr
Date: 2010-02-23 08:44:43 +0000 (Tue, 23 Feb 2010)
Log Message:
-----------
whoops forgot the shader
Added Paths:
-----------
Mercury2/Themes/default/Graphic/Crepuscular.frag
Mercury2/Themes/default/Graphic/Crepuscular.vert
Added: Mercury2/Themes/default/Graphic/Crepuscular.frag
===================================================================
--- Mercury2/Themes/default/Graphic/Crepuscular.frag (rev 0)
+++ Mercury2/Themes/default/Graphic/Crepuscular.frag 2010-02-23 08:44:43 UTC (rev 677)
@@ -0,0 +1,24 @@
+uniform vec4 HG_DepthRange;
+uniform sampler2D HG_Texture0;
+uniform sampler2D HG_Texture1;
+
+varying vec3 normal;
+varying vec3 pos;
+varying float dist;
+
+void main()
+{
+ float fbrgt = 0.1;
+ vec2 sspos = gl_TexCoord[0].xy;
+ for( int i = 0; i < 100; i++ )
+ {
+ vec4 SW = texture2D( HG_Texture1, sspos );
+ sspos += 0.001;
+ sspos = clamp( sspos, vec2( 0. ), vec2( .99 ) );
+ if( SW.a < 0.5 ) fbrgt += 0.01;
+ }
+
+ vec4 IM = texture2D( HG_Texture0, gl_TexCoord[0].xy );
+ gl_FragColor = IM * fbrgt;
+}
+
Added: Mercury2/Themes/default/Graphic/Crepuscular.vert
===================================================================
--- Mercury2/Themes/default/Graphic/Crepuscular.vert (rev 0)
+++ Mercury2/Themes/default/Graphic/Crepuscular.vert 2010-02-23 08:44:43 UTC (rev 677)
@@ -0,0 +1,21 @@
+uniform vec4 HG_EyePos;
+uniform mat4 HG_ModelMatrix;
+uniform vec4 HG_DepthRange;
+varying vec3 normal;
+varying vec3 pos;
+varying float dist;
+
+void main()
+{
+ gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_Position = ftransform();
+
+ vec4 n = vec4(gl_Normal, 0);
+
+ //viewspace normal
+ normal = (gl_ModelViewMatrix * n).xyz;
+
+ //clip space depth
+ pos = (gl_ModelViewMatrix * gl_Vertex).xyz;
+ dist = pos.z;
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|