Began major engineering on texturing
This commit is contained in:
@@ -11,16 +11,10 @@ layout(binding = 0, std140) uniform SceneUniform {
|
||||
uint frameId;
|
||||
};
|
||||
|
||||
struct State {
|
||||
uint biomeTintMsk;
|
||||
struct BlockModel {
|
||||
uint faceColours[6];
|
||||
};
|
||||
|
||||
struct Biome {
|
||||
uint foliage;
|
||||
uint water;
|
||||
};
|
||||
|
||||
struct SectionMeta {
|
||||
uvec4 header;
|
||||
uvec4 drawdata;
|
||||
@@ -57,15 +51,11 @@ layout(binding = 4, std430) VISIBILITY_ACCESS restrict buffer VisibilityBuffer {
|
||||
uint visibilityData[];
|
||||
};
|
||||
|
||||
layout(binding = 5, std430) readonly restrict buffer StateBuffer {
|
||||
State stateData[];
|
||||
layout(binding = 5, std430) readonly restrict buffer ModelBuffer {
|
||||
BlockModel modelData[];
|
||||
};
|
||||
|
||||
layout(binding = 6, std430) readonly restrict buffer BiomeBuffer {
|
||||
Biome biomeData[];
|
||||
};
|
||||
|
||||
layout(binding = 7, std430) readonly restrict buffer LightingBuffer {
|
||||
layout(binding = 6, std430) readonly restrict buffer LightingBuffer {
|
||||
uint lightData[];
|
||||
};
|
||||
|
||||
|
||||
@@ -63,20 +63,11 @@ void main() {
|
||||
|
||||
uint stateId = extractStateId(quad);
|
||||
uint biomeId = extractBiomeId(quad);
|
||||
State stateInfo = stateData[stateId];
|
||||
BlockModel stateInfo = modelData[stateId];
|
||||
colour = uint2vec4RGBA(stateInfo.faceColours[face]);
|
||||
|
||||
colour *= getLighting(extractLightId(quad));
|
||||
|
||||
if (((stateInfo.biomeTintMsk>>face)&1) == 1) {
|
||||
vec4 biomeColour = uint2vec4RGBA(biomeData[biomeId].foliage);
|
||||
colour *= biomeColour;
|
||||
}
|
||||
//Apply water tint
|
||||
if (((stateInfo.biomeTintMsk>>6)&1) == 1) {
|
||||
colour *= vec4(0.247, 0.463, 0.894, 1);
|
||||
}
|
||||
|
||||
//Apply face tint
|
||||
if (face == 0) {
|
||||
colour.xyz *= vec3(0.75, 0.75, 0.75);
|
||||
|
||||
Reference in New Issue
Block a user