You've already forked minecraft-assets
Create/Update assets for version 20w29a
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
|
||||
@@ -7,9 +7,9 @@ varying vec2 oneTexel;
|
||||
|
||||
uniform vec2 InSize;
|
||||
|
||||
uniform float Resolution = 4.0;
|
||||
uniform float Saturation = 1.5;
|
||||
uniform float MosaicSize = 8.0;
|
||||
uniform float Resolution;
|
||||
uniform float Saturation;
|
||||
uniform float MosaicSize;
|
||||
|
||||
void main() {
|
||||
vec2 mosaicInSize = InSize / MosaicSize;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
attribute vec4 Position;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
attribute vec4 Position;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
|
||||
@@ -16,16 +16,16 @@ void main() {
|
||||
float totalAlpha = 0.0;
|
||||
float totalSamples = 0.0;
|
||||
for(float r = -Radius; r <= Radius; r += 1.0) {
|
||||
vec4 sample = texture2D(DiffuseSampler, texCoord + oneTexel * r * BlurDir);
|
||||
vec4 sampleValue = texture2D(DiffuseSampler, texCoord + oneTexel * r * BlurDir);
|
||||
|
||||
// Accumulate average alpha
|
||||
totalAlpha = totalAlpha + sample.a;
|
||||
totalAlpha = totalAlpha + sampleValue.a;
|
||||
totalSamples = totalSamples + 1.0;
|
||||
|
||||
// Accumulate smoothed blur
|
||||
float strength = 1.0 - abs(r / Radius);
|
||||
totalStrength = totalStrength + strength;
|
||||
blurred = blurred + sample;
|
||||
blurred = blurred + sampleValue;
|
||||
}
|
||||
gl_FragColor = vec4(blurred.rgb / (Radius * 2.0 + 1.0), totalAlpha);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
|
||||
@@ -29,6 +29,6 @@ void main(){
|
||||
f += (du * i) - (dd * i);
|
||||
f += (dr * i) - (dl * i);
|
||||
|
||||
vec4 color = c * clamp(f, 0.5, 2);
|
||||
vec4 color = c * clamp(f, 0.5, 2.0);
|
||||
gl_FragColor = vec4(color.rgb, 1.0);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
attribute vec4 Position;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
|
||||
@@ -7,13 +7,13 @@ varying vec2 oneTexel;
|
||||
|
||||
uniform vec2 InSize;
|
||||
|
||||
uniform vec3 Gray = vec3(0.3, 0.59, 0.11);
|
||||
uniform vec3 RedMatrix = vec3(1.0, 0.0, 0.0);
|
||||
uniform vec3 GreenMatrix = vec3(0.0, 1.0, 0.0);
|
||||
uniform vec3 BlueMatrix = vec3(0.0, 0.0, 1.0);
|
||||
uniform vec3 Offset = vec3(0.0, 0.0, 0.0);
|
||||
uniform vec3 ColorScale = vec3(1.0, 1.0, 1.0);
|
||||
uniform float Saturation = 1.8;
|
||||
uniform vec3 Gray;
|
||||
uniform vec3 RedMatrix;
|
||||
uniform vec3 GreenMatrix;
|
||||
uniform vec3 BlueMatrix;
|
||||
uniform vec3 Offset;
|
||||
uniform vec3 ColorScale;
|
||||
uniform float Saturation;
|
||||
|
||||
void main() {
|
||||
vec4 InTexel = texture2D(DiffuseSampler, texCoord);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
|
||||
@@ -7,10 +7,10 @@ varying vec2 oneTexel;
|
||||
|
||||
uniform vec2 InSize;
|
||||
|
||||
uniform vec3 ConvergeX = vec3(-1.0, 0.0, 0.5);
|
||||
uniform vec3 ConvergeY = vec3( 0.0, -1.0, 0.5);
|
||||
uniform vec3 RadialConvergeX = vec3(1.0, 1.0, 1.0);
|
||||
uniform vec3 RadialConvergeY = vec3(1.0, 1.0, 1.0);
|
||||
uniform vec3 ConvergeX;
|
||||
uniform vec3 ConvergeY;
|
||||
uniform vec3 RadialConvergeX;
|
||||
uniform vec3 RadialConvergeY;
|
||||
|
||||
void main() {
|
||||
vec3 CoordX = texCoord.x * RadialConvergeX;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
attribute vec4 Position;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
attribute vec4 Position;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#version 110
|
||||
#extension GL_EXT_gpu_shader4 : enable
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
attribute vec4 Position;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
attribute vec4 Position;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
uniform sampler2D DitherSampler;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
uniform sampler2D BaseSampler;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
uniform sampler2D OutlineSampler;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
uniform sampler2D OverlaySampler;
|
||||
@@ -7,10 +7,10 @@ uniform vec2 InSize;
|
||||
|
||||
varying vec2 texCoord;
|
||||
|
||||
uniform float MosaicSize = 1.0;
|
||||
uniform vec3 RedMatrix = vec3(1.0, 0.0, 0.0);
|
||||
uniform vec3 GreenMatrix = vec3(0.0, 1.0, 0.0);
|
||||
uniform vec3 BlueMatrix = vec3(0.0, 0.0, 1.0);
|
||||
uniform float MosaicSize;
|
||||
uniform vec3 RedMatrix;
|
||||
uniform vec3 GreenMatrix;
|
||||
uniform vec3 BlueMatrix;
|
||||
|
||||
void main(){
|
||||
vec2 mosaicInSize = InSize / MosaicSize;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
uniform sampler2D PrevSampler;
|
||||
@@ -8,8 +8,7 @@ varying vec2 oneTexel;
|
||||
|
||||
uniform vec2 InSize;
|
||||
|
||||
uniform vec3 Phosphor = vec3(0.7, 0.7, 0.7);
|
||||
uniform float LerpFactor = 1.0;
|
||||
uniform vec3 Phosphor;
|
||||
|
||||
void main() {
|
||||
vec4 CurrTexel = texture2D(DiffuseSampler, texCoord);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
attribute vec4 Position;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
|
||||
|
||||
14
assets/minecraft/shaders/program/screenquad.vsh
Normal file
14
assets/minecraft/shaders/program/screenquad.vsh
Normal file
@@ -0,0 +1,14 @@
|
||||
#version 110
|
||||
|
||||
attribute vec4 Position;
|
||||
|
||||
uniform mat4 ProjMat;
|
||||
uniform vec2 OutSize;
|
||||
|
||||
varying vec2 texCoord;
|
||||
|
||||
void main() {
|
||||
vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0);
|
||||
gl_Position = vec4(outPos.xy, 0.2, 1.0);
|
||||
texCoord = Position.xy / OutSize;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
attribute vec4 Position;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
uniform sampler2D BlurSampler;
|
||||
|
||||
68
assets/minecraft/shaders/program/transparency.fsh
Normal file
68
assets/minecraft/shaders/program/transparency.fsh
Normal file
@@ -0,0 +1,68 @@
|
||||
#version 110
|
||||
|
||||
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;
|
||||
|
||||
varying vec2 texCoord;
|
||||
|
||||
#define NUM_LAYERS 6
|
||||
|
||||
vec4 color_layers[NUM_LAYERS];
|
||||
float depth_layers[NUM_LAYERS];
|
||||
int active_layers = 0;
|
||||
|
||||
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--;
|
||||
}
|
||||
}
|
||||
|
||||
vec3 blend( vec3 dst, vec4 src ) {
|
||||
return ( dst * ( 1.0 - src.a ) ) + src.rgb;
|
||||
}
|
||||
|
||||
void main() {
|
||||
color_layers[0] = vec4( texture2D( DiffuseSampler, texCoord ).rgb, 1.0 );
|
||||
depth_layers[0] = texture2D( DiffuseDepthSampler, texCoord ).r;
|
||||
active_layers = 1;
|
||||
|
||||
try_insert( texture2D( TranslucentSampler, texCoord ), texture2D( TranslucentDepthSampler, texCoord ).r );
|
||||
try_insert( texture2D( ItemEntitySampler, texCoord ), texture2D( ItemEntityDepthSampler, texCoord ).r );
|
||||
try_insert( texture2D( ParticlesSampler, texCoord ), texture2D( ParticlesDepthSampler, texCoord ).r );
|
||||
try_insert( texture2D( WeatherSampler, texCoord ), texture2D( WeatherDepthSampler, texCoord ).r );
|
||||
try_insert( texture2D( CloudsSampler, texCoord ), texture2D( CloudsDepthSampler, texCoord ).r );
|
||||
|
||||
vec3 texelAccum = color_layers[0].rgb;
|
||||
for ( int ii = 1; ii < active_layers; ++ii ) {
|
||||
texelAccum = blend( texelAccum, color_layers[ii] );
|
||||
}
|
||||
|
||||
gl_FragColor = vec4( texelAccum.rgb, 1.0 );
|
||||
}
|
||||
28
assets/minecraft/shaders/program/transparency.json
Normal file
28
assets/minecraft/shaders/program/transparency.json
Normal file
@@ -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 ] }
|
||||
]
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
#version 120
|
||||
#version 110
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
|
||||
@@ -14,8 +14,8 @@ uniform vec2 WobbleAmount;
|
||||
vec3 hue(float h)
|
||||
{
|
||||
float r = abs(h * 6.0 - 3.0) - 1.0;
|
||||
float g = 2 - abs(h * 6.0 - 2.0);
|
||||
float b = 2 - abs(h * 6.0 - 4.0);
|
||||
float g = 2.0 - abs(h * 6.0 - 2.0);
|
||||
float b = 2.0 - abs(h * 6.0 - 4.0);
|
||||
return clamp(vec3(r,g,b), 0.0, 1.0);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ vec3 RGBtoHSV(vec3 rgb) {
|
||||
float min = min(rgb.r, min(rgb.g, rgb.b));
|
||||
float c = hsv.z - min;
|
||||
|
||||
if (c != 0)
|
||||
if (c != 0.0)
|
||||
{
|
||||
hsv.y = c / hsv.z;
|
||||
vec3 delta = (hsv.z - rgb) / c;
|
||||
|
||||
Reference in New Issue
Block a user