uniform vec4 uPlayerPos; /* w: distance to uSpawnPos */
uniform vec4 uSpawnPos; /* w: inverse distance to uPlayerPos */
uniform bool uAlphatest;
+uniform vec4 uMapInfo; /* x: min, y: max, z: iso line amount */
+#include "light_clearskies_stddef.glsl"
#include "common_scene.glsl"
#include "motion_vectors_fs.glsl"
float dither = fract( vDither.g / 71.0 ) - 0.5;
float dcam = (-8.0+distance( aCo, uCamera ))/4.0;
- if( min(aCo.y*0.5 + dither, dcam + dither) < 0.51 ) discard;
+ float dy0 = aCo.y - uMapInfo.x;
+ float dy1 = uMapInfo.y - aCo.y;
+
+ if( min(min(dy0,dy1)*0.5, dcam) + dither < 0.51 )
+ discard;
compute_motion_vectors();
- vec3 vfrag = vec3(0.7);
+ vec3 vfrag = vec3(0.898,0.811,0.716);
vec3 qnorm = aNorm.xyz;
qnorm = normalize(floor(aNorm.xyz*4.0)*0.25);
float d3 = distance(p0,aCo);
emit += vec3(fract(t*0.2-g_realtime+d3*0.2)*max(0.0,1.0-d3*0.2));
- oColour = vec4( vfrag+emit, 1.0 );
+ vfrag += emit;
+
+ if( uMapInfo.z > 0.0 ){
+ float height = fract( aCo.y * 0.1 );
+ float lg = 2.0*length(vec2(dFdx(height), dFdy(height)));
+ vfrag *= 1.0f+(lg*0.2*uMapInfo.z);
+ }
+
+ oColour = vec4( vfrag, 1.0 );
//oColour = vec4( vfrag, 1.0 );
}