* Updated to latest version of Nifty GUI 1.3
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7270 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
3e34002525
commit
6ed32b479c
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -4,30 +4,28 @@ uniform COLORTEXTURE m_Texture;
|
|||||||
|
|
||||||
uniform float m_ExposurePow;
|
uniform float m_ExposurePow;
|
||||||
uniform float m_ExposureCutoff;
|
uniform float m_ExposureCutoff;
|
||||||
in vec2 texCoord;
|
|
||||||
|
|
||||||
|
in vec2 texCoord;
|
||||||
|
|
||||||
#ifdef HAS_GLOWMAP
|
#ifdef HAS_GLOWMAP
|
||||||
uniform sampler2D m_GlowMap;
|
uniform sampler2D m_GlowMap;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void main(void)
|
void main(){
|
||||||
{
|
|
||||||
vec4 color;
|
vec4 color;
|
||||||
#ifdef DO_EXTRACT
|
#ifdef DO_EXTRACT
|
||||||
|
|
||||||
color = getColor(m_Texture, texCoord);
|
color = getColor(m_Texture, texCoord);
|
||||||
if ( (color.r+color.g+color.b)/3.0 < m_ExposureCutoff ) {
|
if ( (color.r + color.g + color.b) / 3.0 < m_ExposureCutoff ) {
|
||||||
color = vec4(0.0);
|
color = vec4(0.0);
|
||||||
}else{
|
}else{
|
||||||
color = pow(color,vec4(m_ExposurePow));
|
color = pow(color, vec4(m_ExposurePow));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_GLOWMAP
|
#ifdef HAS_GLOWMAP
|
||||||
vec4 glowColor = texture2D( m_GlowMap, texCoord );
|
vec4 glowColor = texture2D( m_GlowMap, texCoord );
|
||||||
glowColor = pow(glowColor,vec4(m_ExposurePow));
|
glowColor = pow(glowColor, vec4(m_ExposurePow));
|
||||||
color+=glowColor;
|
color += glowColor;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gl_FragColor = color;
|
gl_FragColor = color;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#extension GL_ARB_texture_multisample : enable
|
#extension GL_ARB_texture_multisample : enable
|
||||||
uniform int m_NumSamples;
|
uniform int m_NumSamples;
|
||||||
uniform int m_NumSamplesDepth;
|
uniform int m_NumSamplesDepth;
|
||||||
|
|
||||||
#ifdef RESOLVE_MS
|
#ifdef RESOLVE_MS
|
||||||
#define COLORTEXTURE sampler2DMS
|
#define COLORTEXTURE sampler2DMS
|
||||||
#else
|
#else
|
||||||
@ -9,7 +10,6 @@ uniform int m_NumSamplesDepth;
|
|||||||
|
|
||||||
#ifdef RESOLVE_DEPTH_MS
|
#ifdef RESOLVE_DEPTH_MS
|
||||||
#define DEPTHTEXTURE sampler2DMS
|
#define DEPTHTEXTURE sampler2DMS
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define DEPTHTEXTURE sampler2D
|
#define DEPTHTEXTURE sampler2D
|
||||||
#endif
|
#endif
|
||||||
@ -17,10 +17,10 @@ uniform int m_NumSamplesDepth;
|
|||||||
vec4 textureFetch(in sampler2DMS tex,in vec2 texC, in int numSamples){
|
vec4 textureFetch(in sampler2DMS tex,in vec2 texC, in int numSamples){
|
||||||
ivec2 iTexC = ivec2(texC * textureSize(tex));
|
ivec2 iTexC = ivec2(texC * textureSize(tex));
|
||||||
vec4 color = vec4(0.0);
|
vec4 color = vec4(0.0);
|
||||||
for (int i=0;i<numSamples;i++){
|
for (int i = 0; i < numSamples; i++){
|
||||||
color += texelFetch(tex, iTexC, i);
|
color += texelFetch(tex, iTexC, i);
|
||||||
}
|
}
|
||||||
return color/numSamples;
|
return color / numSamples;
|
||||||
}
|
}
|
||||||
|
|
||||||
vec4 fetchTextureSample(in sampler2D tex,in vec2 texC,in int sample){
|
vec4 fetchTextureSample(in sampler2D tex,in vec2 texC,in int sample){
|
||||||
@ -32,11 +32,11 @@ vec4 fetchTextureSample(in sampler2DMS tex,in vec2 texC,in int sample){
|
|||||||
return texelFetch(tex, iTexC, sample);
|
return texelFetch(tex, iTexC, sample);
|
||||||
}
|
}
|
||||||
|
|
||||||
vec4 getColor(in sampler2D tex,in vec2 texC){
|
vec4 getColor(in sampler2D tex, in vec2 texC){
|
||||||
return texture2D(tex,texC);
|
return texture2D(tex,texC);
|
||||||
}
|
}
|
||||||
|
|
||||||
vec4 getColor(in sampler2DMS tex,in vec2 texC){
|
vec4 getColor(in sampler2DMS tex, in vec2 texC){
|
||||||
return textureFetch(tex,texC,m_NumSamples);
|
return textureFetch(tex,texC,m_NumSamples);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user