Skip to content

Commit

Permalink
Removed all xxx15.frag shaders and used GLSLCompat to have the same s…
Browse files Browse the repository at this point in the history
…hader whatever version it's used for
  • Loading branch information
Nehon committed Jan 22, 2017
1 parent a64594e commit f7181c3
Show file tree
Hide file tree
Showing 56 changed files with 793 additions and 2,025 deletions.
@@ -1,5 +1,4 @@
#extension GL_ARB_texture_multisample : enable
#import "Common/ShaderLib/GLSLCompat.glsllib"

uniform int m_NumSamples;
uniform int m_NumSamplesDepth;
Expand Down
Expand Up @@ -41,8 +41,9 @@
*
* @author Phate666
* @version 1.0 initial version
*
* @deprecated use the Gama Correction setting instead.
*/
@Deprecated
public class GammaCorrectionFilter extends Filter {

private float gamma = 2.2f;
Expand Down
Expand Up @@ -10,8 +10,8 @@ MaterialDef Bloom {
}

Technique {
VertexShader GLSL150: Common/MatDefs/Post/Post15.vert
FragmentShader GLSL150: Common/MatDefs/Post/bloomExtract15.frag
VertexShader GLSL150 GLSL100: Common/MatDefs/Post/Post.vert
FragmentShader GLSL150 GLSL100: Common/MatDefs/Post/bloomExtract.frag

WorldParameters {
}
Expand All @@ -22,17 +22,4 @@ MaterialDef Bloom {
RESOLVE_MS : NumSamples
}
}

Technique {
VertexShader GLSL100: Common/MatDefs/Post/Post.vert
FragmentShader GLSL100: Common/MatDefs/Post/bloomExtract.frag

WorldParameters {
}

Defines {
HAS_GLOWMAP : GlowMap
DO_EXTRACT : Extract
}
}
}
Expand Up @@ -8,8 +8,8 @@ MaterialDef Bloom Final {
}

Technique {
VertexShader GLSL150: Common/MatDefs/Post/Post15.vert
FragmentShader GLSL150: Common/MatDefs/Post/bloomFinal15.frag
VertexShader GLSL150 GLSL100: Common/MatDefs/Post/Post.vert
FragmentShader GLSL150 GLSL100: Common/MatDefs/Post/bloomFinal.frag

WorldParameters {
}
Expand All @@ -19,11 +19,4 @@ MaterialDef Bloom Final {
}
}

Technique {
VertexShader GLSL100: Common/MatDefs/Post/Post.vert
FragmentShader GLSL100: Common/MatDefs/Post/bloomFinal.frag

WorldParameters {
}
}
}
@@ -1,3 +1,6 @@
#import "Common/ShaderLib/GLSLCompat.glsllib"
#import "Common/ShaderLib/MultiSample.glsllib"

uniform vec4 m_EdgeColor;

uniform float m_EdgeWidth;
Expand All @@ -11,21 +14,21 @@ uniform float m_DepthSensitivity;

varying vec2 texCoord;

uniform sampler2D m_Texture;
uniform COLORTEXTURE m_Texture;
uniform sampler2D m_NormalsTexture;
uniform sampler2D m_DepthTexture;
uniform DEPTHTEXTURE m_DepthTexture;

uniform vec2 g_ResolutionInverse;

vec4 fetchNormalDepth(vec2 tc){
vec4 nd;
nd.xyz = texture2D(m_NormalsTexture, tc).rgb;
nd.w = texture2D(m_DepthTexture, tc).r;
nd.w = fetchTextureSample(m_DepthTexture, tc, 0).r;
return nd;
}

