Skip to content

Commit

Permalink
Update test shaders to GLSL 150
Browse files Browse the repository at this point in the history
About time I guess
  • Loading branch information
Pyrofab committed Mar 19, 2023
1 parent d79fe7f commit eabc9f4
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ default ManagedCoreShader manageProgram(Identifier location, Consumer<ManagedCor
* Manages a core {@link net.minecraft.client.gl.ShaderProgram} loaded from a json definition file
*
* <p>The shader location must be in {@code assets/shaders/core}.
* Eg. to get a shader located at {@code mymod/assets/shaders/core/myshader.json}:
* E.g. to get a shader located at {@code mymod/assets/shaders/core/myshader.json}:
* <pre>{@code ShaderEffectManager.getInstance().manageCoreShader(new Identifier("mymod", "myshader")}</pre>
*
* @param location the location of the json within your mod's assets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public final class ReloadableShaderEffectManager implements ShaderEffectManager,
private final Set<ResettableManagedShaderBase<?>> managedShaders = new ReferenceOpenHashSet<>();

/**
* Manages a post processing shader loaded from a json definition file
* Manages a post-processing shader loaded from a json definition file
*
* @param location the location of the json within your mod's assets
* @return a lazily initialized shader effect
Expand All @@ -56,7 +56,7 @@ public ManagedShaderEffect manage(Identifier location) {
}

/**
* Manages a post processing shader loaded from a json definition file
* Manages a post-processing shader loaded from a json definition file
*
* @param location the location of the json within your mod's assets
* @param initCallback a block ran once the shader effect is initialized
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#version 110
#version 150

uniform sampler2D DiffuseSampler;

uniform vec4 ColorModulate;
uniform int Multiplier; // just checking ints work

varying vec2 texCoord;
in vec2 texCoord;

out vec4 fragColor;

void main() {

gl_FragColor = texture2D(DiffuseSampler, texCoord) * ColorModulate * float(Multiplier);
fragColor = texture(DiffuseSampler, texCoord) * ColorModulate * float(Multiplier);

}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#version 110
#version 150

attribute vec4 Position;
in vec4 Position;

uniform mat4 ProjMat;
uniform vec2 OutSize;

varying vec2 texCoord;
out vec2 texCoord;

void main(){
vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#version 110
#version 150

uniform sampler2D DiffuseSampler;

uniform vec4 ColorModulate;

varying vec2 texCoord;
in vec2 texCoord;

out vec4 fragColor;

void main() {

gl_FragColor = texture2D(DiffuseSampler, texCoord) * ColorModulate;
fragColor = texture(DiffuseSampler, texCoord) * ColorModulate;

}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#version 110
#version 150

attribute vec4 Position;
in vec4 Position;

uniform mat4 ProjMat;
uniform vec2 OutSize;

varying vec2 texCoord;
out vec2 texCoord;

void main(){
vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0);
Expand Down

0 comments on commit eabc9f4

Please sign in to comment.