mirror of
https://github.com/wisplite/crystalline-sky.git
synced 2026-10-30 13:32:18 -05:00
rendering improvements
begin adding weeping sky datagen bayer transparency
This commit is contained in:
@@ -1,2 +1,5 @@
|
||||
{
|
||||
"block.crystalline_sky.sky": "Sky",
|
||||
"block.crystalline_sky.weeping_sky": "Weeping Sky",
|
||||
"block.crystalline_sky.sky_light": "Sky Light"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#version 150
|
||||
|
||||
#moj_import <minecraft:globals.glsl>
|
||||
#moj_import <minecraft:fog.glsl>
|
||||
#moj_import <minecraft:dynamictransforms.glsl>
|
||||
|
||||
@@ -11,12 +12,30 @@ in vec4 texProj0;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
#ifndef BAYER_BIAS
|
||||
#define BAYER_BIAS 0.0
|
||||
#endif
|
||||
|
||||
#ifndef SCALE
|
||||
#define SCALE 1
|
||||
#endif
|
||||
|
||||
const mat4x4 bayerMatrix4x4 = mat4x4(
|
||||
0.0, 8.0, 2.0, 10.0,
|
||||
12.0, 4.0, 14.0, 6.0,
|
||||
3.0, 11.0, 1.0, 9.0,
|
||||
15.0, 7.0, 13.0, 5.0
|
||||
) / 16.0;
|
||||
|
||||
void main() {
|
||||
vec4 color = textureProj(Sampler0, texProj0) * ColorModulator;
|
||||
#ifdef ALPHA_CUTOUT
|
||||
if (color.a < ALPHA_CUTOUT) {
|
||||
int x = int(gl_FragCoord.x / SCALE) % 4;
|
||||
int y = int(gl_FragCoord.y / SCALE) % 4;
|
||||
float bayer = bayerMatrix4x4[y][x];
|
||||
|
||||
if (ColorModulator.a <= bayer + BAYER_BIAS) {
|
||||
discard;
|
||||
}
|
||||
#endif
|
||||
|
||||
vec4 color = textureProj(Sampler0, texProj0) * vec4(ColorModulator.rgb, 1.0);
|
||||
fragColor = apply_fog(color, sphericalVertexDistance, cylindricalVertexDistance, FogEnvironmentalStart, FogEnvironmentalEnd, FogRenderDistanceStart, FogRenderDistanceEnd, FogColor);
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
Binary file not shown.
Reference in New Issue
Block a user