Common.MatDefs.Post.bloomExtract.frag Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jme3-effects Show documentation
Show all versions of jme3-effects Show documentation
jMonkeyEngine is a 3-D game engine for adventurous Java developers
#import "Common/ShaderLib/GLSLCompat.glsllib"
#import "Common/ShaderLib/MultiSample.glsllib"
uniform float m_ExposurePow;
uniform float m_ExposureCutoff;
uniform COLORTEXTURE m_Texture;
varying vec2 texCoord;
#ifdef HAS_GLOWMAP
uniform sampler2D m_GlowMap;
#endif
void main(){
vec4 color = vec4(0.0);
#ifdef DO_EXTRACT
color = getColorSingle( m_Texture, texCoord );
if ( (color.r+color.g+color.b)/3.0 < m_ExposureCutoff ) {
color = vec4(0.0);
}else{
color = pow(color,vec4(m_ExposurePow));
}
#endif
#ifdef HAS_GLOWMAP
vec4 glowColor = texture2D(m_GlowMap, texCoord);
glowColor = pow(glowColor, vec4(m_ExposurePow));
color += glowColor;
#endif
gl_FragColor = color;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy