This commit is contained in:
Leo Codes
2025-03-09 18:32:49 +01:00
commit fd46963e72
749 changed files with 8194 additions and 0 deletions
@@ -0,0 +1,21 @@
#version 150
#moj_import <fog.glsl>
uniform sampler2D Sampler0;
uniform vec4 ColorModulator;
uniform float FogStart;
uniform float FogEnd;
uniform vec4 FogColor;
out vec2 texCoord0;
out float vertexDistance;
out vec4 vertexColor;
out vec4 normal;
void main() {
vec4 color = texture(Sampler0, texCoord0) * vertexColor * ColorModulator;
vertexColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
}
@@ -0,0 +1,29 @@
{
"blend": {
"func": "add",
"srcrgb": "srcalpha",
"dstrgb": "1-srcalpha"
},
"vertex": "position_normal_tex_lightmap",
"fragment": "position_normal_tex_lightmap",
"attributes": [
"Position",
"Normal",
"UV0",
"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": "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,35 @@
#version 150
#moj_import <light.glsl>
in vec3 Position;
in vec3 Normal;
in vec2 UV0;
in ivec2 UV2;
uniform mat4 ModelViewMat;
uniform mat4 ProjMat;
// These are the lights used for
uniform vec3 Light0_Direction;
uniform vec3 Light1_Direction;
//
uniform sampler2D Sampler0;
// Sampler2 is the lightmap texture unit
uniform sampler2D Sampler2;
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 = minecraft_mix_light(Light0_Direction, Light1_Direction, Normal, vec4(1.)) * texelFetch(Sampler2, UV2 / 16, 0);
normal = ProjMat * ModelViewMat * vec4(Normal, 0.0);
}