Fixed wrong alpha handling in the pbr shader

define_list_fix
Nehon 9 years ago
parent 2c388e489a
commit 9665b985e4
  1. 4
      jme3-core/src/main/resources/Common/MatDefs/Light/PBRLighting.frag
  2. 4
      jme3-core/src/main/resources/Common/MatDefs/Light/PBRLighting.vert

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

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

Loading…
Cancel
Save