diff --git a/jme3-core/src/main/resources/Common/MatDefs/Hdr/LogLum.frag b/jme3-core/src/main/resources/Common/MatDefs/Hdr/LogLum.frag index 68f08e9a6..eb80b3436 100644 --- a/jme3-core/src/main/resources/Common/MatDefs/Hdr/LogLum.frag +++ b/jme3-core/src/main/resources/Common/MatDefs/Hdr/LogLum.frag @@ -1,3 +1,4 @@ +#import "Common/ShaderLib/GLSLCompat.glsllib" #import "Common/ShaderLib/Hdr.glsllib" uniform sampler2D m_Texture; diff --git a/jme3-core/src/main/resources/Common/MatDefs/Hdr/ToneMap.frag b/jme3-core/src/main/resources/Common/MatDefs/Hdr/ToneMap.frag index f22103072..7d4aed468 100644 --- a/jme3-core/src/main/resources/Common/MatDefs/Hdr/ToneMap.frag +++ b/jme3-core/src/main/resources/Common/MatDefs/Hdr/ToneMap.frag @@ -1,3 +1,4 @@ +#import "Common/ShaderLib/GLSLCompat.glsllib" #import "Common/ShaderLib/Hdr.glsllib" varying vec2 texCoord; diff --git a/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadow.frag b/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadow.frag index c71fb3147..925bd8890 100644 --- a/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadow.frag +++ b/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadow.frag @@ -1,6 +1,5 @@ #import "Common/ShaderLib/GLSLCompat.glsllib" #import "Common/ShaderLib/Shadows.glsllib" - #if defined(PSSM) || defined(FADE) varying float shadowPosition; #endif diff --git a/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowFilter.frag b/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowFilter.frag index 3e7cc8eae..657ab46b2 100644 --- a/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowFilter.frag +++ b/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowFilter.frag @@ -1,3 +1,4 @@ +#import "Common/ShaderLib/GLSLCompat.glsllib" #import "Common/ShaderLib/Shadows.glsllib" uniform sampler2D m_Texture; diff --git a/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowFilter.j3md b/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowFilter.j3md index c1000f8d3..0023b0b81 100644 --- a/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowFilter.j3md +++ b/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowFilter.j3md @@ -42,7 +42,7 @@ MaterialDef Post Shadow { } Technique { - VertexShader GLSL150: Common/MatDefs/Shadow/PostShadowFilter15.vert + VertexShader GLSL150: Common/MatDefs/Shadow/PostShadowFilter.vert FragmentShader GLSL150: Common/MatDefs/Shadow/PostShadowFilter15.frag WorldParameters { diff --git a/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowFilter.vert b/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowFilter.vert index 8ddf7cfee..2afe447ac 100644 --- a/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowFilter.vert +++ b/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowFilter.vert @@ -1,3 +1,5 @@ +#import "Common/ShaderLib/GLSLCompat.glsllib" + attribute vec4 inPosition; attribute vec2 inTexCoord; varying vec2 texCoord; diff --git a/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowFilter15.frag b/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowFilter15.frag index b68d8fa93..034bb51d3 100644 --- a/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowFilter15.frag +++ b/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowFilter15.frag @@ -1,14 +1,13 @@ +#import "Common/ShaderLib/GLSLCompat.glsllib" #import "Common/ShaderLib/MultiSample.glsllib" #import "Common/ShaderLib/Shadows.glsllib" - uniform COLORTEXTURE m_Texture; uniform DEPTHTEXTURE m_DepthTexture; uniform mat4 m_ViewProjectionMatrixInverse; uniform vec4 m_ViewProjectionMatrixRow2; -in vec2 texCoord; -out vec4 outFragColor; +varying vec2 texCoord; const mat4 biasMat = mat4(0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, @@ -134,18 +133,17 @@ vec4 main_multiSample(in int numSample){ return color * vec4(shadow, shadow, shadow, 1.0); } -void main(){ +void main() { #ifdef RESOLVE_MS vec4 color = vec4(0.0); for (int i = 0; i < m_NumSamples; i++){ color += main_multiSample(i); } - outFragColor = color / m_NumSamples; + gl_FragColor = color / m_NumSamples; #else - outFragColor = main_multiSample(0); - #endif - + gl_FragColor = main_multiSample(0); + #endif } diff --git a/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowFilter15.vert b/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowFilter15.vert deleted file mode 100644 index 2f09f4f29..000000000 --- a/jme3-core/src/main/resources/Common/MatDefs/Shadow/PostShadowFilter15.vert +++ /dev/null @@ -1,10 +0,0 @@ -in vec4 inPosition; -in vec2 inTexCoord; - -out vec2 texCoord; - -void main() { - vec2 pos = inPosition.xy * 2.0 - 1.0; - gl_Position = vec4(pos, 0.0, 1.0); - texCoord = inTexCoord; -} \ No newline at end of file