Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualShawn619

Posted 18 June 2013 - 02:29 PM

Solved!

 

Very unusual problem, which is why I couldn't fine many similar problem on google.

 

I narrowed the problem down to the attenuation calculated in my glsl shader. Funnily enough, my attenuation calculations were fine. The problem was solved by changing:

if( gl_FrontFacing ){
//color = ambient and diffuse with attenuation
}else{
//color = only ambient
}
 

to

if( diffuseTerm > 0.0){
//color = ambient and diffuse with attenuation
}else{
//color = only ambient
}

I don't know how, but there was a problem with gl_FrontFacing.

 

Here is the result(with smooth instead of flat shading):

263jyoy.jpg


#2Shawn619

Posted 18 June 2013 - 02:28 PM

Solved!

 

Very unusual problem, which is why I couldn't fine many similar problem on google.

 

I narrowed the problem down to the attenuation calculated in my glsl shader. Funnily enough, my attenuation calculations were fine. The problem was solved by changing:

if( gl_FrontFacing ){
//color = ambient and diffuse with attenuation
}else{
//color = only ambient
}
 

to

if( diffuseTerm > 0.0){
//color = ambient and diffuse with attenuation
}else{
//color = only ambient
}

I don't know how, but there was a problem with gl_FrontFacing.

 

Here is the result:

263jyoy.jpg


#1Shawn619

Posted 18 June 2013 - 02:28 PM

Solved!

 

Very unusual problem, which is why I couldn't fine many similar problem on google.

 

I narrowed the problem down to the attenuation calculated in my glsl shader. Funnily enough, my attenuation calculations were fine. The problem was solved by changing:

 

if( gl_FrontFacing ){
//color = ambient and diffuse with attenuation
}else{
//color = only ambient
}
 

 

to

 

if( diffuseTerm > 0.0){
//color = ambient and diffuse with attenuation
}else{
//color = only ambient
}

 

I don't know how, but there was a problem with gl_FrontFacing.

 

Here is the result:

http://oi41.tinypic.com/263jyoy.jpg


PARTNERS