From 01c7f4816510809dca7e67f50b9e4832fa1de998 Mon Sep 17 00:00:00 2001 From: "Charles J. Cliffe" Date: Thu, 31 Mar 2011 19:30:06 -0400 Subject: [PATCH] Attempt to patch fglrx #2 --- CubicVR.js | 1 + CubicVR_Core.fs | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/CubicVR.js b/CubicVR.js index 13ab705..3b9fc5b 100644 --- a/CubicVR.js +++ b/CubicVR.js @@ -857,6 +857,7 @@ catch(e) { var lightTest = new CubicVR.Material(); for (var i = 0; i < enums.texture.map.MAX; i++) { + if (i===enums.texture.map.BUMP) continue; // fix for crashy fglrx driver, todo: check it against newer revisions. lightTest.setTexture(dummyTex,i); } lightTest.opacity = 0.5; diff --git a/CubicVR_Core.fs b/CubicVR_Core.fs index c467cc8..7168419 100644 --- a/CubicVR_Core.fs +++ b/CubicVR_Core.fs @@ -90,11 +90,6 @@ void main(void) { vec3 n; vec4 color; - -#if hasEnvSphereMap - float environmentAmount = envAmount; // Patch for nemo's fglrx crash? -#endif - #if hasBumpMap float height = texture2D(bumpMap, vTextureCoord.xy).r; @@ -250,14 +245,14 @@ vec3 accum = lAmb; // #if hasReflectionMap // color += texture2D( envSphereMap, coord.st) * texture2D( reflectionMap, texCoord); // #else - color.rgb += color.rgb*(1.0-environmentAmount) + mColor*accum*texture2D( envSphereMap, coord.st).rgb * environmentAmount; + color.rgb += color.rgb*(1.0-envAmount) + mColor*accum*texture2D( envSphereMap, coord.st).rgb * envAmount; // #endif #else // #if hasReflectionMap // color += texture2D( envSphereMap, gl_TexCoord[1].st) * texture2D( reflectionMap, texCoord); // #else - color.rgb += color.rgb*(1.0-environmentAmount) + mColor*accum*texture2D( envSphereMap, vEnvTextureCoord).rgb*environmentAmount; + color.rgb += color.rgb*(1.0-envAmount) + mColor*accum*texture2D( envSphereMap, vEnvTextureCoord).rgb*envAmount; // #endif #endif