Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ MaterialDef PBR Lighting {
}

Defines {
BASECOLORMAP_ALPHA : BaseColorMap
NUM_BONES : NumberOfBones
INSTANCING : UseInstancing
NUM_MORPH_TARGETS: NumberOfMorphTargets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ MaterialDef Unshaded {
}

Defines {
COLORMAP_ALPHA : ColorMap
NUM_BONES : NumberOfBones
INSTANCING : UseInstancing
NUM_MORPH_TARGETS: NumberOfMorphTargets
Expand Down
21 changes: 21 additions & 0 deletions jme3-effects/src/main/resources/Common/MatDefs/SSAO/normal.frag
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ varying vec2 texCoord;

#ifdef DIFFUSEMAP_ALPHA
uniform sampler2D m_DiffuseMap;
#endif

#ifdef COLORMAP_ALPHA
uniform sampler2D m_ColorMap;
#endif

#ifdef BASECOLORMAP_ALPHA
uniform sampler2D m_BaseColorMap;
#endif

#if defined DIFFUSEMAP_ALPHA || defined COLORMAP_ALPHA || defined BASECOLORMAP_ALPHA
uniform float m_AlphaDiscardThreshold;
#endif

Expand All @@ -16,6 +27,16 @@ void main(void)
discard;
}
#endif
#ifdef COLORMAP_ALPHA
if(texture2D(m_ColorMap,texCoord).a<m_AlphaDiscardThreshold){
discard;
}
#endif
#ifdef BASECOLORMAP_ALPHA
if(texture2D(m_BaseColorMap,texCoord).a<m_AlphaDiscardThreshold){
discard;
}
#endif
gl_FragColor = vec4(normal.xy* 0.5 + 0.5,-normal.z* 0.5 + 0.5, 1.0);

}