Implemented
- Bump mapped terrain
- float center = texture2D( u_Bump, v_Texcoord + vec2( -u_time*0.8, 0.0 ));
float right = texture2D( u_Bump, v_Texcoord+ vec2( -u_time*0.8, 0.0 ) + vec2(1.0/1000.0, 0.0) );
float top = texture2D( u_Bump, v_Texcoord + vec2( -u_time*0.8, 0.0 )+ vec2(0.0, 1.0/500.0) );
vec3 perturbedNorm = normalize( vec3(center - right, center - top, 0 .2) );
vec3 bumpNorm = normalize(eastNorthUpToEyeCoordinates(v_positionMC, normal)* perturbedNorm);
float BumpDiffuse = max( dot(u_CameraSpaceDirLight, bumpNorm), 0.0 );
- Rim lighting to simulate atmosphere
- Nighttime lights on the dark side of the globe
- Specular mapping
- Moving clouds(from west to east)
- Orbiting Moon with texture mapping
Part2 SSAO(Screen Space Ambient Occlusion):
gatherOcclusion:
float distance = length( occluder_position - pt_position );
float overhead = dot( pt_normal, normalize( occluder_position - pt_position ) );
float planar = 1.0 - abs( dot( pt_normal, occluder_normal ) );
return planar*max( 0.0, overhead )*( 1.0/(1.0 + distance) ) ;
regularSample:
vec2 occludePos = texcoord + vec2( i, j )*REGULAR_SAMPLE_STEP;
vec3 occPos = samplePos(occludePos);
vec3 occNorm = normalize( sampleNrm(occludePos) );
accumOcclusion += gatherOcclusion( normalize(normal), position, occNorm, occPos ) ;
Part3 Vertex Pulsing
float displacement = scaleFactor * (0.5 * sin(Position.y * u_frequency * u_time) + 1);
vec3 newPosition = Position + displacement * Normal;