You've already forked minecraft-assets
Create/Update assets for version 25w09a
This commit is contained in:
1
assets/minecraft/shaders/core/_list.json
Normal file
1
assets/minecraft/shaders/core/_list.json
Normal file
@@ -0,0 +1 @@
|
||||
{"directories":[],"files":["blit_screen.fsh","blit_screen.vsh","entity.fsh","entity.vsh","glint.fsh","glint.vsh","gui.fsh","gui.vsh","lightmap.fsh","particle.fsh","particle.vsh","position.fsh","position.vsh","position_color.fsh","position_color.vsh","position_color_lightmap.fsh","position_color_lightmap.vsh","position_color_tex_lightmap.fsh","position_color_tex_lightmap.vsh","position_tex.fsh","position_tex.vsh","position_tex_color.fsh","position_tex_color.vsh","rendertype_beacon_beam.fsh","rendertype_beacon_beam.vsh","rendertype_clouds.fsh","rendertype_clouds.vsh","rendertype_crumbling.fsh","rendertype_crumbling.vsh","rendertype_end_portal.fsh","rendertype_end_portal.vsh","rendertype_entity_alpha.fsh","rendertype_entity_alpha.vsh","rendertype_entity_decal.fsh","rendertype_entity_decal.vsh","rendertype_entity_shadow.fsh","rendertype_entity_shadow.vsh","rendertype_item_entity_translucent_cull.fsh","rendertype_item_entity_translucent_cull.vsh","rendertype_leash.fsh","rendertype_leash.vsh","rendertype_lightning.fsh","rendertype_lightning.vsh","rendertype_lines.fsh","rendertype_lines.vsh","rendertype_outline.fsh","rendertype_outline.vsh","rendertype_text.fsh","rendertype_text.vsh","rendertype_text_background.fsh","rendertype_text_background.vsh","rendertype_text_background_see_through.fsh","rendertype_text_background_see_through.vsh","rendertype_text_intensity.fsh","rendertype_text_intensity.vsh","rendertype_text_intensity_see_through.fsh","rendertype_text_intensity_see_through.vsh","rendertype_text_see_through.fsh","rendertype_text_see_through.vsh","rendertype_translucent_moving_block.fsh","rendertype_translucent_moving_block.vsh","rendertype_water_mask.fsh","rendertype_water_mask.vsh","rendertype_world_border.fsh","rendertype_world_border.vsh","terrain.fsh","terrain.vsh"]}
|
||||
11
assets/minecraft/shaders/core/blit_screen.fsh
Normal file
11
assets/minecraft/shaders/core/blit_screen.fsh
Normal file
@@ -0,0 +1,11 @@
|
||||
#version 150
|
||||
|
||||
uniform sampler2D InSampler;
|
||||
|
||||
in vec2 texCoord;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
fragColor = texture(InSampler, texCoord);
|
||||
}
|
||||
11
assets/minecraft/shaders/core/blit_screen.vsh
Normal file
11
assets/minecraft/shaders/core/blit_screen.vsh
Normal file
@@ -0,0 +1,11 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
|
||||
out vec2 texCoord;
|
||||
|
||||
void main() {
|
||||
vec2 screenPos = Position.xy * 2.0 - 1.0;
|
||||
gl_Position = vec4(screenPos.x, screenPos.y, 1.0, 1.0);
|
||||
texCoord = Position.xy;
|
||||
}
|
||||
35
assets/minecraft/shaders/core/entity.fsh
Normal file
35
assets/minecraft/shaders/core/entity.fsh
Normal file
@@ -0,0 +1,35 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft: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;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0);
|
||||
#ifdef ALPHA_CUTOUT
|
||||
if (color.a < ALPHA_CUTOUT) {
|
||||
discard;
|
||||
}
|
||||
#endif
|
||||
color *= vertexColor * ColorModulator;
|
||||
#ifndef NO_OVERLAY
|
||||
color.rgb = mix(overlayColor.rgb, color.rgb, overlayColor.a);
|
||||
#endif
|
||||
#ifndef EMISSIVE
|
||||
color *= lightMapColor;
|
||||
#endif
|
||||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
46
assets/minecraft/shaders/core/entity.vsh
Normal file
46
assets/minecraft/shaders/core/entity.vsh
Normal file
@@ -0,0 +1,46 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:light.glsl>
|
||||
#moj_import <minecraft:fog.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 mat4 TextureMat;
|
||||
uniform int FogShape;
|
||||
|
||||
uniform vec3 Light0_Direction;
|
||||
uniform vec3 Light1_Direction;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
out vec4 lightMapColor;
|
||||
out vec4 overlayColor;
|
||||
out vec2 texCoord0;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = fog_distance(Position, FogShape);
|
||||
#ifdef NO_CARDINAL_LIGHTING
|
||||
vertexColor = Color;
|
||||
#else
|
||||
vertexColor = minecraft_mix_light(Light0_Direction, Light1_Direction, Normal, Color);
|
||||
#endif
|
||||
lightMapColor = texelFetch(Sampler2, UV2 / 16, 0);
|
||||
overlayColor = texelFetch(Sampler1, UV1, 0);
|
||||
|
||||
texCoord0 = UV0;
|
||||
#ifdef APPLY_TEXTURE_MATRIX
|
||||
texCoord0 = (TextureMat * vec4(UV0, 0.0, 1.0)).xy;
|
||||
#endif
|
||||
}
|
||||
24
assets/minecraft/shaders/core/glint.fsh
Normal file
24
assets/minecraft/shaders/core/glint.fsh
Normal file
@@ -0,0 +1,24 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:fog.glsl>
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
uniform float GlintAlpha;
|
||||
|
||||
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) * GlintAlpha;
|
||||
fragColor = vec4(color.rgb * fade, color.a);
|
||||
}
|
||||
21
assets/minecraft/shaders/core/glint.vsh
Normal file
21
assets/minecraft/shaders/core/glint.vsh
Normal file
@@ -0,0 +1,21 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:fog.glsl>
|
||||
|
||||
in vec3 Position;
|
||||
in vec2 UV0;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
uniform mat4 TextureMat;
|
||||
uniform int FogShape;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec2 texCoord0;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = fog_distance(Position, FogShape);
|
||||
texCoord0 = (TextureMat * vec4(UV0, 0.0, 1.0)).xy;
|
||||
}
|
||||
15
assets/minecraft/shaders/core/gui.fsh
Normal file
15
assets/minecraft/shaders/core/gui.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;
|
||||
}
|
||||
15
assets/minecraft/shaders/core/gui.vsh
Normal file
15
assets/minecraft/shaders/core/gui.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;
|
||||
}
|
||||
68
assets/minecraft/shaders/core/lightmap.fsh
Normal file
68
assets/minecraft/shaders/core/lightmap.fsh
Normal file
@@ -0,0 +1,68 @@
|
||||
#version 150
|
||||
|
||||
uniform float AmbientLightFactor;
|
||||
uniform float SkyFactor;
|
||||
uniform float BlockFactor;
|
||||
uniform int UseBrightLightmap;
|
||||
uniform vec3 SkyLightColor;
|
||||
uniform float NightVisionFactor;
|
||||
uniform float DarknessScale;
|
||||
uniform float DarkenWorldFactor;
|
||||
uniform float BrightnessFactor;
|
||||
|
||||
in vec2 texCoord;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
float get_brightness(float level) {
|
||||
float curved_level = level / (4.0 - 3.0 * level);
|
||||
return mix(curved_level, 1.0, AmbientLightFactor);
|
||||
}
|
||||
|
||||
vec3 notGamma(vec3 x) {
|
||||
vec3 nx = 1.0 - x;
|
||||
return 1.0 - nx * nx * nx * nx;
|
||||
}
|
||||
|
||||
void main() {
|
||||
float block_brightness = get_brightness(floor(texCoord.x * 16) / 15) * BlockFactor;
|
||||
float sky_brightness = get_brightness(floor(texCoord.y * 16) / 15) * SkyFactor;
|
||||
|
||||
// cubic nonsense, dips to yellowish in the middle, white when fully saturated
|
||||
vec3 color = vec3(
|
||||
block_brightness,
|
||||
block_brightness * ((block_brightness * 0.6 + 0.4) * 0.6 + 0.4),
|
||||
block_brightness * (block_brightness * block_brightness * 0.6 + 0.4)
|
||||
);
|
||||
|
||||
if (UseBrightLightmap != 0) {
|
||||
color = mix(color, vec3(0.99, 1.12, 1.0), 0.25);
|
||||
color = clamp(color, 0.0, 1.0);
|
||||
} else {
|
||||
color += SkyLightColor * sky_brightness;
|
||||
color = mix(color, vec3(0.75), 0.04);
|
||||
|
||||
vec3 darkened_color = color * vec3(0.7, 0.6, 0.6);
|
||||
color = mix(color, darkened_color, DarkenWorldFactor);
|
||||
}
|
||||
|
||||
if (NightVisionFactor > 0.0) {
|
||||
// scale up uniformly until 1.0 is hit by one of the colors
|
||||
float max_component = max(color.r, max(color.g, color.b));
|
||||
if (max_component < 1.0) {
|
||||
vec3 bright_color = color / max_component;
|
||||
color = mix(color, bright_color, NightVisionFactor);
|
||||
}
|
||||
}
|
||||
|
||||
if (UseBrightLightmap == 0) {
|
||||
color = clamp(color - vec3(DarknessScale), 0.0, 1.0);
|
||||
}
|
||||
|
||||
vec3 notGamma = notGamma(color);
|
||||
color = mix(color, notGamma, BrightnessFactor);
|
||||
color = mix(color, vec3(0.75), 0.04);
|
||||
color = clamp(color, 0.0, 1.0);
|
||||
|
||||
fragColor = vec4(color, 1.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 <minecraft: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);
|
||||
}
|
||||
26
assets/minecraft/shaders/core/particle.vsh
Normal file
26
assets/minecraft/shaders/core/particle.vsh
Normal file
@@ -0,0 +1,26 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:fog.glsl>
|
||||
|
||||
in vec3 Position;
|
||||
in vec2 UV0;
|
||||
in vec4 Color;
|
||||
in ivec2 UV2;
|
||||
|
||||
uniform sampler2D Sampler2;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
uniform int FogShape;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec2 texCoord0;
|
||||
out vec4 vertexColor;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = fog_distance(Position, FogShape);
|
||||
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 <minecraft: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);
|
||||
}
|
||||
17
assets/minecraft/shaders/core/position.vsh
Normal file
17
assets/minecraft/shaders/core/position.vsh
Normal file
@@ -0,0 +1,17 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:fog.glsl>
|
||||
|
||||
in vec3 Position;
|
||||
|
||||
uniform mat4 ProjMat;
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform int FogShape;
|
||||
|
||||
out float vertexDistance;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = fog_distance(Position, FogShape);
|
||||
}
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
@@ -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,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;
|
||||
}
|
||||
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.0) {
|
||||
discard;
|
||||
}
|
||||
fragColor = color * ColorModulator;
|
||||
}
|
||||
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;
|
||||
}
|
||||
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 <minecraft: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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
16
assets/minecraft/shaders/core/rendertype_clouds.fsh
Normal file
16
assets/minecraft/shaders/core/rendertype_clouds.fsh
Normal file
@@ -0,0 +1,16 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:fog.glsl>
|
||||
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
uniform vec4 FogColor;
|
||||
|
||||
in float vertexDistance;
|
||||
in vec4 vertexColor;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
fragColor = linear_fog(vertexColor, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
23
assets/minecraft/shaders/core/rendertype_clouds.vsh
Normal file
23
assets/minecraft/shaders/core/rendertype_clouds.vsh
Normal file
@@ -0,0 +1,23 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:fog.glsl>
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
uniform vec3 ModelOffset;
|
||||
uniform int FogShape;
|
||||
uniform vec4 ColorModulator;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
|
||||
void main() {
|
||||
vec3 pos = Position + ModelOffset;
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(pos, 1.0);
|
||||
|
||||
vertexDistance = fog_distance(pos, FogShape);
|
||||
vertexColor = Color * ColorModulator;
|
||||
}
|
||||
19
assets/minecraft/shaders/core/rendertype_crumbling.fsh
Normal file
19
assets/minecraft/shaders/core/rendertype_crumbling.fsh
Normal file
@@ -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;
|
||||
}
|
||||
22
assets/minecraft/shaders/core/rendertype_crumbling.vsh
Normal file
22
assets/minecraft/shaders/core/rendertype_crumbling.vsh
Normal file
@@ -0,0 +1,22 @@
|
||||
#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;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexColor = Color;
|
||||
texCoord0 = UV0;
|
||||
texCoord2 = UV2;
|
||||
}
|
||||
66
assets/minecraft/shaders/core/rendertype_end_portal.fsh
Normal file
66
assets/minecraft/shaders/core/rendertype_end_portal.fsh
Normal file
@@ -0,0 +1,66 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:fog.glsl>
|
||||
#moj_import <minecraft:matrix.glsl>
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
uniform sampler2D Sampler1;
|
||||
|
||||
uniform float GameTime;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
uniform vec4 FogColor;
|
||||
|
||||
in vec4 texProj0;
|
||||
in float vertexDistance;
|
||||
|
||||
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 < PORTAL_LAYERS; i++) {
|
||||
color += textureProj(Sampler1, texProj0 * end_portal_layer(float(i + 1))).rgb * COLORS[i];
|
||||
}
|
||||
fragColor = linear_fog(vec4(color, 1.0), vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
20
assets/minecraft/shaders/core/rendertype_end_portal.vsh
Normal file
20
assets/minecraft/shaders/core/rendertype_end_portal.vsh
Normal file
@@ -0,0 +1,20 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:fog.glsl>
|
||||
#moj_import <minecraft:projection.glsl>
|
||||
|
||||
in vec3 Position;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
uniform int FogShape;
|
||||
|
||||
out vec4 texProj0;
|
||||
out float vertexDistance;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
texProj0 = projection_from_position(gl_Position);
|
||||
vertexDistance = fog_distance(Position, FogShape);
|
||||
}
|
||||
18
assets/minecraft/shaders/core/rendertype_entity_alpha.fsh
Normal file
18
assets/minecraft/shaders/core/rendertype_entity_alpha.fsh
Normal file
@@ -0,0 +1,18 @@
|
||||
#version 150
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
|
||||
in vec4 vertexColor;
|
||||
in vec2 texCoord0;
|
||||
in vec2 texCoord1;
|
||||
in vec2 texCoord2;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0);
|
||||
if (color.a < vertexColor.a) {
|
||||
discard;
|
||||
}
|
||||
fragColor = color;
|
||||
}
|
||||
25
assets/minecraft/shaders/core/rendertype_entity_alpha.vsh
Normal file
25
assets/minecraft/shaders/core/rendertype_entity_alpha.vsh
Normal file
@@ -0,0 +1,25 @@
|
||||
#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;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexColor = Color;
|
||||
texCoord0 = UV0;
|
||||
texCoord1 = UV1;
|
||||
texCoord2 = UV2;
|
||||
}
|
||||
27
assets/minecraft/shaders/core/rendertype_entity_decal.fsh
Normal file
27
assets/minecraft/shaders/core/rendertype_entity_decal.fsh
Normal file
@@ -0,0 +1,27 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft: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;
|
||||
|
||||
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);
|
||||
}
|
||||
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 <minecraft:light.glsl>
|
||||
#moj_import <minecraft:fog.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 int FogShape;
|
||||
|
||||
uniform vec3 Light0_Direction;
|
||||
uniform vec3 Light1_Direction;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
out vec4 overlayColor;
|
||||
out vec2 texCoord0;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = fog_distance(Position, FogShape);
|
||||
vertexColor = minecraft_mix_light(Light0_Direction, Light1_Direction, Normal, Color) * texelFetch(Sampler2, UV2 / 16, 0);
|
||||
overlayColor = texelFetch(Sampler1, UV1, 0);
|
||||
texCoord0 = UV0;
|
||||
}
|
||||
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 <minecraft: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);
|
||||
}
|
||||
23
assets/minecraft/shaders/core/rendertype_entity_shadow.vsh
Normal file
23
assets/minecraft/shaders/core/rendertype_entity_shadow.vsh
Normal file
@@ -0,0 +1,23 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:fog.glsl>
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV0;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
uniform int FogShape;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
out vec2 texCoord0;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = fog_distance(Position, FogShape);
|
||||
vertexColor = Color;
|
||||
texCoord0 = UV0;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft: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;
|
||||
|
||||
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,36 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:light.glsl>
|
||||
#moj_import <minecraft:fog.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 int FogShape;
|
||||
|
||||
uniform vec3 Light0_Direction;
|
||||
uniform vec3 Light1_Direction;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
out vec2 texCoord0;
|
||||
out vec2 texCoord1;
|
||||
out vec2 texCoord2;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = fog_distance(Position, FogShape);
|
||||
vertexColor = minecraft_mix_light(Light0_Direction, Light1_Direction, Normal, Color) * texelFetch(Sampler2, UV2 / 16, 0);
|
||||
texCoord0 = UV0;
|
||||
texCoord1 = UV1;
|
||||
texCoord2 = UV2;
|
||||
}
|
||||
16
assets/minecraft/shaders/core/rendertype_leash.fsh
Normal file
16
assets/minecraft/shaders/core/rendertype_leash.fsh
Normal file
@@ -0,0 +1,16 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:fog.glsl>
|
||||
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
uniform vec4 FogColor;
|
||||
|
||||
in float vertexDistance;
|
||||
flat in vec4 vertexColor;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
fragColor = linear_fog(vertexColor, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
24
assets/minecraft/shaders/core/rendertype_leash.vsh
Normal file
24
assets/minecraft/shaders/core/rendertype_leash.vsh
Normal file
@@ -0,0 +1,24 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:fog.glsl>
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in ivec2 UV2;
|
||||
|
||||
uniform sampler2D Sampler2;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
uniform vec4 ColorModulator;
|
||||
uniform int FogShape;
|
||||
|
||||
out float vertexDistance;
|
||||
flat out vec4 vertexColor;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = fog_distance(Position, FogShape);
|
||||
vertexColor = Color * ColorModulator * texelFetch(Sampler2, UV2 / 16, 0);
|
||||
}
|
||||
16
assets/minecraft/shaders/core/rendertype_lightning.fsh
Normal file
16
assets/minecraft/shaders/core/rendertype_lightning.fsh
Normal file
@@ -0,0 +1,16 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:fog.glsl>
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
|
||||
in float vertexDistance;
|
||||
in vec4 vertexColor;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
fragColor = vertexColor * ColorModulator * linear_fog_fade(vertexDistance, FogStart, FogEnd);
|
||||
}
|
||||
20
assets/minecraft/shaders/core/rendertype_lightning.vsh
Normal file
20
assets/minecraft/shaders/core/rendertype_lightning.vsh
Normal file
@@ -0,0 +1,20 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:fog.glsl>
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
uniform int FogShape;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = fog_distance(Position, FogShape);
|
||||
vertexColor = Color;
|
||||
}
|
||||
18
assets/minecraft/shaders/core/rendertype_lines.fsh
Normal file
18
assets/minecraft/shaders/core/rendertype_lines.fsh
Normal file
@@ -0,0 +1,18 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:fog.glsl>
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
uniform float FogStart;
|
||||
uniform float FogEnd;
|
||||
uniform vec4 FogColor;
|
||||
|
||||
in float vertexDistance;
|
||||
in vec4 vertexColor;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = vertexColor * ColorModulator;
|
||||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
48
assets/minecraft/shaders/core/rendertype_lines.vsh
Normal file
48
assets/minecraft/shaders/core/rendertype_lines.vsh
Normal file
@@ -0,0 +1,48 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:fog.glsl>
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec3 Normal;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
uniform float LineWidth;
|
||||
uniform vec2 ScreenSize;
|
||||
uniform int FogShape;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
|
||||
const float VIEW_SHRINK = 1.0 - (1.0 / 256.0);
|
||||
const mat4 VIEW_SCALE = mat4(
|
||||
VIEW_SHRINK, 0.0, 0.0, 0.0,
|
||||
0.0, VIEW_SHRINK, 0.0, 0.0,
|
||||
0.0, 0.0, VIEW_SHRINK, 0.0,
|
||||
0.0, 0.0, 0.0, 1.0
|
||||
);
|
||||
|
||||
void main() {
|
||||
vec4 linePosStart = ProjMat * VIEW_SCALE * ModelViewMat * vec4(Position, 1.0);
|
||||
vec4 linePosEnd = ProjMat * VIEW_SCALE * ModelViewMat * vec4(Position + Normal, 1.0);
|
||||
|
||||
vec3 ndc1 = linePosStart.xyz / linePosStart.w;
|
||||
vec3 ndc2 = linePosEnd.xyz / linePosEnd.w;
|
||||
|
||||
vec2 lineScreenDirection = normalize((ndc2.xy - ndc1.xy) * ScreenSize);
|
||||
vec2 lineOffset = vec2(-lineScreenDirection.y, lineScreenDirection.x) * LineWidth / ScreenSize;
|
||||
|
||||
if (lineOffset.x < 0.0) {
|
||||
lineOffset *= -1.0;
|
||||
}
|
||||
|
||||
if (gl_VertexID % 2 == 0) {
|
||||
gl_Position = vec4((ndc1 + vec3(lineOffset, 0.0)) * linePosStart.w, linePosStart.w);
|
||||
} else {
|
||||
gl_Position = vec4((ndc1 - vec3(lineOffset, 0.0)) * linePosStart.w, linePosStart.w);
|
||||
}
|
||||
|
||||
vertexDistance = fog_distance(Position, FogShape);
|
||||
vertexColor = Color;
|
||||
}
|
||||
18
assets/minecraft/shaders/core/rendertype_outline.fsh
Normal file
18
assets/minecraft/shaders/core/rendertype_outline.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);
|
||||
if (color.a == 0.0) {
|
||||
discard;
|
||||
}
|
||||
fragColor = vec4(ColorModulator.rgb * vertexColor.rgb, ColorModulator.a);
|
||||
}
|
||||
18
assets/minecraft/shaders/core/rendertype_outline.vsh
Normal file
18
assets/minecraft/shaders/core/rendertype_outline.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;
|
||||
}
|
||||
24
assets/minecraft/shaders/core/rendertype_text.fsh
Normal file
24
assets/minecraft/shaders/core/rendertype_text.fsh
Normal file
@@ -0,0 +1,24 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft: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, texCoord0) * vertexColor * ColorModulator;
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
26
assets/minecraft/shaders/core/rendertype_text.vsh
Normal file
26
assets/minecraft/shaders/core/rendertype_text.vsh
Normal file
@@ -0,0 +1,26 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:fog.glsl>
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV0;
|
||||
in ivec2 UV2;
|
||||
|
||||
uniform sampler2D Sampler2;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
uniform int FogShape;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
out vec2 texCoord0;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = fog_distance(Position, FogShape);
|
||||
vertexColor = Color * texelFetch(Sampler2, UV2 / 16, 0);
|
||||
texCoord0 = UV0;
|
||||
}
|
||||
24
assets/minecraft/shaders/core/rendertype_text_background.fsh
Normal file
24
assets/minecraft/shaders/core/rendertype_text_background.fsh
Normal file
@@ -0,0 +1,24 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft: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 = vertexColor * ColorModulator;
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
23
assets/minecraft/shaders/core/rendertype_text_background.vsh
Normal file
23
assets/minecraft/shaders/core/rendertype_text_background.vsh
Normal file
@@ -0,0 +1,23 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:fog.glsl>
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in ivec2 UV2;
|
||||
|
||||
uniform sampler2D Sampler2;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
uniform int FogShape;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = fog_distance(Position, FogShape);
|
||||
vertexColor = Color * texelFetch(Sampler2, UV2 / 16, 0);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#version 150
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
|
||||
in vec4 vertexColor;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = vertexColor;
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
fragColor = color * ColorModulator;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
24
assets/minecraft/shaders/core/rendertype_text_intensity.fsh
Normal file
24
assets/minecraft/shaders/core/rendertype_text_intensity.fsh
Normal file
@@ -0,0 +1,24 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft: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, texCoord0).rrrr * vertexColor * ColorModulator;
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
26
assets/minecraft/shaders/core/rendertype_text_intensity.vsh
Normal file
26
assets/minecraft/shaders/core/rendertype_text_intensity.vsh
Normal file
@@ -0,0 +1,26 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:fog.glsl>
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV0;
|
||||
in ivec2 UV2;
|
||||
|
||||
uniform sampler2D Sampler2;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
uniform int FogShape;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
out vec2 texCoord0;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexDistance = fog_distance(Position, FogShape);
|
||||
vertexColor = Color * texelFetch(Sampler2, UV2 / 16, 0);
|
||||
texCoord0 = UV0;
|
||||
}
|
||||
@@ -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).rrrr * vertexColor;
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
fragColor = color * ColorModulator;
|
||||
}
|
||||
@@ -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,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;
|
||||
}
|
||||
@@ -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,16 @@
|
||||
#version 150
|
||||
|
||||
uniform sampler2D Sampler0;
|
||||
uniform sampler2D Sampler2;
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
|
||||
in vec4 vertexColor;
|
||||
in vec2 texCoord0;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(Sampler0, texCoord0) * vertexColor;
|
||||
fragColor = color * ColorModulator;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec4 Color;
|
||||
in vec2 UV0;
|
||||
in ivec2 UV2;
|
||||
in vec3 Normal;
|
||||
|
||||
uniform sampler2D Sampler2;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
out vec4 vertexColor;
|
||||
out vec2 texCoord0;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
|
||||
vertexColor = Color * texelFetch(Sampler2, UV2 / 16, 0);
|
||||
texCoord0 = UV0;
|
||||
}
|
||||
9
assets/minecraft/shaders/core/rendertype_water_mask.fsh
Normal file
9
assets/minecraft/shaders/core/rendertype_water_mask.fsh
Normal file
@@ -0,0 +1,9 @@
|
||||
#version 150
|
||||
|
||||
uniform vec4 ColorModulator;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
fragColor = ColorModulator;
|
||||
}
|
||||
10
assets/minecraft/shaders/core/rendertype_water_mask.vsh
Normal file
10
assets/minecraft/shaders/core/rendertype_water_mask.vsh
Normal file
@@ -0,0 +1,10 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
|
||||
void main() {
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0);
|
||||
}
|
||||
17
assets/minecraft/shaders/core/rendertype_world_border.fsh
Normal file
17
assets/minecraft/shaders/core/rendertype_world_border.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;
|
||||
}
|
||||
18
assets/minecraft/shaders/core/rendertype_world_border.vsh
Normal file
18
assets/minecraft/shaders/core/rendertype_world_border.vsh
Normal file
@@ -0,0 +1,18 @@
|
||||
#version 150
|
||||
|
||||
in vec3 Position;
|
||||
in vec2 UV0;
|
||||
|
||||
uniform mat4 TextureMat;
|
||||
uniform mat4 ModelViewMat;
|
||||
uniform mat4 ProjMat;
|
||||
uniform vec3 ModelOffset;
|
||||
|
||||
out vec2 texCoord0;
|
||||
|
||||
void main() {
|
||||
vec3 pos = Position + ModelOffset;
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(pos, 1.0);
|
||||
|
||||
texCoord0 = (TextureMat * vec4(UV0, 0.0, 1.0)).xy;
|
||||
}
|
||||
26
assets/minecraft/shaders/core/terrain.fsh
Normal file
26
assets/minecraft/shaders/core/terrain.fsh
Normal file
@@ -0,0 +1,26 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft: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, texCoord0) * vertexColor * ColorModulator;
|
||||
#ifdef ALPHA_CUTOUT
|
||||
if (color.a < ALPHA_CUTOUT) {
|
||||
discard;
|
||||
}
|
||||
#endif
|
||||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor);
|
||||
}
|
||||
30
assets/minecraft/shaders/core/terrain.vsh
Normal file
30
assets/minecraft/shaders/core/terrain.vsh
Normal file
@@ -0,0 +1,30 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:light.glsl>
|
||||
#moj_import <minecraft:fog.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 ModelOffset;
|
||||
uniform int FogShape;
|
||||
|
||||
out float vertexDistance;
|
||||
out vec4 vertexColor;
|
||||
out vec2 texCoord0;
|
||||
|
||||
void main() {
|
||||
vec3 pos = Position + ModelOffset;
|
||||
gl_Position = ProjMat * ModelViewMat * vec4(pos, 1.0);
|
||||
|
||||
vertexDistance = fog_distance(pos, FogShape);
|
||||
vertexColor = Color * minecraft_sample_lightmap(Sampler2, UV2);
|
||||
texCoord0 = UV0;
|
||||
}
|
||||
Reference in New Issue
Block a user