Fixed wrong alpha handling in the pbr shader

This commit is contained in:
Nehon 2016-08-19 10:54:17 +02:00
parent 2c388e489a
commit 9665b985e4
2 changed files with 10 additions and 4 deletions

View File

@ -9,7 +9,9 @@ varying vec2 texCoord;
varying vec2 texCoord2;
#endif
varying vec4 Color;
#ifndef BASECOLORMAP
varying vec4 Color;
#endif
uniform vec4 g_LightData[NB_LIGHTS];
@ -122,7 +124,7 @@ void main(){
float Metallic = max(m_Metallic, 0.0);
#endif
float alpha = Color.a * albedo.a;
float alpha = albedo.a;
#ifdef DISCARD_ALPHA
if(alpha < m_AlphaDiscardThreshold){

View File

@ -13,7 +13,9 @@ varying vec2 texCoord;
attribute vec2 inTexCoord2;
#endif
varying vec4 Color;
#ifndef BASECOLORMAP
varying vec4 Color;
#endif
attribute vec3 inPosition;
attribute vec2 inTexCoord;
@ -59,7 +61,9 @@ void main(){
wTangent = vec4(TransformWorldNormal(modelSpaceTan),inTangent.w);
#endif
Color = m_BaseColor;
#ifndef BASECOLORMAP
Color = m_BaseColor;
#endif
#ifdef VERTEX_COLOR
Color *= inColor;