Create/Update assets for version 25w09a

This commit is contained in:
InventiveBot
2025-02-26 18:31:02 +01:00
parent cae88d9a77
commit 8caafb37a5
22030 changed files with 1526584 additions and 18 deletions

View File

@@ -0,0 +1 @@
{"directories":[],"files":["fog.glsl","light.glsl","matrix.glsl","projection.glsl"]}

View File

@@ -0,0 +1,30 @@
#version 150
vec4 linear_fog(vec4 inColor, float vertexDistance, float fogStart, float fogEnd, vec4 fogColor) {
if (vertexDistance <= fogStart) {
return inColor;
}
float fogValue = vertexDistance < fogEnd ? smoothstep(fogStart, fogEnd, vertexDistance) : 1.0;
return vec4(mix(inColor.rgb, fogColor.rgb, fogValue * fogColor.a), inColor.a);
}
float linear_fog_fade(float vertexDistance, float fogStart, float fogEnd) {
if (vertexDistance <= fogStart) {
return 1.0;
} else if (vertexDistance >= fogEnd) {
return 0.0;
}
return smoothstep(fogEnd, fogStart, vertexDistance);
}
float fog_distance(vec3 pos, int shape) {
if (shape == 0) {
return length(pos);
} else {
float distXZ = length(pos.xz);
float distY = abs(pos.y);
return max(distXZ, distY);
}
}

View File

@@ -0,0 +1,15 @@
#version 150
#define MINECRAFT_LIGHT_POWER (0.6)
#define MINECRAFT_AMBIENT_LIGHT (0.4)
vec4 minecraft_mix_light(vec3 lightDir0, vec3 lightDir1, vec3 normal, vec4 color) {
float light0 = max(0.0, dot(lightDir0, normal));
float light1 = max(0.0, dot(lightDir1, normal));
float lightAccum = min(1.0, (light0 + light1) * MINECRAFT_LIGHT_POWER + MINECRAFT_AMBIENT_LIGHT);
return vec4(color.rgb * lightAccum, color.a);
}
vec4 minecraft_sample_lightmap(sampler2D lightMap, ivec2 uv) {
return texture(lightMap, clamp(uv / 256.0, vec2(0.5 / 16.0), vec2(15.5 / 16.0)));
}

View File

@@ -0,0 +1,8 @@
#version 150
mat2 mat2_rotate_z(float radians) {
return mat2(
cos(radians), -sin(radians),
sin(radians), cos(radians)
);
}

View File

@@ -0,0 +1,8 @@
#version 150
vec4 projection_from_position(vec4 position) {
vec4 projection = position * 0.5;
projection.xy = vec2(projection.x + projection.w, projection.y + projection.w);
projection.zw = position.zw;
return projection;
}