Skip to content

Commit d537a1c

Browse files
committed
Added a GLSL150 to most of the shaders used in the engine (except deprecated ones).
All shaders now import the GLSLCompat.glsllib
1 parent 12a2f0f commit d537a1c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+149
-372
lines changed

jme3-core/src/main/java/com/jme3/post/HDRRenderer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
import java.util.Collection;
4848
import java.util.logging.Logger;
4949

50+
/**
51+
* @deprecated use the ToneMappingFilter.
52+
*/
53+
@Deprecated
5054
public class HDRRenderer implements SceneProcessor {
5155

5256
private static final int LUMMODE_NONE = 0x1,

jme3-core/src/main/resources/Common/MatDefs/Blur/HGaussianBlur.frag

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#import "Common/ShaderLib/GLSLCompat.glsllib"
12
uniform sampler2D m_Texture; // this should hold the texture rendered by the horizontal blur pass
23
uniform float m_Size;
34
uniform float m_Scale;

jme3-core/src/main/resources/Common/MatDefs/Blur/HGaussianBlur.j3md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MaterialDef Bloom {
1+
MaterialDef HGaussianBlur {
22

33
MaterialParameters {
44
Int NumSamples
@@ -8,8 +8,8 @@ MaterialDef Bloom {
88
}
99

1010
Technique {
11-
VertexShader GLSL100: Common/MatDefs/Post/Post.vert
12-
FragmentShader GLSL100: Common/MatDefs/Blur/HGaussianBlur.frag
11+
VertexShader GLSL100 GLSL150: Common/MatDefs/Post/Post.vert
12+
FragmentShader GLSL100 GLSL150: Common/MatDefs/Blur/HGaussianBlur.frag
1313

1414
WorldParameters {
1515
}

jme3-core/src/main/resources/Common/MatDefs/Blur/RadialBlur.frag

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
uniform sampler2D m_Texture;
1+
#import "Common/ShaderLib/GLSLCompat.glsllib"
2+
#import "Common/ShaderLib/MultiSample.glsllib"
3+
4+
uniform COLORTEXTURE m_Texture;
25
uniform float m_SampleDist;
36
uniform float m_SampleStrength;
47
uniform float m_Samples[10];
8+
59
varying vec2 texCoord;
610

711
void main(void)
@@ -22,15 +26,14 @@ void main(void)
2226

2327
// this is the original colour of this fragment
2428
// using only this would result in a nonblurred version
25-
vec4 colorRes = texture2D(m_Texture,texCoord);
29+
vec4 colorRes = getColor(m_Texture,texCoord);
2630

2731
vec4 sum = colorRes;
2832

2933
// take 10 additional blur samples in the direction towards
3034
// the center of the screen
31-
for (int i = 0; i < 10; i++)
32-
{
33-
sum += texture2D( m_Texture, texCoord + dir * m_Samples[i] * m_SampleDist );
35+
for (int i = 0; i < 10; i++){
36+
sum += getColor( m_Texture, texCoord + dir * m_Samples[i] * m_SampleDist );
3437
}
3538

3639
// we have taken eleven samples
@@ -42,6 +45,6 @@ void main(void)
4245
t = clamp( t ,0.0,1.0); //0 &lt;= t &lt;= 1
4346

4447
//Blend the original color with the averaged pixels
45-
gl_FragColor =mix( colorRes, sum, t );
48+
gl_FragColor = mix( colorRes, sum, t );
4649

4750
}

jme3-core/src/main/resources/Common/MatDefs/Blur/RadialBlur.j3md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ MaterialDef Radial Blur {
1010
}
1111

1212
Technique {
13-
VertexShader GLSL150: Common/MatDefs/Post/Post15.vert
14-
FragmentShader GLSL150: Common/MatDefs/Blur/RadialBlur15.frag
13+
VertexShader GLSL120 GLSL150: Common/MatDefs/Post/Post.vert
14+
FragmentShader GLSL120 GLSL150: Common/MatDefs/Blur/RadialBlur.frag
1515

1616
WorldParameters {
1717
}
@@ -20,12 +20,4 @@ MaterialDef Radial Blur {
2020
RESOLVE_MS : NumSamples
2121
}
2222
}
23-
24-
Technique {
25-
VertexShader GLSL120: Common/MatDefs/Post/Post.vert
26-
FragmentShader GLSL120: Common/MatDefs/Blur/RadialBlur.frag
27-
28-
WorldParameters {
29-
}
30-
}
3123
}

jme3-core/src/main/resources/Common/MatDefs/Blur/RadialBlur15.frag

Lines changed: 0 additions & 50 deletions
This file was deleted.

jme3-core/src/main/resources/Common/MatDefs/Blur/VGaussianBlur.frag

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#import "Common/ShaderLib/GLSLCompat.glsllib"
12
uniform sampler2D m_Texture; // this should hold the texture rendered by the horizontal blur pass
23
uniform float m_Size;
34
uniform float m_Scale;

jme3-core/src/main/resources/Common/MatDefs/Blur/VGaussianBlur.j3md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MaterialDef Bloom {
1+
MaterialDef VGaussianBlur {
22

33
MaterialParameters {
44
Int NumSamples
@@ -8,8 +8,8 @@ MaterialDef Bloom {
88
}
99

1010
Technique {
11-
VertexShader GLSL100: Common/MatDefs/Post/Post.vert
12-
FragmentShader GLSL100: Common/MatDefs/Blur/VGaussianBlur.frag
11+
VertexShader GLSL100 GLSL150: Common/MatDefs/Post/Post.vert
12+
FragmentShader GLSL100 GLSL150: Common/MatDefs/Blur/VGaussianBlur.frag
1313

1414
WorldParameters {
1515
}

jme3-core/src/main/resources/Common/MatDefs/Light/Deferred.j3md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//Don't use this
12
MaterialDef Phong Lighting Deferred {
23

34
MaterialParameters {

jme3-core/src/main/resources/Common/MatDefs/Light/Glow.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
#import "Common/ShaderLib/GLSLCompat.glsllib"
22
#if defined(NEED_TEXCOORD1)
33
varying vec2 texCoord1;
44
#else

0 commit comments

Comments
 (0)