Xonotic Forums
[NEEDS INFO] Failing to fallback when a shader doesn't compile - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Support (https://forums.xonotic.org/forumdisplay.php?fid=3)
+--- Forum: Xonotic - Help & Troubleshooting (https://forums.xonotic.org/forumdisplay.php?fid=4)
+--- Thread: [NEEDS INFO] Failing to fallback when a shader doesn't compile (/showthread.php?tid=3763)



Failing to fallback when a shader doesn't compile - edh - 12-17-2012

When offset mapping and some other features are used on hardware that does not support these shader features then very funny things can happen. Textures may not get rendered at all leaving gaping holes in a map. I've seen this with both Geforce FX and r300 generations under different platforms.

In the console you get things like:
Quote:^7^1GLSL shader glsl/default.glsl lightdirectionmap_modelspace diffuse specular offsetmapping failed! some features may not work properly.
^7^1GLSL shader glsl/default.glsl lightdirectionmap_modelspace diffuse glow specular offsetmapping failed! some features may not work properly.
^7^1GLSL shader glsl/default.glsl lightdirectionmap_modelspace diffuse offsetmapping failed! some features may not work properly.
^7^1GLSL shader glsl/default.glsl lightdirectionmap_modelspace diffuse specular offsetmapping alphakill failed! some features may not work properly.

Having looked through the code of gl_main I've found where this comes from.

I see a possible workaround to this which might also work for when vid_soft 1 is enable which currently uses it's own workaround. A simple way would be that if the shader fails to compile as is already tested for, fallback and render the texture without offset mapping. Then a simple warning message can be given in the console along the same lines as it is now.

I might have a go at implementing this myself and see if it comes to anything.