Skip to content

Commit

Permalink
Attempt to patch fglrx cjcliffe#2
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcliffe committed Mar 31, 2011
1 parent b9d6afc commit 01c7f48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions CubicVR.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 2 additions & 7 deletions CubicVR_Core.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 01c7f48

Please sign in to comment.