Arbeiten aus dem URlaub
This commit is contained in:
20
ez-tree-jme/assets/Shaders/LeafPostShadow.frag
Normal file
20
ez-tree-jme/assets/Shaders/LeafPostShadow.frag
Normal file
@@ -0,0 +1,20 @@
|
||||
#import "Common/ShaderLib/GLSLCompat.glsllib"
|
||||
|
||||
uniform sampler2D m_ShadowMap0;
|
||||
uniform float m_ShadowIntensity;
|
||||
uniform sampler2D m_LeafMap;
|
||||
uniform bool m_HasLeafMap;
|
||||
|
||||
in vec4 shadowCoord;
|
||||
in vec2 texCoord;
|
||||
|
||||
void main() {
|
||||
// Transparente Blattbereiche empfangen keinen Schatten
|
||||
if (m_HasLeafMap && texture2D(m_LeafMap, texCoord).a < 0.5) discard;
|
||||
|
||||
vec3 coord = shadowCoord.xyz / shadowCoord.w;
|
||||
float mapDepth = texture2D(m_ShadowMap0, coord.xy).r;
|
||||
float lit = (coord.z > mapDepth + 0.001) ? (1.0 - m_ShadowIntensity) : 1.0;
|
||||
|
||||
gl_FragColor = vec4(lit, lit, lit, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user