New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenGL bug - removing diffuse from a skybox cause shadergen error #1117

Closed
Lopuska opened this Issue Jan 20, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@Lopuska
Member

Lopuska commented Jan 20, 2015

The problem is caused because 'attn' for some reason is a float (scalar) when we don't have diffuse.
so during acess of -> 'float.xxxx' we get an error.

I fixed that changing this:

  {
      if ( attn )
         lerpVal = new GenOp( "saturate( @ ).xxxx", attn );
      else
         blendOp = Material::Mul;
   }

to:

   {
      if ( attn && fd.materialFeatures.hasFeature( MFT_DiffuseMap ) )
         lerpVal = new GenOp( "saturate( @ ).xxxx", attn );
      else
         blendOp = Material::Mul;
   }

@Lopuska Lopuska changed the title from removing diffuse from a skybox cause shadergen error to OpenGL bug - removing diffuse from a skybox cause shadergen error Jan 20, 2015

@Lopuska

This comment has been minimized.

Show comment
Hide comment
@Lopuska

Lopuska Jan 20, 2015

Member

According to Luis, the correct fix is:

lerpVal = new GenOp( "vec4( saturate( @ ) ).xxxx", attn );

Since swizzles in opengl are only supported on non scalar type.
I make a PR for it. Fixed.

Member

Lopuska commented Jan 20, 2015

According to Luis, the correct fix is:

lerpVal = new GenOp( "vec4( saturate( @ ) ).xxxx", attn );

Since swizzles in opengl are only supported on non scalar type.
I make a PR for it. Fixed.

@Lopuska Lopuska referenced this issue Jan 20, 2015

Merged

fix #1117 #1118

@crabmusket crabmusket added the Bug label Jan 21, 2015

@crabmusket crabmusket added this to the 3.7 milestone Jan 21, 2015

@LuisAntonRebollo

This comment has been minimized.

Show comment
Hide comment
@LuisAntonRebollo

LuisAntonRebollo Jan 22, 2015

Contributor

Confirmed the problem and fix.

Thx 👍

Contributor

LuisAntonRebollo commented Jan 22, 2015

Confirmed the problem and fix.

Thx 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment