You've already forked minecraft-assets
Create/Update assets for version 1.17.1
This commit is contained in:
1
assets/minecraft/shaders/core/_all.json
Normal file
1
assets/minecraft/shaders/core/_all.json
Normal file
File diff suppressed because one or more lines are too long
1
assets/minecraft/shaders/core/_list.json
Normal file
1
assets/minecraft/shaders/core/_list.json
Normal file
File diff suppressed because one or more lines are too long
17
assets/minecraft/shaders/core/blit_screen.fsh
Normal file
17
assets/minecraft/shaders/core/blit_screen.fsh
Normal file
@@ -0,0 +1,17 @@
|
||||
#version 150
|
||||
|
||||
uniform sampler2D DiffuseSampler;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
|
||||
in vec2 texCoord;
|
||||
in vec4 vertexColor;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(DiffuseSampler, texCoord) * vertexColor;
|
||||
|
||||
// blit final output of compositor into displayed back buffer
|
||||
fragColor = color * ColorModulator;
|
||||
}
|
||||
22
assets/minecraft/shaders/core/blit_screen.json
Normal file
22
assets/minecraft/shaders/core/blit_screen.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "blit_screen",
|
||||
"fragment": "blit_screen",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"UV",
|
||||
"Color"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "DiffuseSampler" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] }
|
||||
]
|
||||
}
|
||||
18
assets/minecraft/shaders/core/blit_screen.vsh
Normal file
18
assets/minecraft/shaders/core/blit_screen.vsh
Normal file
@@ -0,0 +1,18 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec2 UV;
|
||||
in vec4 Color;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
out vec2 texCoord;
|
||||
out vec4 vertexColor;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
texCoord = UV;
|
||||
vertexColor = Color;
|
||||
}
|
||||
17
assets/minecraft/shaders/core/block.fsh
Normal file
17
assets/minecraft/shaders/core/block.fsh
Normal file
@@ -0,0 +1,17 @@
|
||||
#version 150
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
|
||||
in vec4 vertexColor;
|
||||
in vec2 texCoord0;
|
||||
in vec2 texCoord2;
|
||||
in vec4 normal;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0) * vertexColor;
|
||||
fragColor = color * ColorModulator;
|
||||
}
|
||||
24
assets/minecraft/shaders/core/block.json
Normal file
24
assets/minecraft/shaders/core/block.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "block",
|
||||
"fragment": "block",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"Color",
|
||||
"UV0",
|
||||
"UV2",
|
||||
"Normal"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] }
|
||||
]
|
||||
}
|
||||
24
assets/minecraft/shaders/core/block.vsh
Normal file
24
assets/minecraft/shaders/core/block.vsh
Normal file
@@ -0,0 +1,24 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV0;
|
||||
in vec2 UV2;
|
||||
in vec3 Normal;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
out vec4 vertexColor;
|
||||
out vec2 texCoord0;
|
||||
out vec2 texCoord2;
|
||||
out vec4 normal;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexColor = Color;
|
||||
texCoord0 = UV0;
|
||||
texCoord2 = UV2;
|
||||
normal = ProjMat * ModelViewMat * vec4(Normal, 0.0);
|
||||
}
|
||||
18
assets/minecraft/shaders/core/new_entity.fsh
Normal file
18
assets/minecraft/shaders/core/new_entity.fsh
Normal file
@@ -0,0 +1,18 @@
|
||||
#version 150
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
|
||||
in vec4 vertexColor;
|
||||
in vec2 texCoord0;
|
||||
in vec2 texCoord1;
|
||||
in vec2 texCoord2;
|
||||
in vec4 normal;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0) * vertexColor;
|
||||
fragColor = color * ColorModulator;
|
||||
}
|
||||
25
assets/minecraft/shaders/core/new_entity.json
Normal file
25
assets/minecraft/shaders/core/new_entity.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "new_entity",
|
||||
"fragment": "new_entity",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"Color",
|
||||
"UV0",
|
||||
"UV1",
|
||||
"UV2",
|
||||
"Normal"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] }
|
||||
]
|
||||
}
|
||||
27
assets/minecraft/shaders/core/new_entity.vsh
Normal file
27
assets/minecraft/shaders/core/new_entity.vsh
Normal file
@@ -0,0 +1,27 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV0;
|
||||
in vec2 UV1;
|
||||
in vec2 UV2;
|
||||
in vec3 Normal;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
out vec4 vertexColor;
|
||||
out vec2 texCoord0;
|
||||
out vec2 texCoord1;
|
||||
out vec2 texCoord2;
|
||||
out vec4 normal;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexColor = Color;
|
||||
texCoord0 = UV0;
|
||||
texCoord1 = UV1;
|
||||
texCoord2 = UV2;
|
||||
normal = ProjMat * ModelViewMat * vec4(Normal, 0.0);
|
||||
}
|
||||
24
assets/minecraft/shaders/core/particle.fsh
Normal file
24
assets/minecraft/shaders/core/particle.fsh
Normal file
@@ -0,0 +1,24 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <fog.glsl>
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
uniform vec4 FogColor;
|
||||
|
||||
in float vertexDistance;
|
||||
in vec2 texCoord0;
|
||||
in vec4 vertexColor;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0) * vertexColor * ColorModulator;
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
27
assets/minecraft/shaders/core/particle.json
Normal file
27
assets/minecraft/shaders/core/particle.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "particle",
|
||||
"fragment": "particle",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"UV0",
|
||||
"Color",
|
||||
"UV2"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" },
|
||||
{ "name": "Sampler2" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
|
||||
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
|
||||
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
|
||||
{ "name": "FogColor", "type": "float", "count": 4, "values": [ 0.0, 0.0, 0.0, 0.0 ] }
|
||||
]
|
||||
}
|
||||
23
assets/minecraft/shaders/core/particle.vsh
Normal file
23
assets/minecraft/shaders/core/particle.vsh
Normal file
@@ -0,0 +1,23 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec2 UV0;
|
||||
in vec4 Color;
|
||||
in ivec2 UV2;
|
||||
|
||||
uniform sampler2D Sampler2;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec2 texCoord0;
|
||||
out vec4 vertexColor;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = length((ModelViewMat * vec4(Position, 1.0)).xyz);
|
||||
texCoord0 = UV0;
|
||||
vertexColor = Color * texelFetch(Sampler2, UV2 / 16, 0);
|
||||
}
|
||||
16
assets/minecraft/shaders/core/position.fsh
Normal file
16
assets/minecraft/shaders/core/position.fsh
Normal file
@@ -0,0 +1,16 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <fog.glsl>
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
uniform vec4 FogColor;
|
||||
|
||||
in float vertexDistance;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
fragColor = linear_fog(ColorModulator, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
21
assets/minecraft/shaders/core/position.json
Normal file
21
assets/minecraft/shaders/core/position.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "position",
|
||||
"fragment": "position",
|
||||
"attributes": [
|
||||
],
|
||||
"samplers": [
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
|
||||
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
|
||||
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
|
||||
{ "name": "FogColor", "type": "float", "count": 4, "values": [ 0.0, 0.0, 0.0, 0.0 ] }
|
||||
]
|
||||
}
|
||||
14
assets/minecraft/shaders/core/position.vsh
Normal file
14
assets/minecraft/shaders/core/position.vsh
Normal file
@@ -0,0 +1,14 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
out float vertexDistance;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = length((ModelViewMat * vec4(Position, 1.0)).xyz);
|
||||
}
|
||||
15
assets/minecraft/shaders/core/position_color.fsh
Normal file
15
assets/minecraft/shaders/core/position_color.fsh
Normal file
@@ -0,0 +1,15 @@
|
||||
#version 150
|
||||
|
||||
in vec4 vertexColor;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = vertexColor;
|
||||
if (color.a == 0.0) {
|
||||
discard;
|
||||
}
|
||||
fragColor = color * ColorModulator;
|
||||
}
|
||||
19
assets/minecraft/shaders/core/position_color.json
Normal file
19
assets/minecraft/shaders/core/position_color.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "position_color",
|
||||
"fragment": "position_color",
|
||||
"attributes": [
|
||||
"Color"
|
||||
],
|
||||
"samplers": [
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] }
|
||||
]
|
||||
}
|
||||
15
assets/minecraft/shaders/core/position_color.vsh
Normal file
15
assets/minecraft/shaders/core/position_color.vsh
Normal file
@@ -0,0 +1,15 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
out vec4 vertexColor;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexColor = Color;
|
||||
}
|
||||
15
assets/minecraft/shaders/core/position_color_lightmap.fsh
Normal file
15
assets/minecraft/shaders/core/position_color_lightmap.fsh
Normal file
@@ -0,0 +1,15 @@
|
||||
#version 150
|
||||
|
||||
uniform sampler2D Sampler2;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
|
||||
in vec4 vertexColor;
|
||||
in vec2 texCoord2;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler2, texCoord2) * vertexColor;
|
||||
fragColor = color * ColorModulator;
|
||||
}
|
||||
22
assets/minecraft/shaders/core/position_color_lightmap.json
Normal file
22
assets/minecraft/shaders/core/position_color_lightmap.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "position_color_lightmap",
|
||||
"fragment": "position_color_lightmap",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"Color",
|
||||
"UV2"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler2" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] }
|
||||
]
|
||||
}
|
||||
18
assets/minecraft/shaders/core/position_color_lightmap.vsh
Normal file
18
assets/minecraft/shaders/core/position_color_lightmap.vsh
Normal file
@@ -0,0 +1,18 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV2;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
out vec4 vertexColor;
|
||||
out vec2 texCoord2;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexColor = Color;
|
||||
texCoord2 = UV2;
|
||||
}
|
||||
22
assets/minecraft/shaders/core/position_color_normal.fsh
Normal file
22
assets/minecraft/shaders/core/position_color_normal.fsh
Normal file
@@ -0,0 +1,22 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <fog.glsl>
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
uniform vec4 FogColor;
|
||||
|
||||
in float vertexDistance;
|
||||
in vec4 vertexColor;
|
||||
in vec4 normal;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = vertexColor * ColorModulator;
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
24
assets/minecraft/shaders/core/position_color_normal.json
Normal file
24
assets/minecraft/shaders/core/position_color_normal.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "position_color_normal",
|
||||
"fragment": "position_color_normal",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"Color",
|
||||
"Normal"
|
||||
],
|
||||
"samplers": [
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "ModelViewProjMat", "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
|
||||
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
|
||||
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
|
||||
{ "name": "FogColor", "type": "float", "count": 4, "values": [ 0.0, 0.0, 0.0, 0.0 ] }
|
||||
]
|
||||
}
|
||||
20
assets/minecraft/shaders/core/position_color_normal.vsh
Normal file
20
assets/minecraft/shaders/core/position_color_normal.vsh
Normal file
@@ -0,0 +1,20 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec3 Normal;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ModelViewProjMat;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
out vec4 normal;
|
||||
|
||||
void main() {
|
||||
gl_Position = ModelViewProjMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = length((ModelViewMat * vec4(Position, 1.0)).xyz);
|
||||
vertexColor = Color;
|
||||
normal = ModelViewProjMat * vec4(Normal, 0.0);
|
||||
}
|
||||
18
assets/minecraft/shaders/core/position_color_tex.fsh
Normal file
18
assets/minecraft/shaders/core/position_color_tex.fsh
Normal file
@@ -0,0 +1,18 @@
|
||||
#version 150
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
|
||||
in vec4 vertexColor;
|
||||
in vec2 texCoord0;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0) * vertexColor;
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
fragColor = color * ColorModulator;
|
||||
}
|
||||
22
assets/minecraft/shaders/core/position_color_tex.json
Normal file
22
assets/minecraft/shaders/core/position_color_tex.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "position_color_tex",
|
||||
"fragment": "position_color_tex",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"Color",
|
||||
"UV0"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] }
|
||||
]
|
||||
}
|
||||
18
assets/minecraft/shaders/core/position_color_tex.vsh
Normal file
18
assets/minecraft/shaders/core/position_color_tex.vsh
Normal file
@@ -0,0 +1,18 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV0;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
out vec4 vertexColor;
|
||||
out vec2 texCoord0;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexColor = Color;
|
||||
texCoord0 = UV0;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#version 150
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
|
||||
in vec4 vertexColor;
|
||||
in vec2 texCoord0;
|
||||
in vec2 texCoord2;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0) * vertexColor;
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
fragColor = color * ColorModulator;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "position_color_tex_lightmap",
|
||||
"fragment": "position_color_tex_lightmap",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"Color",
|
||||
"UV0",
|
||||
"UV2"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] }
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV0;
|
||||
in vec2 UV2;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
out vec4 vertexColor;
|
||||
out vec2 texCoord0;
|
||||
out vec2 texCoord2;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexColor = Color;
|
||||
texCoord0 = UV0;
|
||||
texCoord2 = UV2;
|
||||
}
|
||||
17
assets/minecraft/shaders/core/position_tex.fsh
Normal file
17
assets/minecraft/shaders/core/position_tex.fsh
Normal file
@@ -0,0 +1,17 @@
|
||||
#version 150
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
|
||||
in vec2 texCoord0;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0);
|
||||
if (color.a == 0.0) {
|
||||
discard;
|
||||
}
|
||||
fragColor = color * ColorModulator;
|
||||
}
|
||||
21
assets/minecraft/shaders/core/position_tex.json
Normal file
21
assets/minecraft/shaders/core/position_tex.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "position_tex",
|
||||
"fragment": "position_tex",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"UV0"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] }
|
||||
]
|
||||
}
|
||||
15
assets/minecraft/shaders/core/position_tex.vsh
Normal file
15
assets/minecraft/shaders/core/position_tex.vsh
Normal file
@@ -0,0 +1,15 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec2 UV0;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
out vec2 texCoord0;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
texCoord0 = UV0;
|
||||
}
|
||||
18
assets/minecraft/shaders/core/position_tex_color.fsh
Normal file
18
assets/minecraft/shaders/core/position_tex_color.fsh
Normal file
@@ -0,0 +1,18 @@
|
||||
#version 150
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
|
||||
in vec2 texCoord0;
|
||||
in vec4 vertexColor;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0) * vertexColor;
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
fragColor = color * ColorModulator;
|
||||
}
|
||||
22
assets/minecraft/shaders/core/position_tex_color.json
Normal file
22
assets/minecraft/shaders/core/position_tex_color.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "position_tex_color",
|
||||
"fragment": "position_tex_color",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"UV0",
|
||||
"Color"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] }
|
||||
]
|
||||
}
|
||||
18
assets/minecraft/shaders/core/position_tex_color.vsh
Normal file
18
assets/minecraft/shaders/core/position_tex_color.vsh
Normal file
@@ -0,0 +1,18 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec2 UV0;
|
||||
in vec4 Color;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
out vec2 texCoord0;
|
||||
out vec4 vertexColor;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
texCoord0 = UV0;
|
||||
vertexColor = Color;
|
||||
}
|
||||
25
assets/minecraft/shaders/core/position_tex_color_normal.fsh
Normal file
25
assets/minecraft/shaders/core/position_tex_color_normal.fsh
Normal file
@@ -0,0 +1,25 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <fog.glsl>
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
uniform vec4 FogColor;
|
||||
|
||||
in vec2 texCoord0;
|
||||
in float vertexDistance;
|
||||
in vec4 vertexColor;
|
||||
in vec4 normal;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0) * vertexColor * ColorModulator;
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
26
assets/minecraft/shaders/core/position_tex_color_normal.json
Normal file
26
assets/minecraft/shaders/core/position_tex_color_normal.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "position_tex_color_normal",
|
||||
"fragment": "position_tex_color_normal",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"UV0",
|
||||
"Color",
|
||||
"Normal"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
|
||||
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
|
||||
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
|
||||
{ "name": "FogColor", "type": "float", "count": 4, "values": [ 0.0, 0.0, 0.0, 0.0 ] }
|
||||
]
|
||||
}
|
||||
23
assets/minecraft/shaders/core/position_tex_color_normal.vsh
Normal file
23
assets/minecraft/shaders/core/position_tex_color_normal.vsh
Normal file
@@ -0,0 +1,23 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec2 UV0;
|
||||
in vec4 Color;
|
||||
in vec3 Normal;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
out vec2 texCoord0;
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
out vec4 normal;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
texCoord0 = UV0;
|
||||
vertexDistance = length((ModelViewMat * vec4(Position, 1.0)).xyz);
|
||||
vertexColor = Color;
|
||||
normal = ProjMat * ModelViewMat * vec4(Normal, 0.0);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#version 150
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
|
||||
in vec2 texCoord0;
|
||||
in vec2 texCoord2;
|
||||
in vec4 vertexColor;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0) * vertexColor;
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
fragColor = color * ColorModulator;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "position_tex_lightmap_color",
|
||||
"fragment": "position_tex_lightmap_color",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"UV0",
|
||||
"UV2",
|
||||
"Color"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] }
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec2 UV0;
|
||||
in vec2 UV2;
|
||||
in vec4 Color;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
out vec2 texCoord0;
|
||||
out vec2 texCoord2;
|
||||
out vec4 vertexColor;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
texCoord0 = UV0;
|
||||
texCoord2 = UV2;
|
||||
vertexColor = Color;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <fog.glsl>
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
uniform vec4 FogColor;
|
||||
|
||||
in float vertexDistance;
|
||||
in vec4 vertexColor;
|
||||
in vec2 texCoord0;
|
||||
in vec2 texCoord1;
|
||||
in vec4 normal;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0) * vertexColor * ColorModulator;
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "rendertype_armor_cutout_no_cull",
|
||||
"fragment": "rendertype_armor_cutout_no_cull",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"Color",
|
||||
"UV0",
|
||||
"UV1",
|
||||
"UV2",
|
||||
"Normal"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" },
|
||||
{ "name": "Sampler2" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
|
||||
{ "name": "Light0_Direction", "type": "float", "count": 3, "values": [0.0, 0.0, 0.0] },
|
||||
{ "name": "Light1_Direction", "type": "float", "count": 3, "values": [0.0, 0.0, 0.0] },
|
||||
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
|
||||
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
|
||||
{ "name": "FogColor", "type": "float", "count": 4, "values": [ 0.0, 0.0, 0.0, 0.0 ] }
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <light.glsl>
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV0;
|
||||
in vec2 UV1;
|
||||
in ivec2 UV2;
|
||||
in vec3 Normal;
|
||||
|
||||
uniform sampler2D Sampler2;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
uniform vec3 Light0_Direction;
|
||||
uniform vec3 Light1_Direction;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
out vec2 texCoord0;
|
||||
out vec2 texCoord1;
|
||||
out vec4 normal;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = length((ModelViewMat * vec4(Position, 1.0)).xyz);
|
||||
vertexColor = minecraft_mix_light(Light0_Direction, Light1_Direction, Normal, Color) * texelFetch(Sampler2, UV2 / 16, 0);
|
||||
texCoord0 = UV0;
|
||||
texCoord1 = UV1;
|
||||
normal = ProjMat * ModelViewMat * vec4(Normal, 0.0);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <fog.glsl>
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
|
||||
in float vertexDistance;
|
||||
in vec2 texCoord0;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0) * ColorModulator;
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
float fade = linear_fog_fade(vertexDistance, FogStart, FogEnd);
|
||||
fragColor = vec4(color.rgb * fade, color.a);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "rendertype_armor_entity_glint",
|
||||
"fragment": "rendertype_armor_entity_glint",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"UV0"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
|
||||
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
|
||||
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
|
||||
{ "name": "TextureMat", "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 ] }
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec2 UV0;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
uniform mat4 TextureMat;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec2 texCoord0;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = length((ModelViewMat * vec4(Position, 1.0)).xyz);
|
||||
texCoord0 = (TextureMat * vec4(UV0, 0.0, 1.0)).xy;
|
||||
}
|
||||
23
assets/minecraft/shaders/core/rendertype_armor_glint.fsh
Normal file
23
assets/minecraft/shaders/core/rendertype_armor_glint.fsh
Normal file
@@ -0,0 +1,23 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <fog.glsl>
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
|
||||
in float vertexDistance;
|
||||
in vec2 texCoord0;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0) * ColorModulator;
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
float fade = linear_fog_fade(vertexDistance, FogStart, FogEnd);
|
||||
fragColor = vec4(color.rgb * fade, color.a);
|
||||
}
|
||||
24
assets/minecraft/shaders/core/rendertype_armor_glint.json
Normal file
24
assets/minecraft/shaders/core/rendertype_armor_glint.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "rendertype_armor_glint",
|
||||
"fragment": "rendertype_armor_glint",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"UV0"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
|
||||
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
|
||||
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
|
||||
{ "name": "TextureMat", "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 ] }
|
||||
]
|
||||
}
|
||||
18
assets/minecraft/shaders/core/rendertype_armor_glint.vsh
Normal file
18
assets/minecraft/shaders/core/rendertype_armor_glint.vsh
Normal file
@@ -0,0 +1,18 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec2 UV0;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
uniform mat4 TextureMat;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec2 texCoord0;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = length((ModelViewMat * vec4(Position, 1.0)).xyz);
|
||||
texCoord0 = (TextureMat * vec4(UV0, 0.0, 1.0)).xy;
|
||||
}
|
||||
23
assets/minecraft/shaders/core/rendertype_beacon_beam.fsh
Normal file
23
assets/minecraft/shaders/core/rendertype_beacon_beam.fsh
Normal file
@@ -0,0 +1,23 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <fog.glsl>
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform mat4 ProjMat;
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
uniform vec4 FogColor;
|
||||
|
||||
in vec4 vertexColor;
|
||||
in vec2 texCoord0;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0);
|
||||
color *= vertexColor * ColorModulator;
|
||||
float fragmentDistance = -ProjMat[3].z / ((gl_FragCoord.z) * -2.0 + 1.0 - ProjMat[2].z);
|
||||
fragColor = linear_fog(color, fragmentDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
25
assets/minecraft/shaders/core/rendertype_beacon_beam.json
Normal file
25
assets/minecraft/shaders/core/rendertype_beacon_beam.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "rendertype_beacon_beam",
|
||||
"fragment": "rendertype_beacon_beam",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"Color",
|
||||
"UV0"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
|
||||
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
|
||||
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
|
||||
{ "name": "FogColor", "type": "float", "count": 4, "values": [ 0.0, 0.0, 0.0, 0.0 ] }
|
||||
]
|
||||
}
|
||||
18
assets/minecraft/shaders/core/rendertype_beacon_beam.vsh
Normal file
18
assets/minecraft/shaders/core/rendertype_beacon_beam.vsh
Normal file
@@ -0,0 +1,18 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV0;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
out vec4 vertexColor;
|
||||
out vec2 texCoord0;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexColor = Color;
|
||||
texCoord0 = UV0;
|
||||
}
|
||||
20
assets/minecraft/shaders/core/rendertype_crumbling.fsh
Normal file
20
assets/minecraft/shaders/core/rendertype_crumbling.fsh
Normal file
@@ -0,0 +1,20 @@
|
||||
#version 150
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
|
||||
in vec4 vertexColor;
|
||||
in vec2 texCoord0;
|
||||
in vec2 texCoord2;
|
||||
in vec4 normal;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0) * vertexColor;
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
fragColor = color * ColorModulator;
|
||||
}
|
||||
24
assets/minecraft/shaders/core/rendertype_crumbling.json
Normal file
24
assets/minecraft/shaders/core/rendertype_crumbling.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "rendertype_crumbling",
|
||||
"fragment": "rendertype_crumbling",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"Color",
|
||||
"UV0",
|
||||
"UV2",
|
||||
"Normal"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] }
|
||||
]
|
||||
}
|
||||
24
assets/minecraft/shaders/core/rendertype_crumbling.vsh
Normal file
24
assets/minecraft/shaders/core/rendertype_crumbling.vsh
Normal file
@@ -0,0 +1,24 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV0;
|
||||
in vec2 UV2;
|
||||
in vec3 Normal;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
out vec4 vertexColor;
|
||||
out vec2 texCoord0;
|
||||
out vec2 texCoord2;
|
||||
out vec4 normal;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexColor = Color;
|
||||
texCoord0 = UV0;
|
||||
texCoord2 = UV2;
|
||||
normal = ProjMat * ModelViewMat * vec4(Normal, 0.0);
|
||||
}
|
||||
25
assets/minecraft/shaders/core/rendertype_cutout.fsh
Normal file
25
assets/minecraft/shaders/core/rendertype_cutout.fsh
Normal file
@@ -0,0 +1,25 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <fog.glsl>
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
uniform vec4 FogColor;
|
||||
|
||||
in float vertexDistance;
|
||||
in vec4 vertexColor;
|
||||
in vec2 texCoord0;
|
||||
in vec4 normal;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0) * vertexColor * ColorModulator;
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
29
assets/minecraft/shaders/core/rendertype_cutout.json
Normal file
29
assets/minecraft/shaders/core/rendertype_cutout.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "rendertype_cutout",
|
||||
"fragment": "rendertype_cutout",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"Color",
|
||||
"UV0",
|
||||
"UV2",
|
||||
"Normal"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" },
|
||||
{ "name": "Sampler2" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ChunkOffset", "type": "float", "count": 3, "values": [ 0.0, 0.0, 0.0 ] },
|
||||
{ "name": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
|
||||
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
|
||||
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
|
||||
{ "name": "FogColor", "type": "float", "count": 4, "values": [ 0.0, 0.0, 0.0, 0.0 ] }
|
||||
]
|
||||
}
|
||||
29
assets/minecraft/shaders/core/rendertype_cutout.vsh
Normal file
29
assets/minecraft/shaders/core/rendertype_cutout.vsh
Normal file
@@ -0,0 +1,29 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <light.glsl>
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV0;
|
||||
in ivec2 UV2;
|
||||
in vec3 Normal;
|
||||
|
||||
uniform sampler2D Sampler2;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
uniform vec3 ChunkOffset;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
out vec2 texCoord0;
|
||||
out vec4 normal;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position + ChunkOffset, 1.0);
|
||||
|
||||
vertexDistance = length((ModelViewMat * vec4(Position + ChunkOffset, 1.0)).xyz);
|
||||
vertexColor = Color * minecraft_sample_lightmap(Sampler2, UV2);
|
||||
texCoord0 = UV0;
|
||||
normal = ProjMat * ModelViewMat * vec4(Normal, 0.0);
|
||||
}
|
||||
25
assets/minecraft/shaders/core/rendertype_cutout_mipped.fsh
Normal file
25
assets/minecraft/shaders/core/rendertype_cutout_mipped.fsh
Normal file
@@ -0,0 +1,25 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <fog.glsl>
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
uniform vec4 FogColor;
|
||||
|
||||
in float vertexDistance;
|
||||
in vec4 vertexColor;
|
||||
in vec2 texCoord0;
|
||||
in vec4 normal;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0) * vertexColor * ColorModulator;
|
||||
if (color.a < 0.5) {
|
||||
discard;
|
||||
}
|
||||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
29
assets/minecraft/shaders/core/rendertype_cutout_mipped.json
Normal file
29
assets/minecraft/shaders/core/rendertype_cutout_mipped.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "rendertype_cutout_mipped",
|
||||
"fragment": "rendertype_cutout_mipped",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"Color",
|
||||
"UV0",
|
||||
"UV2",
|
||||
"Normal"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" },
|
||||
{ "name": "Sampler2" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ChunkOffset", "type": "float", "count": 3, "values": [ 0.0, 0.0, 0.0 ] },
|
||||
{ "name": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
|
||||
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
|
||||
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
|
||||
{ "name": "FogColor", "type": "float", "count": 4, "values": [ 0.0, 0.0, 0.0, 0.0 ] }
|
||||
]
|
||||
}
|
||||
29
assets/minecraft/shaders/core/rendertype_cutout_mipped.vsh
Normal file
29
assets/minecraft/shaders/core/rendertype_cutout_mipped.vsh
Normal file
@@ -0,0 +1,29 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <light.glsl>
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV0;
|
||||
in ivec2 UV2;
|
||||
in vec3 Normal;
|
||||
|
||||
uniform sampler2D Sampler2;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
uniform vec3 ChunkOffset;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
out vec2 texCoord0;
|
||||
out vec4 normal;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position + ChunkOffset, 1.0);
|
||||
|
||||
vertexDistance = length((ModelViewMat * vec4(Position + ChunkOffset, 1.0)).xyz);
|
||||
vertexColor = Color * minecraft_sample_lightmap(Sampler2, UV2);
|
||||
texCoord0 = UV0;
|
||||
normal = ProjMat * ModelViewMat * vec4(Normal, 0.0);
|
||||
}
|
||||
20
assets/minecraft/shaders/core/rendertype_end_gateway.json
Normal file
20
assets/minecraft/shaders/core/rendertype_end_gateway.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "rendertype_end_portal",
|
||||
"fragment": "rendertype_end_portal",
|
||||
"attributes": [],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" },
|
||||
{ "name": "Sampler1" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "GameTime", "type": "float", "count": 1, "values": [ 0.0 ] },
|
||||
{ "name": "EndPortalLayers", "type": "int", "count": 1, "values": [ 16 ] }
|
||||
]
|
||||
}
|
||||
62
assets/minecraft/shaders/core/rendertype_end_portal.fsh
Normal file
62
assets/minecraft/shaders/core/rendertype_end_portal.fsh
Normal file
@@ -0,0 +1,62 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <matrix.glsl>
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
uniform sampler2D Sampler1;
|
||||
|
||||
uniform float GameTime;
|
||||
uniform int EndPortalLayers;
|
||||
|
||||
in vec4 texProj0;
|
||||
|
||||
const vec3[] COLORS = vec3[](
|
||||
vec3(0.022087, 0.098399, 0.110818),
|
||||
vec3(0.011892, 0.095924, 0.089485),
|
||||
vec3(0.027636, 0.101689, 0.100326),
|
||||
vec3(0.046564, 0.109883, 0.114838),
|
||||
vec3(0.064901, 0.117696, 0.097189),
|
||||
vec3(0.063761, 0.086895, 0.123646),
|
||||
vec3(0.084817, 0.111994, 0.166380),
|
||||
vec3(0.097489, 0.154120, 0.091064),
|
||||
vec3(0.106152, 0.131144, 0.195191),
|
||||
vec3(0.097721, 0.110188, 0.187229),
|
||||
vec3(0.133516, 0.138278, 0.148582),
|
||||
vec3(0.070006, 0.243332, 0.235792),
|
||||
vec3(0.196766, 0.142899, 0.214696),
|
||||
vec3(0.047281, 0.315338, 0.321970),
|
||||
vec3(0.204675, 0.390010, 0.302066),
|
||||
vec3(0.080955, 0.314821, 0.661491)
|
||||
);
|
||||
|
||||
const mat4 SCALE_TRANSLATE = mat4(
|
||||
0.5, 0.0, 0.0, 0.25,
|
||||
0.0, 0.5, 0.0, 0.25,
|
||||
0.0, 0.0, 1.0, 0.0,
|
||||
0.0, 0.0, 0.0, 1.0
|
||||
);
|
||||
|
||||
mat4 end_portal_layer(float layer) {
|
||||
mat4 translate = mat4(
|
||||
1.0, 0.0, 0.0, 17.0 / layer,
|
||||
0.0, 1.0, 0.0, (2.0 + layer / 1.5) * (GameTime * 1.5),
|
||||
0.0, 0.0, 1.0, 0.0,
|
||||
0.0, 0.0, 0.0, 1.0
|
||||
);
|
||||
|
||||
mat2 rotate = mat2_rotate_z(radians((layer * layer * 4321.0 + layer * 9.0) * 2.0));
|
||||
|
||||
mat2 scale = mat2((4.5 - layer / 4.0) * 2.0);
|
||||
|
||||
return mat4(scale * rotate) * translate * SCALE_TRANSLATE;
|
||||
}
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec3 color = textureProj(Sampler0, texProj0).rgb * COLORS[0];
|
||||
for (int i = 0; i < EndPortalLayers; i++) {
|
||||
color += textureProj(Sampler1, texProj0 * end_portal_layer(float(i + 1))).rgb * COLORS[i];
|
||||
}
|
||||
fragColor = vec4(color, 1.0);
|
||||
}
|
||||
20
assets/minecraft/shaders/core/rendertype_end_portal.json
Normal file
20
assets/minecraft/shaders/core/rendertype_end_portal.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "rendertype_end_portal",
|
||||
"fragment": "rendertype_end_portal",
|
||||
"attributes": [],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" },
|
||||
{ "name": "Sampler1" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "GameTime", "type": "float", "count": 1, "values": [ 0.0 ] },
|
||||
{ "name": "EndPortalLayers", "type": "int", "count": 1, "values": [ 15 ] }
|
||||
]
|
||||
}
|
||||
16
assets/minecraft/shaders/core/rendertype_end_portal.vsh
Normal file
16
assets/minecraft/shaders/core/rendertype_end_portal.vsh
Normal file
@@ -0,0 +1,16 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <projection.glsl>
|
||||
|
||||
in vec3 Position;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
out vec4 texProj0;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
texProj0 = projection_from_position(gl_Position);
|
||||
}
|
||||
23
assets/minecraft/shaders/core/rendertype_energy_swirl.fsh
Normal file
23
assets/minecraft/shaders/core/rendertype_energy_swirl.fsh
Normal file
@@ -0,0 +1,23 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <fog.glsl>
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
|
||||
in float vertexDistance;
|
||||
in vec4 vertexColor;
|
||||
in vec2 texCoord0;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0) * vertexColor * ColorModulator;
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
fragColor = color * linear_fog_fade(vertexDistance, FogStart, FogEnd);
|
||||
}
|
||||
25
assets/minecraft/shaders/core/rendertype_energy_swirl.json
Normal file
25
assets/minecraft/shaders/core/rendertype_energy_swirl.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "rendertype_energy_swirl",
|
||||
"fragment": "rendertype_energy_swirl",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"Color",
|
||||
"UV0"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "TextureMat", "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
|
||||
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
|
||||
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] }
|
||||
]
|
||||
}
|
||||
21
assets/minecraft/shaders/core/rendertype_energy_swirl.vsh
Normal file
21
assets/minecraft/shaders/core/rendertype_energy_swirl.vsh
Normal file
@@ -0,0 +1,21 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV0;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
uniform mat4 TextureMat;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
out vec2 texCoord0;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = length((ModelViewMat * vec4(Position, 1.0)).xyz);
|
||||
vertexColor = Color;
|
||||
texCoord0 = (TextureMat * vec4(UV0, 0.0, 1.0)).xy;
|
||||
}
|
||||
19
assets/minecraft/shaders/core/rendertype_entity_alpha.fsh
Normal file
19
assets/minecraft/shaders/core/rendertype_entity_alpha.fsh
Normal file
@@ -0,0 +1,19 @@
|
||||
#version 150
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
in vec4 vertexColor;
|
||||
in vec2 texCoord0;
|
||||
in vec2 texCoord1;
|
||||
in vec2 texCoord2;
|
||||
in vec4 normal;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0);
|
||||
if (color.a < vertexColor.a) {
|
||||
discard;
|
||||
}
|
||||
fragColor = color;
|
||||
}
|
||||
24
assets/minecraft/shaders/core/rendertype_entity_alpha.json
Normal file
24
assets/minecraft/shaders/core/rendertype_entity_alpha.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "rendertype_entity_alpha",
|
||||
"fragment": "rendertype_entity_alpha",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"Color",
|
||||
"UV0",
|
||||
"UV1",
|
||||
"UV2",
|
||||
"Normal"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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 ] }
|
||||
]
|
||||
}
|
||||
27
assets/minecraft/shaders/core/rendertype_entity_alpha.vsh
Normal file
27
assets/minecraft/shaders/core/rendertype_entity_alpha.vsh
Normal file
@@ -0,0 +1,27 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV0;
|
||||
in vec2 UV1;
|
||||
in vec2 UV2;
|
||||
in vec3 Normal;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
out vec4 vertexColor;
|
||||
out vec2 texCoord0;
|
||||
out vec2 texCoord1;
|
||||
out vec2 texCoord2;
|
||||
out vec4 normal;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexColor = Color;
|
||||
texCoord0 = UV0;
|
||||
texCoord1 = UV1;
|
||||
texCoord2 = UV2;
|
||||
normal = ProjMat * ModelViewMat * vec4(Normal, 0.0);
|
||||
}
|
||||
30
assets/minecraft/shaders/core/rendertype_entity_cutout.fsh
Normal file
30
assets/minecraft/shaders/core/rendertype_entity_cutout.fsh
Normal file
@@ -0,0 +1,30 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <fog.glsl>
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
uniform vec4 FogColor;
|
||||
|
||||
in float vertexDistance;
|
||||
in vec4 vertexColor;
|
||||
in vec4 lightMapColor;
|
||||
in vec4 overlayColor;
|
||||
in vec2 texCoord0;
|
||||
in vec4 normal;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0);
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
color *= vertexColor * ColorModulator;
|
||||
color.rgb = mix(overlayColor.rgb, color.rgb, overlayColor.a);
|
||||
color *= lightMapColor;
|
||||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
32
assets/minecraft/shaders/core/rendertype_entity_cutout.json
Normal file
32
assets/minecraft/shaders/core/rendertype_entity_cutout.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "rendertype_entity_cutout",
|
||||
"fragment": "rendertype_entity_cutout",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"Color",
|
||||
"UV0",
|
||||
"UV1",
|
||||
"UV2",
|
||||
"Normal"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" },
|
||||
{ "name": "Sampler1" },
|
||||
{ "name": "Sampler2" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
|
||||
{ "name": "Light0_Direction", "type": "float", "count": 3, "values": [0.0, 0.0, 0.0] },
|
||||
{ "name": "Light1_Direction", "type": "float", "count": 3, "values": [0.0, 0.0, 0.0] },
|
||||
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
|
||||
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
|
||||
{ "name": "FogColor", "type": "float", "count": 4, "values": [ 0.0, 0.0, 0.0, 0.0 ] }
|
||||
]
|
||||
}
|
||||
37
assets/minecraft/shaders/core/rendertype_entity_cutout.vsh
Normal file
37
assets/minecraft/shaders/core/rendertype_entity_cutout.vsh
Normal file
@@ -0,0 +1,37 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <light.glsl>
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV0;
|
||||
in ivec2 UV1;
|
||||
in ivec2 UV2;
|
||||
in vec3 Normal;
|
||||
|
||||
uniform sampler2D Sampler1;
|
||||
uniform sampler2D Sampler2;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
uniform vec3 Light0_Direction;
|
||||
uniform vec3 Light1_Direction;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
out vec4 lightMapColor;
|
||||
out vec4 overlayColor;
|
||||
out vec2 texCoord0;
|
||||
out vec4 normal;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = length((ModelViewMat * vec4(Position, 1.0)).xyz);
|
||||
vertexColor = minecraft_mix_light(Light0_Direction, Light1_Direction, Normal, Color);
|
||||
lightMapColor = texelFetch(Sampler2, UV2 / 16, 0);
|
||||
overlayColor = texelFetch(Sampler1, UV1, 0);
|
||||
texCoord0 = UV0;
|
||||
normal = ProjMat * ModelViewMat * vec4(Normal, 0.0);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <fog.glsl>
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
uniform vec4 FogColor;
|
||||
|
||||
in float vertexDistance;
|
||||
in vec4 vertexColor;
|
||||
in vec4 lightMapColor;
|
||||
in vec4 overlayColor;
|
||||
in vec2 texCoord0;
|
||||
in vec4 normal;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0);
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
color *= vertexColor * ColorModulator;
|
||||
color.rgb = mix(overlayColor.rgb, color.rgb, overlayColor.a);
|
||||
color *= lightMapColor;
|
||||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "rendertype_entity_cutout_no_cull",
|
||||
"fragment": "rendertype_entity_cutout_no_cull",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"Color",
|
||||
"UV0",
|
||||
"UV1",
|
||||
"UV2",
|
||||
"Normal"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" },
|
||||
{ "name": "Sampler1" },
|
||||
{ "name": "Sampler2" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
|
||||
{ "name": "Light0_Direction", "type": "float", "count": 3, "values": [0.0, 0.0, 0.0] },
|
||||
{ "name": "Light1_Direction", "type": "float", "count": 3, "values": [0.0, 0.0, 0.0] },
|
||||
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
|
||||
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
|
||||
{ "name": "FogColor", "type": "float", "count": 4, "values": [ 0.0, 0.0, 0.0, 0.0 ] }
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <light.glsl>
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV0;
|
||||
in ivec2 UV1;
|
||||
in ivec2 UV2;
|
||||
in vec3 Normal;
|
||||
|
||||
uniform sampler2D Sampler1;
|
||||
uniform sampler2D Sampler2;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
uniform vec3 Light0_Direction;
|
||||
uniform vec3 Light1_Direction;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
out vec4 lightMapColor;
|
||||
out vec4 overlayColor;
|
||||
out vec2 texCoord0;
|
||||
out vec4 normal;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = length((ModelViewMat * vec4(Position, 1.0)).xyz);
|
||||
vertexColor = minecraft_mix_light(Light0_Direction, Light1_Direction, Normal, Color);
|
||||
lightMapColor = texelFetch(Sampler2, UV2 / 16, 0);
|
||||
overlayColor = texelFetch(Sampler1, UV1, 0);
|
||||
texCoord0 = UV0;
|
||||
normal = ProjMat * ModelViewMat * vec4(Normal, 0.0);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <fog.glsl>
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
uniform vec4 FogColor;
|
||||
|
||||
in float vertexDistance;
|
||||
in vec4 vertexColor;
|
||||
in vec4 lightMapColor;
|
||||
in vec4 overlayColor;
|
||||
in vec2 texCoord0;
|
||||
in vec4 normal;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0);
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
color *= vertexColor * ColorModulator;
|
||||
color.rgb = mix(overlayColor.rgb, color.rgb, overlayColor.a);
|
||||
color *= lightMapColor;
|
||||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "rendertype_entity_cutout_no_cull_z_offset",
|
||||
"fragment": "rendertype_entity_cutout_no_cull_z_offset",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"Color",
|
||||
"UV0",
|
||||
"UV1",
|
||||
"UV2",
|
||||
"Normal"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" },
|
||||
{ "name": "Sampler1" },
|
||||
{ "name": "Sampler2" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
|
||||
{ "name": "Light0_Direction", "type": "float", "count": 3, "values": [0.0, 0.0, 0.0] },
|
||||
{ "name": "Light1_Direction", "type": "float", "count": 3, "values": [0.0, 0.0, 0.0] },
|
||||
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
|
||||
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
|
||||
{ "name": "FogColor", "type": "float", "count": 4, "values": [ 0.0, 0.0, 0.0, 0.0 ] }
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <light.glsl>
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV0;
|
||||
in ivec2 UV1;
|
||||
in ivec2 UV2;
|
||||
in vec3 Normal;
|
||||
|
||||
uniform sampler2D Sampler1;
|
||||
uniform sampler2D Sampler2;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
uniform vec3 Light0_Direction;
|
||||
uniform vec3 Light1_Direction;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
out vec4 lightMapColor;
|
||||
out vec4 overlayColor;
|
||||
out vec2 texCoord0;
|
||||
out vec4 normal;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = length((ModelViewMat * vec4(Position, 1.0)).xyz);
|
||||
vertexColor = minecraft_mix_light(Light0_Direction, Light1_Direction, Normal, Color);
|
||||
lightMapColor = texelFetch(Sampler2, UV2 / 16, 0);
|
||||
overlayColor = texelFetch(Sampler1, UV1, 0);
|
||||
texCoord0 = UV0;
|
||||
normal = ProjMat * ModelViewMat * vec4(Normal, 0.0);
|
||||
}
|
||||
28
assets/minecraft/shaders/core/rendertype_entity_decal.fsh
Normal file
28
assets/minecraft/shaders/core/rendertype_entity_decal.fsh
Normal file
@@ -0,0 +1,28 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <fog.glsl>
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
uniform vec4 FogColor;
|
||||
|
||||
in float vertexDistance;
|
||||
in vec4 vertexColor;
|
||||
in vec4 overlayColor;
|
||||
in vec2 texCoord0;
|
||||
in vec4 normal;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0);
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
color.rgb = mix(overlayColor.rgb, color.rgb, overlayColor.a);
|
||||
color *= vertexColor * ColorModulator;
|
||||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
32
assets/minecraft/shaders/core/rendertype_entity_decal.json
Normal file
32
assets/minecraft/shaders/core/rendertype_entity_decal.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "rendertype_entity_decal",
|
||||
"fragment": "rendertype_entity_decal",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"Color",
|
||||
"UV0",
|
||||
"UV1",
|
||||
"UV2",
|
||||
"Normal"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" },
|
||||
{ "name": "Sampler1" },
|
||||
{ "name": "Sampler2" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
|
||||
{ "name": "Light0_Direction", "type": "float", "count": 3, "values": [0.0, 0.0, 0.0] },
|
||||
{ "name": "Light1_Direction", "type": "float", "count": 3, "values": [0.0, 0.0, 0.0] },
|
||||
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
|
||||
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
|
||||
{ "name": "FogColor", "type": "float", "count": 4, "values": [ 0.0, 0.0, 0.0, 0.0 ] }
|
||||
]
|
||||
}
|
||||
35
assets/minecraft/shaders/core/rendertype_entity_decal.vsh
Normal file
35
assets/minecraft/shaders/core/rendertype_entity_decal.vsh
Normal file
@@ -0,0 +1,35 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <light.glsl>
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV0;
|
||||
in ivec2 UV1;
|
||||
in ivec2 UV2;
|
||||
in vec3 Normal;
|
||||
|
||||
uniform sampler2D Sampler1;
|
||||
uniform sampler2D Sampler2;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
uniform vec3 Light0_Direction;
|
||||
uniform vec3 Light1_Direction;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
out vec4 overlayColor;
|
||||
out vec2 texCoord0;
|
||||
out vec4 normal;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = length((ModelViewMat * vec4(Position, 1.0)).xyz);
|
||||
vertexColor = minecraft_mix_light(Light0_Direction, Light1_Direction, Normal, Color) * texelFetch(Sampler2, UV2 / 16, 0);
|
||||
overlayColor = texelFetch(Sampler1, UV1, 0);
|
||||
texCoord0 = UV0;
|
||||
normal = ProjMat * ModelViewMat * vec4(Normal, 0.0);
|
||||
}
|
||||
23
assets/minecraft/shaders/core/rendertype_entity_glint.fsh
Normal file
23
assets/minecraft/shaders/core/rendertype_entity_glint.fsh
Normal file
@@ -0,0 +1,23 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <fog.glsl>
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
|
||||
in float vertexDistance;
|
||||
in vec2 texCoord0;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0) * ColorModulator;
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
float fade = linear_fog_fade(vertexDistance, FogStart, FogEnd);
|
||||
fragColor = vec4(color.rgb * fade, color.a);
|
||||
}
|
||||
24
assets/minecraft/shaders/core/rendertype_entity_glint.json
Normal file
24
assets/minecraft/shaders/core/rendertype_entity_glint.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "rendertype_entity_glint",
|
||||
"fragment": "rendertype_entity_glint",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"UV0"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
|
||||
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
|
||||
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
|
||||
{ "name": "TextureMat", "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 ] }
|
||||
]
|
||||
}
|
||||
18
assets/minecraft/shaders/core/rendertype_entity_glint.vsh
Normal file
18
assets/minecraft/shaders/core/rendertype_entity_glint.vsh
Normal file
@@ -0,0 +1,18 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec2 UV0;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
uniform mat4 TextureMat;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec2 texCoord0;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = length((ModelViewMat * vec4(Position, 1.0)).xyz);
|
||||
texCoord0 = (TextureMat * vec4(UV0, 0.0, 1.0)).xy;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <fog.glsl>
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
|
||||
in float vertexDistance;
|
||||
in vec2 texCoord0;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0) * ColorModulator;
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
float fade = linear_fog_fade(vertexDistance, FogStart, FogEnd);
|
||||
fragColor = vec4(color.rgb * fade, color.a);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "rendertype_entity_glint_direct",
|
||||
"fragment": "rendertype_entity_glint_direct",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"UV0"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
|
||||
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
|
||||
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
|
||||
{ "name": "TextureMat", "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 ] }
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec2 UV0;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
uniform mat4 TextureMat;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec2 texCoord0;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = length((ModelViewMat * vec4(Position, 1.0)).xyz);
|
||||
texCoord0 = (TextureMat * vec4(UV0, 0.0, 1.0)).xy;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <fog.glsl>
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
uniform vec4 FogColor;
|
||||
|
||||
in float vertexDistance;
|
||||
in vec4 vertexColor;
|
||||
in vec2 texCoord0;
|
||||
in vec4 normal;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0) * vertexColor * ColorModulator;
|
||||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "rendertype_entity_no_outline",
|
||||
"fragment": "rendertype_entity_no_outline",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"Color",
|
||||
"UV0",
|
||||
"UV2",
|
||||
"Normal"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" },
|
||||
{ "name": "Sampler2" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
|
||||
{ "name": "Light0_Direction", "type": "float", "count": 3, "values": [0.0, 0.0, 0.0] },
|
||||
{ "name": "Light1_Direction", "type": "float", "count": 3, "values": [0.0, 0.0, 0.0] },
|
||||
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
|
||||
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
|
||||
{ "name": "FogColor", "type": "float", "count": 4, "values": [ 0.0, 0.0, 0.0, 0.0 ] }
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <light.glsl>
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV0;
|
||||
in ivec2 UV2;
|
||||
in vec3 Normal;
|
||||
|
||||
uniform sampler2D Sampler2;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
uniform vec3 Light0_Direction;
|
||||
uniform vec3 Light1_Direction;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
out vec2 texCoord0;
|
||||
out vec4 normal;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = length((ModelViewMat * vec4(Position, 1.0)).xyz);
|
||||
vertexColor = minecraft_mix_light(Light0_Direction, Light1_Direction, Normal, Color) * texelFetch(Sampler2, UV2 / 16, 0);
|
||||
texCoord0 = UV0;
|
||||
normal = ProjMat * ModelViewMat * vec4(Normal, 0.0);
|
||||
}
|
||||
22
assets/minecraft/shaders/core/rendertype_entity_shadow.fsh
Normal file
22
assets/minecraft/shaders/core/rendertype_entity_shadow.fsh
Normal file
@@ -0,0 +1,22 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <fog.glsl>
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
uniform vec4 FogColor;
|
||||
|
||||
in float vertexDistance;
|
||||
in vec4 vertexColor;
|
||||
in vec2 texCoord0;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, clamp(texCoord0, 0.0, 1.0));
|
||||
color *= vertexColor * ColorModulator;
|
||||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
25
assets/minecraft/shaders/core/rendertype_entity_shadow.json
Normal file
25
assets/minecraft/shaders/core/rendertype_entity_shadow.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "rendertype_entity_shadow",
|
||||
"fragment": "rendertype_entity_shadow",
|
||||
"attributes": [
|
||||
"Position",
|
||||
"Color",
|
||||
"UV0"
|
||||
],
|
||||
"samplers": [
|
||||
{ "name": "Sampler0" }
|
||||
],
|
||||
"uniforms": [
|
||||
{ "name": "ModelViewMat", "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": "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": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
|
||||
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
|
||||
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
|
||||
{ "name": "FogColor", "type": "float", "count": 4, "values": [ 0.0, 0.0, 0.0, 0.0 ] }
|
||||
]
|
||||
}
|
||||
20
assets/minecraft/shaders/core/rendertype_entity_shadow.vsh
Normal file
20
assets/minecraft/shaders/core/rendertype_entity_shadow.vsh
Normal file
@@ -0,0 +1,20 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV0;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
out vec2 texCoord0;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = length((ModelViewMat * vec4(Position, 1.0)).xyz);
|
||||
vertexColor = Color;
|
||||
texCoord0 = UV0;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <fog.glsl>
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
uniform vec4 FogColor;
|
||||
|
||||
in float vertexDistance;
|
||||
in vec4 vertexColor;
|
||||
in vec4 lightMapColor;
|
||||
in vec4 overlayColor;
|
||||
in vec2 texCoord0;
|
||||
in vec4 normal;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0);
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
color *= vertexColor * ColorModulator;
|
||||
color.rgb = mix(overlayColor.rgb, color.rgb, overlayColor.a);
|
||||
color *= lightMapColor;
|
||||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user