diff options
Diffstat (limited to 'assets/minecraft/shaders/include/player.glsl')
| -rwxr-xr-x | assets/minecraft/shaders/include/player.glsl | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/assets/minecraft/shaders/include/player.glsl b/assets/minecraft/shaders/include/player.glsl new file mode 100755 index 00000000..a421a1ff --- /dev/null +++ b/assets/minecraft/shaders/include/player.glsl | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | if (player == 2 && color.rgb == vec3(0.0)) { | ||
| 2 | color.a = 0.0; | ||
| 3 | } | ||
| 4 | |||
| 5 | float emissive = 0.0; | ||
| 6 | float damage = 0.25; | ||
| 7 | |||
| 8 | for (int i = 0; i < 4; i++) { | ||
| 9 | for (int j = 0; j < 4; j++) { | ||
| 10 | vec4 control = texelFetch(Sampler0, ivec2(36 + i, 16 + j), 0); | ||
| 11 | if (control.rgb == color.rgb) { | ||
| 12 | emissive = 1.0; | ||
| 13 | } | ||
| 14 | } | ||
| 15 | } | ||
| 16 | |||
| 17 | if (settings2.r > 0.99) { | ||
| 18 | damage = 0.0; | ||
| 19 | } | ||
| 20 | |||
| 21 | if (overlayColor.a < 0.99) { | ||
| 22 | if (texelFetch(Sampler0, ivec2(2, 16), 0).r > 0.99) { | ||
| 23 | for (int i = 0; i < 4; i++) { | ||
| 24 | for (int j = 0; j < 4; j++) { | ||
| 25 | vec4 control = texelFetch(Sampler0, ivec2(12 + i, 16 + j), 0); | ||
| 26 | if (control.rgb == color.rgb) { | ||
| 27 | damage = 0.25; | ||
| 28 | } | ||
| 29 | } | ||
| 30 | } | ||
| 31 | for (int i = 0; i < 4; i++) { | ||
| 32 | for (int j = 0; j < 4; j++) { | ||
| 33 | vec4 control = texelFetch(Sampler0, ivec2(16 + i, 16 + j), 0); | ||
| 34 | if (control.rgb == color.rgb) { | ||
| 35 | damage = 1.0; | ||
| 36 | } | ||
| 37 | } | ||
| 38 | } | ||
| 39 | } | ||
| 40 | color.rgb = mix(color.rgb, overlayColor.rgb, damage); | ||
| 41 | } | ||
| 42 | |||
| 43 | color *= ColorModulator; | ||
| 44 | |||
| 45 | if (settings.g != 1.0 || emissive != 1.0) { | ||
| 46 | color *= lightMapColor * vertexColor; | ||
| 47 | } | ||
| 48 | |||
| 49 | fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor); | ||