Alot of work

This commit is contained in:
mcrcortex
2023-12-01 11:53:35 +10:00
parent 9b3f8da1a5
commit 6ef2902e0c
31 changed files with 398 additions and 249 deletions

View File

@@ -0,0 +1,5 @@
layout(binding=0) uniform sampler2D colourTexture;
in vec2 uv;
void main() {
gl_Colour = texture(colourTexture, uv);
}

View File

@@ -0,0 +1,4 @@
void main() {
gl_Position =
}

View File

@@ -66,5 +66,9 @@ layout(binding = 6, std430) readonly restrict buffer BiomeBuffer {
};
layout(binding = 7, std430) readonly restrict buffer LightingBuffer {
vec4 lightData[];
uint lightData[];
};
vec4 getLighting(uint index) {
return vec4((uvec4(lightData[index])>>uvec4(16,8,0,24))&uvec4(0xFF))*vec4(1f/255.0f);
}

View File

@@ -65,6 +65,9 @@ void main() {
uint biomeId = extractBiomeId(quad);
State stateInfo = stateData[stateId];
colour = uint2vec4RGBA(stateInfo.faceColours[face]);
colour *= getLighting(extractLightId(quad));
if (((stateInfo.biomeTintMsk>>face)&1) == 1) {
vec4 biomeColour = uint2vec4RGBA(biomeData[biomeId].foliage);
colour *= biomeColour;