You've already forked minecraft-assets
Create/Update assets for version 25w09a
This commit is contained in:
1
assets/minecraft/shaders/include/_list.json
Normal file
1
assets/minecraft/shaders/include/_list.json
Normal file
@@ -0,0 +1 @@
|
||||
{"directories":[],"files":["fog.glsl","light.glsl","matrix.glsl","projection.glsl"]}
|
||||
30
assets/minecraft/shaders/include/fog.glsl
Normal file
30
assets/minecraft/shaders/include/fog.glsl
Normal 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);
|
||||
}
|
||||
}
|
||||
15
assets/minecraft/shaders/include/light.glsl
Normal file
15
assets/minecraft/shaders/include/light.glsl
Normal 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)));
|
||||
}
|
||||
8
assets/minecraft/shaders/include/matrix.glsl
Normal file
8
assets/minecraft/shaders/include/matrix.glsl
Normal file
@@ -0,0 +1,8 @@
|
||||
#version 150
|
||||
|
||||
mat2 mat2_rotate_z(float radians) {
|
||||
return mat2(
|
||||
cos(radians), -sin(radians),
|
||||
sin(radians), cos(radians)
|
||||
);
|
||||
}
|
||||
8
assets/minecraft/shaders/include/projection.glsl
Normal file
8
assets/minecraft/shaders/include/projection.glsl
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user