-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
67b6ec0
commit 2c55cd8
Showing
32 changed files
with
663 additions
and
250 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#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.)discard;if(color.r==37./255.&&color.g==40./255.&&color.b==30./255.)color=vec4(0,0,0,0);if(color.r==38./255.&&color.g==26./255.&&color.b==28./255.)color=vec4(1,1,1,0.125);fragColor=color*ColorModulator;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#version 150 | ||
in vec3 Position;in vec2 UV0;uniform sampler2D Sampler0;uniform mat4 ModelViewMat;uniform mat4 ProjMat;out vec2 texCoord0;const vec2 corners[4]=vec2[4](vec2(1.,0.),vec2(0.,0.),vec2(0.,1.),vec2(1.,1.));vec4 getVertexColor(sampler2D Sampler,int vertexID,vec2 coords){vec2 size=1./textureSize(Sampler,0);return textureLod(Sampler,coords-(corners[vertexID%4]-0.5)*size,-9999);}void main(){gl_Position=ProjMat*ModelViewMat*vec4(Position,1.);texCoord0=UV0;vec4 color=getVertexColor(Sampler0,gl_VertexID,texCoord0);if(color.r==38./255.&&color.g==26./255.&&color.b==28./255.)gl_Position=ProjMat*ModelViewMat*vec4(Position+vec3(-5.,0.,0.),1.);else if(color.r==37./255.&&color.g==40./255.&&color.b==30./255.)gl_Position=ProjMat*ModelViewMat*vec4(Position+vec3(-5.,0.,0.),1.);} |
30 changes: 30 additions & 0 deletions
30
main/assets/minecraft/shaders/core/rendertype_armor_cutout_no_cull.fsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#version 150 | ||
|
||
#moj_import <fog.glsl> | ||
#moj_import <emissives_config_impl.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; | ||
|
||
in vec4 lightMapValue; | ||
in vec4 normalLightValue; | ||
|
||
out vec4 fragColor; | ||
|
||
void main() { | ||
vec4 color = texture(Sampler0, texCoord0); | ||
color = applyLighting(getAlpha(color.a), color * vertexColor, normalLightValue, lightMapValue); | ||
if (color.a < 0.1) { | ||
discard; | ||
} | ||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor) * ColorModulator; | ||
} |
40 changes: 40 additions & 0 deletions
40
main/assets/minecraft/shaders/core/rendertype_armor_cutout_no_cull.vsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#version 150 | ||
|
||
#moj_import <light.glsl> | ||
#moj_import <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 vec4 lightMapValue; | ||
out vec4 normalLightValue; | ||
|
||
void main() { | ||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0); | ||
|
||
vertexDistance = fog_distance(Position, FogShape); | ||
vertexColor = Color; | ||
texCoord0 = UV0; | ||
texCoord1 = UV1; | ||
|
||
lightMapValue = texelFetch(Sampler2, UV2 / 16, 0); | ||
normalLightValue = minecraft_mix_light(Light0_Direction, Light1_Direction, Normal, vec4(1.0)); | ||
} |
31 changes: 31 additions & 0 deletions
31
main/assets/minecraft/shaders/core/rendertype_entity_cutout.fsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#version 150 | ||
|
||
#moj_import <fog.glsl> | ||
|
||
#moj_import <emissives_config_impl.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; | ||
|
||
in vec4 normalLightValue; | ||
|
||
out vec4 fragColor; | ||
|
||
void main() { | ||
vec4 color = texture(Sampler0, texCoord0); | ||
if (color.a < 0.1) { | ||
discard; | ||
} | ||
color = applyLighting(getAlpha(color.a), mix(overlayColor, color * vertexColor, overlayColor.a), normalLightValue, lightMapColor); | ||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor) * ColorModulator; | ||
} |
41 changes: 41 additions & 0 deletions
41
main/assets/minecraft/shaders/core/rendertype_entity_cutout.vsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#version 150 | ||
|
||
#moj_import <light.glsl> | ||
#moj_import <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 lightMapColor; | ||
out vec4 overlayColor; | ||
out vec2 texCoord0; | ||
|
||
out vec4 normalLightValue; | ||
|
||
void main() { | ||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0); | ||
|
||
vertexDistance = fog_distance(Position, FogShape); | ||
vertexColor = Color; | ||
lightMapColor = texelFetch(Sampler2, UV2 / 16, 0); | ||
overlayColor = texelFetch(Sampler1, UV1, 0); | ||
texCoord0 = UV0; | ||
|
||
normalLightValue = minecraft_mix_light(Light0_Direction, Light1_Direction, Normal, vec4(1.0)); | ||
} |
30 changes: 30 additions & 0 deletions
30
main/assets/minecraft/shaders/core/rendertype_entity_cutout_no_cull_z_offset.fsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#version 150 | ||
|
||
#moj_import <fog.glsl> | ||
#moj_import <emissives_config_impl.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; | ||
|
||
in vec4 normalLightValue; | ||
|
||
out vec4 fragColor; | ||
|
||
void main() { | ||
vec4 color = texture(Sampler0, texCoord0); | ||
if (color.a < 0.1) { | ||
discard; | ||
} | ||
color = applyLighting(getAlpha(color.a), mix(overlayColor, color * vertexColor, overlayColor.a), normalLightValue, lightMapColor); | ||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor) * ColorModulator; | ||
} |
41 changes: 41 additions & 0 deletions
41
main/assets/minecraft/shaders/core/rendertype_entity_cutout_no_cull_z_offset.vsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#version 150 | ||
|
||
#moj_import <light.glsl> | ||
#moj_import <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 lightMapColor; | ||
out vec4 overlayColor; | ||
out vec2 texCoord0; | ||
|
||
out vec4 normalLightValue; | ||
|
||
void main() { | ||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0); | ||
|
||
vertexDistance = fog_distance(Position, FogShape); | ||
vertexColor = Color; | ||
lightMapColor = texelFetch(Sampler2, UV2 / 16, 0); | ||
overlayColor = texelFetch(Sampler1, UV1, 0); | ||
texCoord0 = UV0; | ||
|
||
normalLightValue = minecraft_mix_light(Light0_Direction, Light1_Direction, Normal, vec4(1.0)); | ||
} |
30 changes: 30 additions & 0 deletions
30
main/assets/minecraft/shaders/core/rendertype_entity_solid.fsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#version 150 | ||
|
||
#moj_import <fog.glsl> | ||
#moj_import <emissives_config_impl.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; | ||
|
||
in vec4 normalLightValue; | ||
|
||
out vec4 fragColor; | ||
|
||
void main() { | ||
vec4 color = texture(Sampler0, texCoord0); | ||
color = applyLighting(getAlpha(color.a), mix(overlayColor, color * vertexColor, overlayColor.a), normalLightValue, lightMapColor); | ||
if (color.a < 0.1) { | ||
discard; | ||
} | ||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor) * ColorModulator; | ||
} |
41 changes: 41 additions & 0 deletions
41
main/assets/minecraft/shaders/core/rendertype_entity_solid.vsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#version 150 | ||
|
||
#moj_import <light.glsl> | ||
#moj_import <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 lightMapColor; | ||
out vec4 overlayColor; | ||
out vec2 texCoord0; | ||
|
||
out vec4 normalLightValue; | ||
|
||
void main() { | ||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0); | ||
|
||
vertexDistance = fog_distance(Position, FogShape); | ||
vertexColor = Color; | ||
lightMapColor = texelFetch(Sampler2, UV2 / 16, 0); | ||
overlayColor = texelFetch(Sampler1, UV1, 0); | ||
texCoord0 = UV0; | ||
|
||
normalLightValue = minecraft_mix_light(Light0_Direction, Light1_Direction, Normal, vec4(1.0)); | ||
} |
46 changes: 46 additions & 0 deletions
46
main/assets/minecraft/shaders/core/rendertype_entity_translucent_cull.fsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#version 150 | ||
|
||
#moj_import <fog.glsl> | ||
#moj_import <emissives_config_impl.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; | ||
|
||
in vec4 lightMapValue; | ||
in vec4 normalLightValue; | ||
|
||
flat in int hideVertex; | ||
|
||
out vec4 fragColor; | ||
|
||
void main() { | ||
vec4 color = texture(Sampler0, texCoord0); | ||
|
||
// If hideVertex equal to 1 (true). | ||
// If vertextDistance is more than 800 it's a UI item. | ||
if(hideVertex == 1 && vertexDistance <= 800) { | ||
float alpha = textureLod(Sampler0, texCoord0, 0.0).a; | ||
|
||
// Discard if the alpha of the pixel is of value of 254, 251, 250, 201, 181, 180, 141, 140, 101, 100. | ||
// 254, 201, 101 are normal. | ||
// 251 is for emissive. | ||
if(alpha == 254.0 / 255.0 || alpha == 251.0 / 255.0 || alpha == 250.0 / 255.0 || alpha == 201.0 / 255.0 || alpha == 181.0 / 255.0 || alpha == 180.0 / 255.0 || alpha == 141.0 / 255.0 || alpha == 140.0 / 255.0 || alpha == 101.0 / 255.0 || alpha == 100.0 / 255.0) { | ||
discard; | ||
} | ||
} | ||
|
||
color = applyLighting(getAlpha(color.a), color * vertexColor, normalLightValue, lightMapValue); | ||
if (color.a < 0.1) { | ||
discard; | ||
} | ||
fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor) * ColorModulator; | ||
} |
50 changes: 50 additions & 0 deletions
50
main/assets/minecraft/shaders/core/rendertype_entity_translucent_cull.vsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#version 150 | ||
|
||
#moj_import <light.glsl> | ||
#moj_import <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 vec4 lightMapValue; | ||
out vec4 normalLightValue; | ||
|
||
flat out int hideVertex; | ||
|
||
void main() { | ||
gl_Position = ProjMat * ModelViewMat * vec4(Position, 1.0); | ||
|
||
// Fast distance check from camera using view space. | ||
float distToCamera = gl_Position.w; | ||
if(distToCamera <= 1.4) { | ||
hideVertex = 1; | ||
} else { | ||
hideVertex = 0; | ||
} | ||
|
||
vertexDistance = fog_distance(Position, FogShape); | ||
vertexColor = Color; | ||
texCoord0 = UV0; | ||
texCoord1 = UV1; | ||
|
||
lightMapValue = texelFetch(Sampler2, UV2 / 16, 0); | ||
normalLightValue = minecraft_mix_light(Light0_Direction, Light1_Direction, Normal, vec4(1.0)); | ||
} |
Oops, something went wrong.