aboutsummaryrefslogtreecommitdiff
path: root/build/android/AndroidManifest.xml.template
diff options
context:
space:
mode:
Diffstat (limited to 'build/android/AndroidManifest.xml.template')
0 files changed, 0 insertions, 0 deletions
'#n51'>51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
uniform sampler2D baseTexture;
uniform sampler2D normalTexture;
uniform sampler2D useNormalmap;

uniform vec4 skyBgColor;
uniform float fogDistance;
uniform vec3 eyePosition;

varying vec3 vPosition;
varying vec3 worldPosition;

varying vec3 eyeVec;
varying vec3 tsEyeVec;
varying vec3 lightVec;
varying vec3 tsLightVec;

const float e = 2.718281828459;
 
float intensity (vec3 color){
	return (color.r + color.g + color.b) / 3.0;
}

float get_rgb_height (vec2 uv){
	return intensity(texture2D(baseTexture,uv).rgb);
}

vec4 get_normal_map(vec2 uv){
	vec4 bump = texture2D(normalTexture, uv).rgba;
	bump.xyz = normalize(bump.xyz * 2.0 -1.0);
	bump.y = -bump.y;
	return bump;
}

void main (void)
{
	vec3 color;
	vec4 bump;
	vec2 uv = gl_TexCoord[0].st;
	bool use_normalmap = false;
	
#ifdef USE_NORMALMAPS
	if (texture2D(useNormalmap,vec2(1.0,1.0)).r > 0.0){
		bump = get_normal_map(uv);
		use_normalmap = true;
	}
#endif
	
#ifdef GENERATE_NORMALMAPS
	if (use_normalmap == false){
		float tl = get_rgb_height (vec2(uv.x-SAMPLE_STEP,uv.y+SAMPLE_STEP));
		float t  = get_rgb_height (vec2(uv.x-SAMPLE_STEP,uv.y-SAMPLE_STEP));
		float tr = get_rgb_height (vec2(uv.x+SAMPLE_STEP,uv.y+SAMPLE_STEP));
		float r  = get_rgb_height (vec2(uv.x+SAMPLE_STEP,uv.y));
		float br = get_rgb_height (vec2(uv.x+SAMPLE_STEP,uv.y-SAMPLE_STEP));
		float b  = get_rgb_height (vec2(uv.x,uv.y-SAMPLE_STEP));