From 177e7a59dda5273df2a390fe6e2fc20b38b52925 Mon Sep 17 00:00:00 2001 From: CloudWolfYT <64243799+CloudWolfYT@users.noreply.github.com> Date: Sun, 24 Sep 2023 09:34:25 -0500 Subject: [PATCH] Fix for alpha particles --- .../minecraft/shaders/post/transparency.json | 10 -- .../shaders/program/transparency.fsh | 105 +++++++++++++++ .../shaders/program/transparency.json | 28 ++++ .../minecraft/shaders/post/transparency.json | 11 -- .../shaders/post/transparency_debug.json | 126 ------------------ .../shaders/program/toggler/remove.fsh | 20 --- .../shaders/program/toggler/remove.json | 20 --- .../shaders/program/transparency.fsh | 105 +++++++++++++++ .../shaders/program/transparency.json | 28 ++++ .../minecraft/shaders/post/transparency.json | 11 -- .../shaders/program/toggler/remove.fsh | 20 --- .../shaders/program/toggler/remove.json | 20 --- .../shaders/program/toggler/shader.vsh | 11 +- .../minecraft/shaders/core/particle.fsh | 3 - .../minecraft/shaders/post/transparency.json | 11 -- .../shaders/post/transparency_debug.json | 11 -- .../shaders/program/toggler/remove.fsh | 20 --- .../shaders/program/toggler/remove.json | 20 --- .../shaders/program/toggler/shader.vsh | 13 +- .../shaders/program/transparency.fsh | 105 +++++++++++++++ .../shaders/program/transparency.json | 28 ++++ .../minecraft/shaders/post/transparency.json | 11 -- .../shaders/post/transparency_debug.json | 11 -- .../shaders/program/toggler/remove.fsh | 20 --- .../shaders/program/toggler/remove.json | 20 --- .../shaders/program/transparency.fsh | 105 +++++++++++++++ .../shaders/program/transparency.json | 28 ++++ ShaderSelector (Core)/pack.mcmeta | 2 +- 28 files changed, 550 insertions(+), 373 deletions(-) create mode 100644 Examples/Flashlight/Shader Selector (EXP) (Flashlight)/assets/minecraft/shaders/program/transparency.fsh create mode 100644 Examples/Flashlight/Shader Selector (EXP) (Flashlight)/assets/minecraft/shaders/program/transparency.json delete mode 100644 Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/post/transparency_debug.json delete mode 100644 Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/program/toggler/remove.fsh delete mode 100644 Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/program/toggler/remove.json create mode 100644 Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/program/transparency.fsh create mode 100644 Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/program/transparency.json delete mode 100644 Examples/Screen Shake/Shader Selector (Advanced Screen Shake)/assets/minecraft/shaders/program/toggler/remove.fsh delete mode 100644 Examples/Screen Shake/Shader Selector (Advanced Screen Shake)/assets/minecraft/shaders/program/toggler/remove.json delete mode 100644 Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/program/toggler/remove.fsh delete mode 100644 Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/program/toggler/remove.json create mode 100644 Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/program/transparency.fsh create mode 100644 Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/program/transparency.json delete mode 100644 ShaderSelector (Core)/assets/minecraft/shaders/program/toggler/remove.fsh delete mode 100644 ShaderSelector (Core)/assets/minecraft/shaders/program/toggler/remove.json create mode 100644 ShaderSelector (Core)/assets/minecraft/shaders/program/transparency.fsh create mode 100644 ShaderSelector (Core)/assets/minecraft/shaders/program/transparency.json diff --git a/Examples/Flashlight/Shader Selector (EXP) (Flashlight)/assets/minecraft/shaders/post/transparency.json b/Examples/Flashlight/Shader Selector (EXP) (Flashlight)/assets/minecraft/shaders/post/transparency.json index 90ee9fc..f75fdf0 100644 --- a/Examples/Flashlight/Shader Selector (EXP) (Flashlight)/assets/minecraft/shaders/post/transparency.json +++ b/Examples/Flashlight/Shader Selector (EXP) (Flashlight)/assets/minecraft/shaders/post/transparency.json @@ -29,16 +29,6 @@ } ] }, - { - "name": "toggler/remove", - "intarget": "particles", - "outtarget": "final" - }, - { - "name": "blit", - "intarget": "final", - "outtarget": "particles" - }, { "name": "transparency", "intarget": "minecraft:main", diff --git a/Examples/Flashlight/Shader Selector (EXP) (Flashlight)/assets/minecraft/shaders/program/transparency.fsh b/Examples/Flashlight/Shader Selector (EXP) (Flashlight)/assets/minecraft/shaders/program/transparency.fsh new file mode 100644 index 0000000..967b73b --- /dev/null +++ b/Examples/Flashlight/Shader Selector (EXP) (Flashlight)/assets/minecraft/shaders/program/transparency.fsh @@ -0,0 +1,105 @@ +#version 150 + +uniform sampler2D DiffuseSampler; +uniform sampler2D DiffuseDepthSampler; +uniform sampler2D TranslucentSampler; +uniform sampler2D TranslucentDepthSampler; +uniform sampler2D ItemEntitySampler; +uniform sampler2D ItemEntityDepthSampler; +uniform sampler2D ParticlesSampler; +uniform sampler2D ParticlesDepthSampler; +uniform sampler2D WeatherSampler; +uniform sampler2D WeatherDepthSampler; +uniform sampler2D CloudsSampler; +uniform sampler2D CloudsDepthSampler; + +in vec2 texCoord; + + +#define NUM_LAYERS 6 + +vec4 color_layers[NUM_LAYERS]; +float depth_layers[NUM_LAYERS]; +int active_layers = 0; + +out vec4 fragColor; + +void try_insert( vec4 color, float depth ) { + if ( color.a == 0.0 ) { + return; + } + + color_layers[active_layers] = color; + depth_layers[active_layers] = depth; + + int jj = active_layers++; + int ii = jj - 1; + while ( jj > 0 && depth_layers[jj] > depth_layers[ii] ) { + float depthTemp = depth_layers[ii]; + depth_layers[ii] = depth_layers[jj]; + depth_layers[jj] = depthTemp; + + vec4 colorTemp = color_layers[ii]; + color_layers[ii] = color_layers[jj]; + color_layers[jj] = colorTemp; + + jj = ii--; + } +} + +flat in vec2 oneTexel; + +void try_insert_particle( vec4 color, float depth ) { + vec4 col = color; + bool isMarker = col.rg * 255. == vec2(254., 253.); + if (isMarker) { + col = texture( + DiffuseSampler, + texCoord + vec2(0.0, oneTexel.y) + ); + } + + if ( col.a == 0.0 ) { + return; + } + + color_layers[active_layers] = col; + depth_layers[active_layers] = depth; + + int jj = active_layers++; + int ii = jj - 1; + while ( jj > 0 && depth_layers[jj] > depth_layers[ii] ) { + float depthTemp = depth_layers[ii]; + depth_layers[ii] = depth_layers[jj]; + depth_layers[jj] = depthTemp; + + vec4 colorTemp = color_layers[ii]; + color_layers[ii] = color_layers[jj]; + color_layers[jj] = colorTemp; + + jj = ii--; + } +} + +vec3 blend( vec3 dst, vec4 src ) { + return ( dst * ( 1.0 - src.a ) ) + src.rgb; +} + +void main() { + color_layers[0] = vec4( texture( DiffuseSampler, texCoord ).rgb, 1.0 ); + depth_layers[0] = texture( DiffuseDepthSampler, texCoord ).r; + active_layers = 1; + + try_insert( texture( TranslucentSampler, texCoord ), texture( TranslucentDepthSampler, texCoord ).r ); + try_insert( texture( ItemEntitySampler, texCoord ), texture( ItemEntityDepthSampler, texCoord ).r ); + try_insert_particle( texture( ParticlesSampler, texCoord ), texture( ParticlesDepthSampler, texCoord ).r ); + try_insert( texture( WeatherSampler, texCoord ), texture( WeatherDepthSampler, texCoord ).r ); + try_insert( texture( CloudsSampler, texCoord ), texture( CloudsDepthSampler, texCoord ).r ); + + vec3 texelAccum = color_layers[0].rgb; + for ( int ii = 1; ii < active_layers; ++ii ) { + texelAccum = blend( texelAccum, color_layers[ii] ); + } + + fragColor = vec4( texelAccum.rgb, 1.0 ); +} diff --git a/Examples/Flashlight/Shader Selector (EXP) (Flashlight)/assets/minecraft/shaders/program/transparency.json b/Examples/Flashlight/Shader Selector (EXP) (Flashlight)/assets/minecraft/shaders/program/transparency.json new file mode 100644 index 0000000..66b9835 --- /dev/null +++ b/Examples/Flashlight/Shader Selector (EXP) (Flashlight)/assets/minecraft/shaders/program/transparency.json @@ -0,0 +1,28 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "screenquad", + "fragment": "transparency", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" }, + { "name": "DiffuseDepthSampler" }, + { "name": "TranslucentSampler" }, + { "name": "TranslucentDepthSampler" }, + { "name": "ItemEntitySampler" }, + { "name": "ItemEntityDepthSampler" }, + { "name": "ParticlesSampler" }, + { "name": "ParticlesDepthSampler" }, + { "name": "CloudsSampler" }, + { "name": "CloudsDepthSampler" }, + { "name": "WeatherSampler" }, + { "name": "WeatherDepthSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/post/transparency.json b/Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/post/transparency.json index 58cd309..2983046 100644 --- a/Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/post/transparency.json +++ b/Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/post/transparency.json @@ -2,7 +2,6 @@ "targets": [ { "name": "controller", "width": 2, "height": 3 }, { "name": "controllerSwap", "width": 2, "height": 3 }, - { "name": "manic.tentacles", "width": 256, "height": 256}, "water", "translucent", "itemEntity", @@ -30,16 +29,6 @@ } ] }, - { - "name": "toggler/remove", - "intarget": "particles", - "outtarget": "final" - }, - { - "name": "blit", - "intarget": "final", - "outtarget": "particles" - }, { "name": "transparency", "intarget": "minecraft:main", diff --git a/Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/post/transparency_debug.json b/Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/post/transparency_debug.json deleted file mode 100644 index 3720351..0000000 --- a/Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/post/transparency_debug.json +++ /dev/null @@ -1,126 +0,0 @@ -{ - "targets": [ - { "name": "controller", "width": 2, "height": 3 }, - { "name": "controllerSwap", "width": 2, "height": 3 }, - { "name": "manic.tentacles", "width": 256, "height": 256}, - "water", - "translucent", - "itemEntity", - "particles", - "clouds", - "weather", - "final", - "swap" - ], - "passes": [ - { - "name": "toggler/copy", - "intarget": "controller", - "outtarget": "controllerSwap" - }, - { - "name": "toggler/findcolor", - "intarget": "controllerSwap", - "outtarget": "controller", - "auxtargets": [ - { - "name": "ParticleSampler", - "id": "particles" - } - ] - }, - { - "name": "toggler/remove", - "intarget": "particles", - "outtarget": "final" - }, - { - "name": "blit", - "intarget": "final", - "outtarget": "particles" - }, - { - "name": "transparency", - "intarget": "minecraft:main", - "outtarget": "final", - "auxtargets": [ - { - "name": "DiffuseDepthSampler", - "id": "minecraft:main:depth" - }, - { - "name": "TranslucentSampler", - "id": "translucent" - }, - { - "name": "TranslucentDepthSampler", - "id": "translucent:depth" - }, - { - "name": "ItemEntitySampler", - "id": "itemEntity" - }, - { - "name": "ItemEntityDepthSampler", - "id": "itemEntity:depth" - }, - { - "name": "ParticlesSampler", - "id": "particles" - }, - { - "name": "ParticlesDepthSampler", - "id": "particles:depth" - }, - { - "name": "CloudsSampler", - "id": "clouds" - }, - { - "name": "CloudsDepthSampler", - "id": "clouds:depth" - }, - { - "name": "WeatherSampler", - "id": "weather" - }, - { - "name": "WeatherDepthSampler", - "id": "weather:depth" - } - ] - }, - { - "name": "debug/draw_text", - "intarget": "final", - "auxtargets": [ - { - "name": "FontSampler", - "id": "shader_font", - "width":1, - "height":1, - "bilinear":false - }, - { - "name": "NumberSampler", - "id":"controller" - } - ], - "outtarget": "swap" - }, - { - "name": "blit", - "intarget": "swap", - "outtarget": "final" - }, - { - "name": "toggler/shader", - "intarget": "final", - "outtarget": "minecraft:main", - "auxtargets": [ - {"name": "ControlSampler","id": "controller"}, - {"name": "DiffuseDepthSampler","id": "minecraft:main:depth"} - ] - } - ] -} diff --git a/Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/program/toggler/remove.fsh b/Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/program/toggler/remove.fsh deleted file mode 100644 index d5080dd..0000000 --- a/Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/program/toggler/remove.fsh +++ /dev/null @@ -1,20 +0,0 @@ -#version 150 - -uniform sampler2D DiffuseSampler; - -in vec2 texCoord; -flat in vec2 oneTexel; - -out vec4 fragColor; - -void main() { - vec4 col = texture(DiffuseSampler, texCoord); - bool isMarker = col.rg * 255. == vec2(254., 253.); - if (isMarker) { - col = texture( - DiffuseSampler, - texCoord + vec2(0.0, oneTexel.y) - ); - } - fragColor = col; -} \ No newline at end of file diff --git a/Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/program/toggler/remove.json b/Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/program/toggler/remove.json deleted file mode 100644 index fd436cb..0000000 --- a/Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/program/toggler/remove.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "blend": { - "func": "add", - "srcrgb": "one", - "dstrgb": "zero" - }, - "vertex": "toggler/copy", - "fragment": "toggler/remove", - "attributes": [ "Position" ], - "samplers": [ - { "name": "DiffuseSampler" } - ], - "uniforms": [ - { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, - { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, - { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, - { "name": "Time", "type": "float", "count": 1, "values": [ 0.0 ] }, - { "name": "ColorModulate", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] } - ] -} \ No newline at end of file diff --git a/Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/program/transparency.fsh b/Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/program/transparency.fsh new file mode 100644 index 0000000..967b73b --- /dev/null +++ b/Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/program/transparency.fsh @@ -0,0 +1,105 @@ +#version 150 + +uniform sampler2D DiffuseSampler; +uniform sampler2D DiffuseDepthSampler; +uniform sampler2D TranslucentSampler; +uniform sampler2D TranslucentDepthSampler; +uniform sampler2D ItemEntitySampler; +uniform sampler2D ItemEntityDepthSampler; +uniform sampler2D ParticlesSampler; +uniform sampler2D ParticlesDepthSampler; +uniform sampler2D WeatherSampler; +uniform sampler2D WeatherDepthSampler; +uniform sampler2D CloudsSampler; +uniform sampler2D CloudsDepthSampler; + +in vec2 texCoord; + + +#define NUM_LAYERS 6 + +vec4 color_layers[NUM_LAYERS]; +float depth_layers[NUM_LAYERS]; +int active_layers = 0; + +out vec4 fragColor; + +void try_insert( vec4 color, float depth ) { + if ( color.a == 0.0 ) { + return; + } + + color_layers[active_layers] = color; + depth_layers[active_layers] = depth; + + int jj = active_layers++; + int ii = jj - 1; + while ( jj > 0 && depth_layers[jj] > depth_layers[ii] ) { + float depthTemp = depth_layers[ii]; + depth_layers[ii] = depth_layers[jj]; + depth_layers[jj] = depthTemp; + + vec4 colorTemp = color_layers[ii]; + color_layers[ii] = color_layers[jj]; + color_layers[jj] = colorTemp; + + jj = ii--; + } +} + +flat in vec2 oneTexel; + +void try_insert_particle( vec4 color, float depth ) { + vec4 col = color; + bool isMarker = col.rg * 255. == vec2(254., 253.); + if (isMarker) { + col = texture( + DiffuseSampler, + texCoord + vec2(0.0, oneTexel.y) + ); + } + + if ( col.a == 0.0 ) { + return; + } + + color_layers[active_layers] = col; + depth_layers[active_layers] = depth; + + int jj = active_layers++; + int ii = jj - 1; + while ( jj > 0 && depth_layers[jj] > depth_layers[ii] ) { + float depthTemp = depth_layers[ii]; + depth_layers[ii] = depth_layers[jj]; + depth_layers[jj] = depthTemp; + + vec4 colorTemp = color_layers[ii]; + color_layers[ii] = color_layers[jj]; + color_layers[jj] = colorTemp; + + jj = ii--; + } +} + +vec3 blend( vec3 dst, vec4 src ) { + return ( dst * ( 1.0 - src.a ) ) + src.rgb; +} + +void main() { + color_layers[0] = vec4( texture( DiffuseSampler, texCoord ).rgb, 1.0 ); + depth_layers[0] = texture( DiffuseDepthSampler, texCoord ).r; + active_layers = 1; + + try_insert( texture( TranslucentSampler, texCoord ), texture( TranslucentDepthSampler, texCoord ).r ); + try_insert( texture( ItemEntitySampler, texCoord ), texture( ItemEntityDepthSampler, texCoord ).r ); + try_insert_particle( texture( ParticlesSampler, texCoord ), texture( ParticlesDepthSampler, texCoord ).r ); + try_insert( texture( WeatherSampler, texCoord ), texture( WeatherDepthSampler, texCoord ).r ); + try_insert( texture( CloudsSampler, texCoord ), texture( CloudsDepthSampler, texCoord ).r ); + + vec3 texelAccum = color_layers[0].rgb; + for ( int ii = 1; ii < active_layers; ++ii ) { + texelAccum = blend( texelAccum, color_layers[ii] ); + } + + fragColor = vec4( texelAccum.rgb, 1.0 ); +} diff --git a/Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/program/transparency.json b/Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/program/transparency.json new file mode 100644 index 0000000..66b9835 --- /dev/null +++ b/Examples/Phosphor/Shader.Selector.Phosphor/assets/minecraft/shaders/program/transparency.json @@ -0,0 +1,28 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "screenquad", + "fragment": "transparency", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" }, + { "name": "DiffuseDepthSampler" }, + { "name": "TranslucentSampler" }, + { "name": "TranslucentDepthSampler" }, + { "name": "ItemEntitySampler" }, + { "name": "ItemEntityDepthSampler" }, + { "name": "ParticlesSampler" }, + { "name": "ParticlesDepthSampler" }, + { "name": "CloudsSampler" }, + { "name": "CloudsDepthSampler" }, + { "name": "WeatherSampler" }, + { "name": "WeatherDepthSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/Examples/Screen Shake/Shader Selector (Advanced Screen Shake)/assets/minecraft/shaders/post/transparency.json b/Examples/Screen Shake/Shader Selector (Advanced Screen Shake)/assets/minecraft/shaders/post/transparency.json index d26bd43..4ce998d 100644 --- a/Examples/Screen Shake/Shader Selector (Advanced Screen Shake)/assets/minecraft/shaders/post/transparency.json +++ b/Examples/Screen Shake/Shader Selector (Advanced Screen Shake)/assets/minecraft/shaders/post/transparency.json @@ -2,7 +2,6 @@ "targets": [ { "name": "controller", "width": 2, "height": 3 }, { "name": "controllerSwap", "width": 2, "height": 3 }, - { "name": "manic.tentacles", "width": 256, "height": 256}, "water", "translucent", "itemEntity", @@ -29,16 +28,6 @@ } ] }, - { - "name": "toggler/remove", - "intarget": "particles", - "outtarget": "final" - }, - { - "name": "blit", - "intarget": "final", - "outtarget": "particles" - }, { "name": "transparency", "intarget": "minecraft:main", diff --git a/Examples/Screen Shake/Shader Selector (Advanced Screen Shake)/assets/minecraft/shaders/program/toggler/remove.fsh b/Examples/Screen Shake/Shader Selector (Advanced Screen Shake)/assets/minecraft/shaders/program/toggler/remove.fsh deleted file mode 100644 index d5080dd..0000000 --- a/Examples/Screen Shake/Shader Selector (Advanced Screen Shake)/assets/minecraft/shaders/program/toggler/remove.fsh +++ /dev/null @@ -1,20 +0,0 @@ -#version 150 - -uniform sampler2D DiffuseSampler; - -in vec2 texCoord; -flat in vec2 oneTexel; - -out vec4 fragColor; - -void main() { - vec4 col = texture(DiffuseSampler, texCoord); - bool isMarker = col.rg * 255. == vec2(254., 253.); - if (isMarker) { - col = texture( - DiffuseSampler, - texCoord + vec2(0.0, oneTexel.y) - ); - } - fragColor = col; -} \ No newline at end of file diff --git a/Examples/Screen Shake/Shader Selector (Advanced Screen Shake)/assets/minecraft/shaders/program/toggler/remove.json b/Examples/Screen Shake/Shader Selector (Advanced Screen Shake)/assets/minecraft/shaders/program/toggler/remove.json deleted file mode 100644 index fd436cb..0000000 --- a/Examples/Screen Shake/Shader Selector (Advanced Screen Shake)/assets/minecraft/shaders/program/toggler/remove.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "blend": { - "func": "add", - "srcrgb": "one", - "dstrgb": "zero" - }, - "vertex": "toggler/copy", - "fragment": "toggler/remove", - "attributes": [ "Position" ], - "samplers": [ - { "name": "DiffuseSampler" } - ], - "uniforms": [ - { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, - { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, - { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, - { "name": "Time", "type": "float", "count": 1, "values": [ 0.0 ] }, - { "name": "ColorModulate", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] } - ] -} \ No newline at end of file diff --git a/Examples/Screen Shake/Shader Selector (Advanced Screen Shake)/assets/minecraft/shaders/program/toggler/shader.vsh b/Examples/Screen Shake/Shader Selector (Advanced Screen Shake)/assets/minecraft/shaders/program/toggler/shader.vsh index bb8fa8c..4dbede8 100644 --- a/Examples/Screen Shake/Shader Selector (Advanced Screen Shake)/assets/minecraft/shaders/program/toggler/shader.vsh +++ b/Examples/Screen Shake/Shader Selector (Advanced Screen Shake)/assets/minecraft/shaders/program/toggler/shader.vsh @@ -9,6 +9,11 @@ uniform sampler2D ControlSampler; out vec2 texCoord; +float time() { + vec3 control_time = texelFetch(ControlSampler, ivec2(0, 0), 0).rgb; + return control_time.x + 255. * control_time.y + 65025. * control_time.z; +} + void main(){ // REQUIRED Blit Copy Statement float x = -1.0; @@ -27,7 +32,7 @@ void main(){ // Normalized pixel coordinates (from 0 to 1) vec2 uv = Position.xy/OutSize.xy; - vec4 control_time = texelFetch(ControlSampler, ivec2(0, 0), 0); + float t = time(); vec4 control_color = texelFetch(ControlSampler, ivec2(0, 2), 0); vec2 freq = vec2(control_color.b * 255.,control_color.b * 255.); // Channel #2 Controls Shake Freq control_color = texelFetch(ControlSampler, ivec2(0, 1), 0); @@ -39,8 +44,8 @@ void main(){ uv += 0.5; if(control_color.b * 255. > 0) { - uv.x += sin(control_time.r * freq.x) * magnitude.x; - uv.y += cos(control_time.r * freq.y) * magnitude.y; + uv.x += sin(t * freq.x) * magnitude.x; + uv.y += cos(t * freq.y) * magnitude.y; } // switch(int(control_color.b * 255.)) { diff --git a/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/core/particle.fsh b/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/core/particle.fsh index 871fc54..6b6dbbb 100644 --- a/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/core/particle.fsh +++ b/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/core/particle.fsh @@ -33,9 +33,6 @@ void main() { } else { // Vanilla calculation + emissive stuff vec4 color = texture(Sampler0, texCoord0) * vertexColor * ColorModulator; - float alpha = textureLod(Sampler0, texCoord0, 0.0).a * 255.0; - color = make_emissive(color, lightColor, maxLightColor, vertexDistance, alpha); - color.a = remap_alpha(alpha) / 255.0; if (color.a < 0.1) { discard; } diff --git a/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/post/transparency.json b/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/post/transparency.json index d26bd43..4ce998d 100644 --- a/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/post/transparency.json +++ b/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/post/transparency.json @@ -2,7 +2,6 @@ "targets": [ { "name": "controller", "width": 2, "height": 3 }, { "name": "controllerSwap", "width": 2, "height": 3 }, - { "name": "manic.tentacles", "width": 256, "height": 256}, "water", "translucent", "itemEntity", @@ -29,16 +28,6 @@ } ] }, - { - "name": "toggler/remove", - "intarget": "particles", - "outtarget": "final" - }, - { - "name": "blit", - "intarget": "final", - "outtarget": "particles" - }, { "name": "transparency", "intarget": "minecraft:main", diff --git a/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/post/transparency_debug.json b/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/post/transparency_debug.json index 3720351..48cb892 100644 --- a/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/post/transparency_debug.json +++ b/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/post/transparency_debug.json @@ -2,7 +2,6 @@ "targets": [ { "name": "controller", "width": 2, "height": 3 }, { "name": "controllerSwap", "width": 2, "height": 3 }, - { "name": "manic.tentacles", "width": 256, "height": 256}, "water", "translucent", "itemEntity", @@ -29,16 +28,6 @@ } ] }, - { - "name": "toggler/remove", - "intarget": "particles", - "outtarget": "final" - }, - { - "name": "blit", - "intarget": "final", - "outtarget": "particles" - }, { "name": "transparency", "intarget": "minecraft:main", diff --git a/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/program/toggler/remove.fsh b/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/program/toggler/remove.fsh deleted file mode 100644 index d5080dd..0000000 --- a/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/program/toggler/remove.fsh +++ /dev/null @@ -1,20 +0,0 @@ -#version 150 - -uniform sampler2D DiffuseSampler; - -in vec2 texCoord; -flat in vec2 oneTexel; - -out vec4 fragColor; - -void main() { - vec4 col = texture(DiffuseSampler, texCoord); - bool isMarker = col.rg * 255. == vec2(254., 253.); - if (isMarker) { - col = texture( - DiffuseSampler, - texCoord + vec2(0.0, oneTexel.y) - ); - } - fragColor = col; -} \ No newline at end of file diff --git a/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/program/toggler/remove.json b/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/program/toggler/remove.json deleted file mode 100644 index fd436cb..0000000 --- a/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/program/toggler/remove.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "blend": { - "func": "add", - "srcrgb": "one", - "dstrgb": "zero" - }, - "vertex": "toggler/copy", - "fragment": "toggler/remove", - "attributes": [ "Position" ], - "samplers": [ - { "name": "DiffuseSampler" } - ], - "uniforms": [ - { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, - { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, - { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, - { "name": "Time", "type": "float", "count": 1, "values": [ 0.0 ] }, - { "name": "ColorModulate", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] } - ] -} \ No newline at end of file diff --git a/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/program/toggler/shader.vsh b/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/program/toggler/shader.vsh index 2e52032..eb0d2ad 100644 --- a/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/program/toggler/shader.vsh +++ b/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/program/toggler/shader.vsh @@ -9,6 +9,11 @@ uniform sampler2D ControlSampler; out vec2 texCoord; +float time() { + vec3 control_time = texelFetch(ControlSampler, ivec2(0, 0), 0).rgb; + return control_time.x + 255. * control_time.y + 65025. * control_time.z; +} + void main(){ // REQUIRED Blit Copy Statement float x = -1.0; @@ -25,11 +30,11 @@ void main(){ // Shake Effect refactored from: https://www.shadertoy.com/view/tdSyWz // Normalized pixel coordinates (from 0 to 1) - vec2 freq = vec2(100.,100.); + vec2 freq = vec2(10.,10.); vec2 magnitude = vec2(0.01,0.01); vec2 uv = Position.xy/OutSize.xy; - vec4 control_time = texelFetch(ControlSampler, ivec2(0, 0), 0); + float t = time(); // Channel #1 vec4 control_color = texelFetch(ControlSampler, ivec2(0, 1), 0); @@ -39,8 +44,8 @@ void main(){ uv *= 1.0 - 2.0 * magnitude.x; uv += 0.5; - uv.x += sin(control_time.r * freq.x) * magnitude.x; - uv.y += cos(control_time.r * freq.y) * magnitude.y; + uv.x += sin(t * freq.x) * magnitude.x; + uv.y += cos(t * freq.y) * magnitude.y; break; } diff --git a/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/program/transparency.fsh b/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/program/transparency.fsh new file mode 100644 index 0000000..967b73b --- /dev/null +++ b/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/program/transparency.fsh @@ -0,0 +1,105 @@ +#version 150 + +uniform sampler2D DiffuseSampler; +uniform sampler2D DiffuseDepthSampler; +uniform sampler2D TranslucentSampler; +uniform sampler2D TranslucentDepthSampler; +uniform sampler2D ItemEntitySampler; +uniform sampler2D ItemEntityDepthSampler; +uniform sampler2D ParticlesSampler; +uniform sampler2D ParticlesDepthSampler; +uniform sampler2D WeatherSampler; +uniform sampler2D WeatherDepthSampler; +uniform sampler2D CloudsSampler; +uniform sampler2D CloudsDepthSampler; + +in vec2 texCoord; + + +#define NUM_LAYERS 6 + +vec4 color_layers[NUM_LAYERS]; +float depth_layers[NUM_LAYERS]; +int active_layers = 0; + +out vec4 fragColor; + +void try_insert( vec4 color, float depth ) { + if ( color.a == 0.0 ) { + return; + } + + color_layers[active_layers] = color; + depth_layers[active_layers] = depth; + + int jj = active_layers++; + int ii = jj - 1; + while ( jj > 0 && depth_layers[jj] > depth_layers[ii] ) { + float depthTemp = depth_layers[ii]; + depth_layers[ii] = depth_layers[jj]; + depth_layers[jj] = depthTemp; + + vec4 colorTemp = color_layers[ii]; + color_layers[ii] = color_layers[jj]; + color_layers[jj] = colorTemp; + + jj = ii--; + } +} + +flat in vec2 oneTexel; + +void try_insert_particle( vec4 color, float depth ) { + vec4 col = color; + bool isMarker = col.rg * 255. == vec2(254., 253.); + if (isMarker) { + col = texture( + DiffuseSampler, + texCoord + vec2(0.0, oneTexel.y) + ); + } + + if ( col.a == 0.0 ) { + return; + } + + color_layers[active_layers] = col; + depth_layers[active_layers] = depth; + + int jj = active_layers++; + int ii = jj - 1; + while ( jj > 0 && depth_layers[jj] > depth_layers[ii] ) { + float depthTemp = depth_layers[ii]; + depth_layers[ii] = depth_layers[jj]; + depth_layers[jj] = depthTemp; + + vec4 colorTemp = color_layers[ii]; + color_layers[ii] = color_layers[jj]; + color_layers[jj] = colorTemp; + + jj = ii--; + } +} + +vec3 blend( vec3 dst, vec4 src ) { + return ( dst * ( 1.0 - src.a ) ) + src.rgb; +} + +void main() { + color_layers[0] = vec4( texture( DiffuseSampler, texCoord ).rgb, 1.0 ); + depth_layers[0] = texture( DiffuseDepthSampler, texCoord ).r; + active_layers = 1; + + try_insert( texture( TranslucentSampler, texCoord ), texture( TranslucentDepthSampler, texCoord ).r ); + try_insert( texture( ItemEntitySampler, texCoord ), texture( ItemEntityDepthSampler, texCoord ).r ); + try_insert_particle( texture( ParticlesSampler, texCoord ), texture( ParticlesDepthSampler, texCoord ).r ); + try_insert( texture( WeatherSampler, texCoord ), texture( WeatherDepthSampler, texCoord ).r ); + try_insert( texture( CloudsSampler, texCoord ), texture( CloudsDepthSampler, texCoord ).r ); + + vec3 texelAccum = color_layers[0].rgb; + for ( int ii = 1; ii < active_layers; ++ii ) { + texelAccum = blend( texelAccum, color_layers[ii] ); + } + + fragColor = vec4( texelAccum.rgb, 1.0 ); +} diff --git a/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/program/transparency.json b/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/program/transparency.json new file mode 100644 index 0000000..66b9835 --- /dev/null +++ b/Examples/Screen Shake/Shader Selector (Screen Shake)/assets/minecraft/shaders/program/transparency.json @@ -0,0 +1,28 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "screenquad", + "fragment": "transparency", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" }, + { "name": "DiffuseDepthSampler" }, + { "name": "TranslucentSampler" }, + { "name": "TranslucentDepthSampler" }, + { "name": "ItemEntitySampler" }, + { "name": "ItemEntityDepthSampler" }, + { "name": "ParticlesSampler" }, + { "name": "ParticlesDepthSampler" }, + { "name": "CloudsSampler" }, + { "name": "CloudsDepthSampler" }, + { "name": "WeatherSampler" }, + { "name": "WeatherDepthSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/ShaderSelector (Core)/assets/minecraft/shaders/post/transparency.json b/ShaderSelector (Core)/assets/minecraft/shaders/post/transparency.json index d26bd43..4ce998d 100644 --- a/ShaderSelector (Core)/assets/minecraft/shaders/post/transparency.json +++ b/ShaderSelector (Core)/assets/minecraft/shaders/post/transparency.json @@ -2,7 +2,6 @@ "targets": [ { "name": "controller", "width": 2, "height": 3 }, { "name": "controllerSwap", "width": 2, "height": 3 }, - { "name": "manic.tentacles", "width": 256, "height": 256}, "water", "translucent", "itemEntity", @@ -29,16 +28,6 @@ } ] }, - { - "name": "toggler/remove", - "intarget": "particles", - "outtarget": "final" - }, - { - "name": "blit", - "intarget": "final", - "outtarget": "particles" - }, { "name": "transparency", "intarget": "minecraft:main", diff --git a/ShaderSelector (Core)/assets/minecraft/shaders/post/transparency_debug.json b/ShaderSelector (Core)/assets/minecraft/shaders/post/transparency_debug.json index 3720351..48cb892 100644 --- a/ShaderSelector (Core)/assets/minecraft/shaders/post/transparency_debug.json +++ b/ShaderSelector (Core)/assets/minecraft/shaders/post/transparency_debug.json @@ -2,7 +2,6 @@ "targets": [ { "name": "controller", "width": 2, "height": 3 }, { "name": "controllerSwap", "width": 2, "height": 3 }, - { "name": "manic.tentacles", "width": 256, "height": 256}, "water", "translucent", "itemEntity", @@ -29,16 +28,6 @@ } ] }, - { - "name": "toggler/remove", - "intarget": "particles", - "outtarget": "final" - }, - { - "name": "blit", - "intarget": "final", - "outtarget": "particles" - }, { "name": "transparency", "intarget": "minecraft:main", diff --git a/ShaderSelector (Core)/assets/minecraft/shaders/program/toggler/remove.fsh b/ShaderSelector (Core)/assets/minecraft/shaders/program/toggler/remove.fsh deleted file mode 100644 index d5080dd..0000000 --- a/ShaderSelector (Core)/assets/minecraft/shaders/program/toggler/remove.fsh +++ /dev/null @@ -1,20 +0,0 @@ -#version 150 - -uniform sampler2D DiffuseSampler; - -in vec2 texCoord; -flat in vec2 oneTexel; - -out vec4 fragColor; - -void main() { - vec4 col = texture(DiffuseSampler, texCoord); - bool isMarker = col.rg * 255. == vec2(254., 253.); - if (isMarker) { - col = texture( - DiffuseSampler, - texCoord + vec2(0.0, oneTexel.y) - ); - } - fragColor = col; -} \ No newline at end of file diff --git a/ShaderSelector (Core)/assets/minecraft/shaders/program/toggler/remove.json b/ShaderSelector (Core)/assets/minecraft/shaders/program/toggler/remove.json deleted file mode 100644 index fd436cb..0000000 --- a/ShaderSelector (Core)/assets/minecraft/shaders/program/toggler/remove.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "blend": { - "func": "add", - "srcrgb": "one", - "dstrgb": "zero" - }, - "vertex": "toggler/copy", - "fragment": "toggler/remove", - "attributes": [ "Position" ], - "samplers": [ - { "name": "DiffuseSampler" } - ], - "uniforms": [ - { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, - { "name": "InSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, - { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] }, - { "name": "Time", "type": "float", "count": 1, "values": [ 0.0 ] }, - { "name": "ColorModulate", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] } - ] -} \ No newline at end of file diff --git a/ShaderSelector (Core)/assets/minecraft/shaders/program/transparency.fsh b/ShaderSelector (Core)/assets/minecraft/shaders/program/transparency.fsh new file mode 100644 index 0000000..967b73b --- /dev/null +++ b/ShaderSelector (Core)/assets/minecraft/shaders/program/transparency.fsh @@ -0,0 +1,105 @@ +#version 150 + +uniform sampler2D DiffuseSampler; +uniform sampler2D DiffuseDepthSampler; +uniform sampler2D TranslucentSampler; +uniform sampler2D TranslucentDepthSampler; +uniform sampler2D ItemEntitySampler; +uniform sampler2D ItemEntityDepthSampler; +uniform sampler2D ParticlesSampler; +uniform sampler2D ParticlesDepthSampler; +uniform sampler2D WeatherSampler; +uniform sampler2D WeatherDepthSampler; +uniform sampler2D CloudsSampler; +uniform sampler2D CloudsDepthSampler; + +in vec2 texCoord; + + +#define NUM_LAYERS 6 + +vec4 color_layers[NUM_LAYERS]; +float depth_layers[NUM_LAYERS]; +int active_layers = 0; + +out vec4 fragColor; + +void try_insert( vec4 color, float depth ) { + if ( color.a == 0.0 ) { + return; + } + + color_layers[active_layers] = color; + depth_layers[active_layers] = depth; + + int jj = active_layers++; + int ii = jj - 1; + while ( jj > 0 && depth_layers[jj] > depth_layers[ii] ) { + float depthTemp = depth_layers[ii]; + depth_layers[ii] = depth_layers[jj]; + depth_layers[jj] = depthTemp; + + vec4 colorTemp = color_layers[ii]; + color_layers[ii] = color_layers[jj]; + color_layers[jj] = colorTemp; + + jj = ii--; + } +} + +flat in vec2 oneTexel; + +void try_insert_particle( vec4 color, float depth ) { + vec4 col = color; + bool isMarker = col.rg * 255. == vec2(254., 253.); + if (isMarker) { + col = texture( + DiffuseSampler, + texCoord + vec2(0.0, oneTexel.y) + ); + } + + if ( col.a == 0.0 ) { + return; + } + + color_layers[active_layers] = col; + depth_layers[active_layers] = depth; + + int jj = active_layers++; + int ii = jj - 1; + while ( jj > 0 && depth_layers[jj] > depth_layers[ii] ) { + float depthTemp = depth_layers[ii]; + depth_layers[ii] = depth_layers[jj]; + depth_layers[jj] = depthTemp; + + vec4 colorTemp = color_layers[ii]; + color_layers[ii] = color_layers[jj]; + color_layers[jj] = colorTemp; + + jj = ii--; + } +} + +vec3 blend( vec3 dst, vec4 src ) { + return ( dst * ( 1.0 - src.a ) ) + src.rgb; +} + +void main() { + color_layers[0] = vec4( texture( DiffuseSampler, texCoord ).rgb, 1.0 ); + depth_layers[0] = texture( DiffuseDepthSampler, texCoord ).r; + active_layers = 1; + + try_insert( texture( TranslucentSampler, texCoord ), texture( TranslucentDepthSampler, texCoord ).r ); + try_insert( texture( ItemEntitySampler, texCoord ), texture( ItemEntityDepthSampler, texCoord ).r ); + try_insert_particle( texture( ParticlesSampler, texCoord ), texture( ParticlesDepthSampler, texCoord ).r ); + try_insert( texture( WeatherSampler, texCoord ), texture( WeatherDepthSampler, texCoord ).r ); + try_insert( texture( CloudsSampler, texCoord ), texture( CloudsDepthSampler, texCoord ).r ); + + vec3 texelAccum = color_layers[0].rgb; + for ( int ii = 1; ii < active_layers; ++ii ) { + texelAccum = blend( texelAccum, color_layers[ii] ); + } + + fragColor = vec4( texelAccum.rgb, 1.0 ); +} diff --git a/ShaderSelector (Core)/assets/minecraft/shaders/program/transparency.json b/ShaderSelector (Core)/assets/minecraft/shaders/program/transparency.json new file mode 100644 index 0000000..66b9835 --- /dev/null +++ b/ShaderSelector (Core)/assets/minecraft/shaders/program/transparency.json @@ -0,0 +1,28 @@ +{ + "blend": { + "func": "add", + "srcrgb": "one", + "dstrgb": "zero" + }, + "vertex": "screenquad", + "fragment": "transparency", + "attributes": [ "Position" ], + "samplers": [ + { "name": "DiffuseSampler" }, + { "name": "DiffuseDepthSampler" }, + { "name": "TranslucentSampler" }, + { "name": "TranslucentDepthSampler" }, + { "name": "ItemEntitySampler" }, + { "name": "ItemEntityDepthSampler" }, + { "name": "ParticlesSampler" }, + { "name": "ParticlesDepthSampler" }, + { "name": "CloudsSampler" }, + { "name": "CloudsDepthSampler" }, + { "name": "WeatherSampler" }, + { "name": "WeatherDepthSampler" } + ], + "uniforms": [ + { "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] }, + { "name": "OutSize", "type": "float", "count": 2, "values": [ 1.0, 1.0 ] } + ] +} diff --git a/ShaderSelector (Core)/pack.mcmeta b/ShaderSelector (Core)/pack.mcmeta index de73ba6..ba8ffb2 100644 --- a/ShaderSelector (Core)/pack.mcmeta +++ b/ShaderSelector (Core)/pack.mcmeta @@ -1,6 +1,6 @@ { "pack": { "description": "Lets you toggle shaders by DerDiscoHund & Cloud Wolf", - "pack_format": 8 + "pack_format": 18 } } \ No newline at end of file