• Create Account

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

### #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.

### #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:

### #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