revert to vanilla assets
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
#version 330
|
||||
|
||||
layout(std140) uniform SpriteAnimationInfo {
|
||||
mat4 ProjectionMatrix;
|
||||
mat4 SpriteMatrix;
|
||||
float UPadding;
|
||||
float VPadding;
|
||||
int MipMapLevel;
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
#version 330
|
||||
|
||||
layout(std140) uniform ChunkSection {
|
||||
mat4 ModelViewMat;
|
||||
float ChunkVisibility;
|
||||
ivec2 TextureSize;
|
||||
ivec3 ChunkPosition;
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
#version 330
|
||||
|
||||
layout(std140) uniform DynamicTransforms {
|
||||
mat4 ModelViewMat;
|
||||
vec4 ColorModulator;
|
||||
vec3 ModelOffset;
|
||||
mat4 TextureMat;
|
||||
};
|
||||
40
public/assets/minecraft/shaders/include/fog.glsl
Normal file
40
public/assets/minecraft/shaders/include/fog.glsl
Normal file
@@ -0,0 +1,40 @@
|
||||
#version 330
|
||||
|
||||
layout(std140) uniform Fog {
|
||||
vec4 FogColor;
|
||||
float FogEnvironmentalStart;
|
||||
float FogEnvironmentalEnd;
|
||||
float FogRenderDistanceStart;
|
||||
float FogRenderDistanceEnd;
|
||||
float FogSkyEnd;
|
||||
float FogCloudsEnd;
|
||||
};
|
||||
|
||||
float linear_fog_value(float vertexDistance, float fogStart, float fogEnd) {
|
||||
if (vertexDistance <= fogStart) {
|
||||
return 0.0;
|
||||
} else if (vertexDistance >= fogEnd) {
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
return (vertexDistance - fogStart) / (fogEnd - fogStart);
|
||||
}
|
||||
|
||||
float total_fog_value(float sphericalVertexDistance, float cylindricalVertexDistance, float environmentalStart, float environmantalEnd, float renderDistanceStart, float renderDistanceEnd) {
|
||||
return max(linear_fog_value(sphericalVertexDistance, environmentalStart, environmantalEnd), linear_fog_value(cylindricalVertexDistance, renderDistanceStart, renderDistanceEnd));
|
||||
}
|
||||
|
||||
vec4 apply_fog(vec4 inColor, float sphericalVertexDistance, float cylindricalVertexDistance, float environmentalStart, float environmantalEnd, float renderDistanceStart, float renderDistanceEnd, vec4 fogColor) {
|
||||
float fogValue = total_fog_value(sphericalVertexDistance, cylindricalVertexDistance, environmentalStart, environmantalEnd, renderDistanceStart, renderDistanceEnd);
|
||||
return vec4(mix(inColor.rgb, fogColor.rgb, fogValue * fogColor.a), inColor.a);
|
||||
}
|
||||
|
||||
float fog_spherical_distance(vec3 pos) {
|
||||
return length(pos);
|
||||
}
|
||||
|
||||
float fog_cylindrical_distance(vec3 pos) {
|
||||
float distXZ = length(pos.xz);
|
||||
float distY = abs(pos.y);
|
||||
return max(distXZ, distY);
|
||||
}
|
||||
11
public/assets/minecraft/shaders/include/globals.glsl
Normal file
11
public/assets/minecraft/shaders/include/globals.glsl
Normal file
@@ -0,0 +1,11 @@
|
||||
#version 330
|
||||
|
||||
layout(std140) uniform Globals {
|
||||
ivec3 CameraBlockPos;
|
||||
vec3 CameraOffset;
|
||||
vec2 ScreenSize;
|
||||
float GlintAlpha;
|
||||
float GameTime;
|
||||
int MenuBlurRadius;
|
||||
int UseRgss;
|
||||
};
|
||||
25
public/assets/minecraft/shaders/include/light.glsl
Normal file
25
public/assets/minecraft/shaders/include/light.glsl
Normal file
@@ -0,0 +1,25 @@
|
||||
#version 330
|
||||
|
||||
#define MINECRAFT_LIGHT_POWER (0.6)
|
||||
#define MINECRAFT_AMBIENT_LIGHT (0.4)
|
||||
|
||||
layout(std140) uniform Lighting {
|
||||
vec3 Light0_Direction;
|
||||
vec3 Light1_Direction;
|
||||
};
|
||||
|
||||
vec2 minecraft_compute_light(vec3 lightDir0, vec3 lightDir1, vec3 normal) {
|
||||
return vec2(dot(lightDir0, normal), dot(lightDir1, normal));
|
||||
}
|
||||
|
||||
vec4 minecraft_mix_light_separate(vec2 light, vec4 color) {
|
||||
vec2 lightValue = max(vec2(0.0), light);
|
||||
float lightAccum = min(1.0, (lightValue.x + lightValue.y) * MINECRAFT_LIGHT_POWER + MINECRAFT_AMBIENT_LIGHT);
|
||||
return vec4(color.rgb * lightAccum, color.a);
|
||||
}
|
||||
|
||||
vec4 minecraft_mix_light(vec3 lightDir0, vec3 lightDir1, vec3 normal, vec4 color) {
|
||||
vec2 light = minecraft_compute_light(lightDir0, lightDir1, normal);
|
||||
return minecraft_mix_light_separate(light, color);
|
||||
}
|
||||
|
||||
8
public/assets/minecraft/shaders/include/matrix.glsl
Normal file
8
public/assets/minecraft/shaders/include/matrix.glsl
Normal file
@@ -0,0 +1,8 @@
|
||||
#version 330
|
||||
|
||||
mat2 mat2_rotate_z(float radians) {
|
||||
return mat2(
|
||||
cos(radians), -sin(radians),
|
||||
sin(radians), cos(radians)
|
||||
);
|
||||
}
|
||||
12
public/assets/minecraft/shaders/include/projection.glsl
Normal file
12
public/assets/minecraft/shaders/include/projection.glsl
Normal file
@@ -0,0 +1,12 @@
|
||||
#version 330
|
||||
|
||||
layout(std140) uniform Projection {
|
||||
mat4 ProjMat;
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
#version 330
|
||||
|
||||
vec4 sample_lightmap(sampler2D lightMap, ivec2 uv) {
|
||||
return texture(lightMap, clamp((uv / 256.0) + 0.5 / 16.0, vec2(0.5 / 16.0), vec2(15.5 / 16.0)));
|
||||
}
|
||||
Reference in New Issue
Block a user