void main(){
vec3 color = texture2D(m_Texture, texCoord).rgb;
vec3 color = getColor(m_Texture, texCoord).rgb;

vec2 edgeOffset = vec2(m_EdgeWidth) * g_ResolutionInverse;

Expand Down
Expand Up @@ -16,8 +16,8 @@ MaterialDef Cartoon Edge {
}

Technique {
VertexShader GLSL150: Common/MatDefs/Post/Post15.vert
FragmentShader GLSL150: Common/MatDefs/Post/CartoonEdge15.frag
VertexShader GLSL150 GLSL100: Common/MatDefs/Post/Post.vert
FragmentShader GLSL150 GLSL100: Common/MatDefs/Post/CartoonEdge.frag

WorldParameters {
WorldViewMatrix
Expand All @@ -30,14 +30,4 @@ MaterialDef Cartoon Edge {
}
}


Technique {
VertexShader GLSL100: Common/MatDefs/Post/Post.vert
FragmentShader GLSL100: Common/MatDefs/Post/CartoonEdge.frag

WorldParameters {
WorldViewMatrix
ResolutionInverse
}
}
}

This file was deleted.

11 changes: 7 additions & 4 deletions jme3-effects/src/main/resources/Common/MatDefs/Post/Compose.frag
@@ -1,10 +1,13 @@
uniform sampler2D m_Texture;
uniform sampler2D m_CompositeTexture;
#import "Common/ShaderLib/GLSLCompat.glsllib"
#import "Common/ShaderLib/MultiSample.glsllib"

uniform COLORTEXTURE m_Texture;
uniform COLORTEXTURE m_CompositeTexture;
varying vec2 texCoord;

void main() {
vec4 texVal = texture2D(m_Texture, texCoord);
vec4 compositeVal = texture2D(m_CompositeTexture, texCoord);
vec4 texVal = getColor(m_Texture, texCoord);
vec4 compositeVal = getColor(m_CompositeTexture, texCoord);
gl_FragColor = mix(compositeVal,texVal,texVal.a);
}

12 changes: 2 additions & 10 deletions jme3-effects/src/main/resources/Common/MatDefs/Post/Compose.j3md
Expand Up @@ -8,8 +8,8 @@ MaterialDef Default GUI {
}

Technique {
VertexShader GLSL150: Common/MatDefs/Post/Post15.vert
FragmentShader GLSL150: Common/MatDefs/Post/Compose15.frag
VertexShader GLSL150 GLSL100: Common/MatDefs/Post/Post.vert
FragmentShader GLSL150 GLSL100: Common/MatDefs/Post/Compose.frag

WorldParameters {
}
Expand All @@ -20,12 +20,4 @@ MaterialDef Default GUI {

}

Technique {
VertexShader GLSL100: Common/MatDefs/Post/Post.vert
FragmentShader GLSL100: Common/MatDefs/Post/Compose.frag

WorldParameters {
}

}
}
14 changes: 0 additions & 14 deletions jme3-effects/src/main/resources/Common/MatDefs/Post/Compose15.frag

This file was deleted.

@@ -1,4 +1,7 @@
uniform sampler2D m_Texture;
#import "Common/ShaderLib/GLSLCompat.glsllib"
#import "Common/ShaderLib/MultiSample.glsllib"

uniform COLORTEXTURE m_Texture;
varying vec2 texCoord;

uniform vec4 m_LineColor;
Expand All @@ -17,7 +20,7 @@ uniform float m_LineDistance;
uniform float m_LineThickness;

void main() {
vec4 texVal = texture2D(m_Texture, texCoord);
vec4 texVal = getColor(m_Texture, texCoord);
float linePixel = 0.0;

float lum = texVal.r*0.2126 + texVal.g*0.7152 + texVal.b*0.0722;
Expand Down
Expand Up @@ -18,19 +18,11 @@ MaterialDef CrossHatch {
}

Technique {
VertexShader GLSL150: Common/MatDefs/Post/Post15.vert
FragmentShader GLSL150: Common/MatDefs/Post/CrossHatch15.frag
VertexShader GLSL150 GLSL100: Common/MatDefs/Post/Post.vert
FragmentShader GLSL150 GLSL100: Common/MatDefs/Post/CrossHatch.frag

WorldParameters {
}
}

Technique {
VertexShader GLSL100: Common/MatDefs/Post/Post.vert
FragmentShader GLSL100: Common/MatDefs/Post/CrossHatch.frag

WorldParameters {
WorldViewProjectionMatrix
}
}

}

This file was deleted.

@@ -1,5 +1,8 @@
uniform sampler2D m_Texture;
uniform sampler2D m_DepthTexture;
#import "Common/ShaderLib/GLSLCompat.glsllib"
#import "Common/ShaderLib/MultiSample.glsllib"

uniform COLORTEXTURE m_Texture;
uniform DEPTHTEXTURE m_DepthTexture;
varying vec2 texCoord;

uniform float m_FocusRange;
Expand All @@ -11,9 +14,9 @@ vec2 m_NearFar = vec2( 0.1, 1000.0 );

void main() {

vec4 texVal = texture2D( m_Texture, texCoord );
vec4 texVal = getColor( m_Texture, texCoord );

float zBuffer = texture2D( m_DepthTexture, texCoord ).r;
float zBuffer = getDepth( m_DepthTexture, texCoord ).r;

//
// z_buffer_value = a + b / z;
Expand Down
Expand Up @@ -12,8 +12,8 @@ MaterialDef Depth Of Field {
}

Technique {
VertexShader GLSL150: Common/MatDefs/Post/Post15.vert
FragmentShader GLSL150: Common/MatDefs/Post/DepthOfField15.frag
VertexShader GLSL150 GLSL100: Common/MatDefs/Post/Post.vert
FragmentShader GLSL150 GLSL100: Common/MatDefs/Post/DepthOfField.frag

WorldParameters {
}
Expand All @@ -24,11 +24,4 @@ MaterialDef Depth Of Field {
}
}

Technique {
VertexShader GLSL100: Common/MatDefs/Post/Post.vert
FragmentShader GLSL100: Common/MatDefs/Post/DepthOfField.frag

WorldParameters {
}
}
}

0 comments on commit f7181c3

Please sign in to comment.