\r
void main (void)\r
{\r
- float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r;\r
- float enable_bumpmapping = enableBumpmapping;\r
-\r
vec3 color;\r
vec2 uv = gl_TexCoord[0].st;\r
+ \r
+#ifdef NORMALS\r
float height;\r
vec2 tsEye = vec2(tsEyeVec.x,-tsEyeVec.y);\r
\r
+ float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r;\r
+ float enable_bumpmapping = enableBumpmapping;\r
+ \r
if ((enableParallaxOcclusion == 1.0) && (use_normalmap > 0.0)) {\r
float map_height = texture2D(normalTexture, uv).a;\r
if (map_height < 1.0){\r
} else {\r
color = texture2D(baseTexture, uv).rgb;\r
}\r
+#else\r
+ color = texture2D(baseTexture, uv).rgb;\r
+#endif\r
\r
float alpha = texture2D(baseTexture, uv).a;\r
vec4 col = vec4(color.r, color.g, color.b, alpha);\r
\r
void main (void)\r
{\r
- float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r;\r
- float enable_bumpmapping = enableBumpmapping;\r
-\r
vec3 color;\r
vec2 uv = gl_TexCoord[0].st;\r
\r
+#ifdef NORMALS\r
+ float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r;\r
+ float enable_bumpmapping = enableBumpmapping;\r
+\r
if ((enable_bumpmapping == 1.0) && (use_normalmap > 0.0)) {\r
vec3 base = texture2D(baseTexture, uv).rgb;\r
vec3 vVec = normalize(eyeVec);\r
} else {\r
color = texture2D(baseTexture, uv).rgb;\r
}\r
+#else\r
+ color = texture2D(baseTexture, uv).rgb;\r
+#endif\r
\r
float alpha = texture2D(baseTexture, uv).a;\r
vec4 col = vec4(color.r, color.g, color.b, alpha);\r
\r
void main (void)\r
{\r
- float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r;\r
- float enable_bumpmapping = enableBumpmapping;\r
-\r
vec3 color;\r
vec2 uv = gl_TexCoord[0].st;\r
+ \r
+#ifdef NORMALS\r
+ float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r;\r
+ float enable_bumpmapping = enableBumpmapping;\r
\r
if ((enable_bumpmapping == 1.0) && (use_normalmap > 0.0)) {\r
vec3 base = texture2D(baseTexture, uv).rgb;\r
} else {\r
color = texture2D(baseTexture, uv).rgb;\r
}\r
+#else\r
+ color = texture2D(baseTexture, uv).rgb;\r
+#endif\r
\r
float alpha = gl_Color.a;\r
vec4 col = vec4(color.r, color.g, color.b, alpha);\r
\r
void main (void)\r
{\r
- float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r;\r
- float enable_bumpmapping = enableBumpmapping;\r
-\r
vec3 color;\r
vec2 uv = gl_TexCoord[0].st;\r
+ \r
+#ifdef NORMALS\r
+ float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r;\r
+ float enable_bumpmapping = enableBumpmapping;\r
\r
if ((enable_bumpmapping == 1.0) && (use_normalmap > 0.0)) {\r
vec3 base = texture2D(baseTexture, uv).rgb;\r
} else {\r
color = texture2D(baseTexture, uv).rgb;\r
}\r
+#else\r
+ color = texture2D(baseTexture, uv).rgb;\r
+#endif\r
\r
float alpha = texture2D(baseTexture, uv).a;\r
vec4 col = vec4(color.r, color.g, color.b, alpha);\r
\r
void main (void)\r
{\r
- float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r;\r
- float enable_bumpmapping = enableBumpmapping;\r
-\r
vec3 color;\r
vec2 uv = gl_TexCoord[0].st;\r
+ \r
+#ifdef NORMALS\r
float height;\r
vec2 tsEye = vec2(tsEyeVec.x,-tsEyeVec.y);\r
\r
+ float use_normalmap = texture2D(useNormalmap,vec2(1.0,1.0)).r;\r
+ float enable_bumpmapping = enableBumpmapping;\r
+ \r
if ((enableParallaxOcclusion == 1.0) && (use_normalmap > 0.0)) {\r
float map_height = texture2D(normalTexture, uv).a;\r
if (map_height < 1.0){\r
} else {\r
color = texture2D(baseTexture, uv).rgb;\r
}\r
+#else\r
+ color = texture2D(baseTexture, uv).rgb;\r
+#endif\r
\r
float alpha = texture2D(baseTexture, uv).a;\r
vec4 col = vec4(color.r, color.g, color.b, alpha);\r
if(vertex_program == "" && pixel_program == "" && geometry_program == "")
return shaderinfo;
+ if (g_settings->getBool("enable_bumpmapping") || g_settings->getBool("enable_parallax_occlusion")) {
+ if(vertex_program != "")
+ vertex_program = "#define NORMALS\n" + vertex_program;
+ if(pixel_program != "")
+ pixel_program = "#define NORMALS\n" + pixel_program;
+ if(geometry_program != "")
+ geometry_program = "#define NORMALS\n" + geometry_program;
+ }
+
// Call addHighLevelShaderMaterial() or addShaderMaterial()
const c8* vertex_program_ptr = 0;
const c8* pixel_program_ptr = 0;