Skip to content

Commit

Permalink
Possible shader patch for fglrx, fixed missing gl reference in Mesh.c…
Browse files Browse the repository at this point in the history
…learObject
  • Loading branch information
cjcliffe committed Mar 31, 2011
1 parent 2039b05 commit b9d6afc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CubicVR.js
Original file line number Diff line number Diff line change
Expand Up @@ -3249,6 +3249,7 @@ Material.prototype.bindObject = function(obj_in, light_shader) {
};

Material.prototype.clearObject = function(obj_in,light_shader) {
var gl = GLCore.gl;

var u = light_shader;
var uv = u.aTextureCoord;
Expand Down
9 changes: 7 additions & 2 deletions CubicVR_Core.fs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ 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 @@ -245,14 +250,14 @@ vec3 accum = lAmb;
// #if hasReflectionMap
// color += texture2D( envSphereMap, coord.st) * texture2D( reflectionMap, texCoord);
// #else
color.rgb += color.rgb*(1.0-envAmount) + mColor*accum*texture2D( envSphereMap, coord.st).rgb * envAmount;
color.rgb += color.rgb*(1.0-environmentAmount) + mColor*accum*texture2D( envSphereMap, coord.st).rgb * environmentAmount;
// #endif

#else
// #if hasReflectionMap
// color += texture2D( envSphereMap, gl_TexCoord[1].st) * texture2D( reflectionMap, texCoord);
// #else
color.rgb += color.rgb*(1.0-envAmount) + mColor*accum*texture2D( envSphereMap, vEnvTextureCoord).rgb*envAmount;
color.rgb += color.rgb*(1.0-environmentAmount) + mColor*accum*texture2D( envSphereMap, vEnvTextureCoord).rgb*environmentAmount;
// #endif
#endif

Expand Down

0 comments on commit b9d6afc

Please sign in to comment.