diff options
author | Novatux <nathanael.courant@laposte.net> | 2013-12-08 08:01:20 +0100 |
---|---|---|
committer | Novatux <nathanael.courant@laposte.net> | 2013-12-08 08:01:20 +0100 |
commit | 206565d9650eeffc86b4223a75203a29bc94cce7 (patch) | |
tree | af7f15cd0718cf53e18b90805989b97497ba710e /src | |
parent | 3cc45fd8adf4213bfd979273a094b33fecb6c7db (diff) | |
download | minetest-206565d9650eeffc86b4223a75203a29bc94cce7.tar.gz minetest-206565d9650eeffc86b4223a75203a29bc94cce7.tar.bz2 minetest-206565d9650eeffc86b4223a75203a29bc94cce7.zip |
Fix shaders on some GPUs
Diffstat (limited to 'src')
-rw-r--r-- | src/shader.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/shader.cpp b/src/shader.cpp index ec192b9a2..76af23686 100644 --- a/src/shader.cpp +++ b/src/shader.cpp @@ -673,6 +673,15 @@ ShaderInfo generate_shader(std::string name, IrrlichtDevice *device, 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; |