mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-01-04 00:23:41 +08:00
floodfill stained glass tinting
This commit is contained in:
parent
28a51779a0
commit
6ec7e0187e
@ -64,10 +64,28 @@
|
|||||||
block.1101 = conquest:white_paper_lantern conquest:yellow_paper_lantern conquest:small_red_paper_lantern conquest:chinese_palace_lantern conquest:campfire conquest:brazier conquest:hanging_brazier conquest:chandelier conquest:candelabra conquest:cross_chandelier conquest:iron_candelabrum_1 conquest:golden_candelabrum_1 conquest:candle conquest:hanging_candle_holder conquest:candle_in_a_lantern conquest:candles conquest:hand_candle conquest:torch_with_grille conquest:elven_hand_light conquest:ship_lantern conquest:victorian_lantern conquest:small_lantern conquest:big_lantern conquest:hanging_oil_lamp conquest:oil_lamp conquest:terracotta_oil_lamp conquest:invisible_light_low conquest:invisible_light_medium conquest:invisible_light
|
block.1101 = conquest:white_paper_lantern conquest:yellow_paper_lantern conquest:small_red_paper_lantern conquest:chinese_palace_lantern conquest:campfire conquest:brazier conquest:hanging_brazier conquest:chandelier conquest:candelabra conquest:cross_chandelier conquest:iron_candelabrum_1 conquest:golden_candelabrum_1 conquest:candle conquest:hanging_candle_holder conquest:candle_in_a_lantern conquest:candles conquest:hand_candle conquest:torch_with_grille conquest:elven_hand_light conquest:ship_lantern conquest:victorian_lantern conquest:small_lantern conquest:big_lantern conquest:hanging_oil_lamp conquest:oil_lamp conquest:terracotta_oil_lamp conquest:invisible_light_low conquest:invisible_light_medium conquest:invisible_light
|
||||||
|
|
||||||
####### ----- reflective translucents / glass ----- #######
|
####### ----- reflective translucents / glass ----- #######
|
||||||
# block.10002 = minecraft:slime_block minecraft:nether_portal minecraft:honey_block ice minecraft:frosted_ice minecraft:black_stained_glass minecraft:black_stained_glass_pane minecraft:blue_stained_glass minecraft:blue_stained_glass_pane minecraft:brown_stained_glass minecraft:brown_stained_glass_pane minecraft:cyan_stained_glass minecraft:cyan_stained_glass_pane minecraft:gray_stained_glass minecraft:gray_stained_glass_pane minecraft:green_stained_glass minecraft:green_stained_glass_pane minecraft:light_blue_stained_glass minecraft:light_blue_stained_glass_pane minecraft:light_gray_stained_glass minecraft:light_gray_stained_glass_pane minecraft:lime_stained_glass minecraft:lime_stained_glass_pane minecraft:magenta_stained_glass minecraft:magenta_stained_glass_pane minecraft:orange_stained_glass minecraft:orange_stained_glass_pane minecraft:pink_stained_glass minecraft:pink_stained_glass_pane minecraft:purple_stained_glass minecraft:purple_stained_glass_pane minecraft:red_stained_glass minecraft:red_stained_glass_pane minecraft:white_stained_glass minecraft:white_stained_glass_pane minecraft:yellow_stained_glass minecraft:yellow_stained_glass_pane minecraft:glass_pane minecraft:glass
|
block.1201 = glass glass_pane
|
||||||
block.10002 = minecraft:slime_block minecraft:honey_block ice minecraft:frosted_ice minecraft:black_stained_glass minecraft:black_stained_glass_pane minecraft:blue_stained_glass minecraft:blue_stained_glass_pane minecraft:brown_stained_glass minecraft:brown_stained_glass_pane minecraft:cyan_stained_glass minecraft:cyan_stained_glass_pane minecraft:gray_stained_glass minecraft:gray_stained_glass_pane minecraft:green_stained_glass minecraft:green_stained_glass_pane minecraft:light_blue_stained_glass minecraft:light_blue_stained_glass_pane minecraft:light_gray_stained_glass minecraft:light_gray_stained_glass_pane minecraft:lime_stained_glass minecraft:lime_stained_glass_pane minecraft:magenta_stained_glass minecraft:magenta_stained_glass_pane minecraft:orange_stained_glass minecraft:orange_stained_glass_pane minecraft:pink_stained_glass minecraft:pink_stained_glass_pane minecraft:purple_stained_glass minecraft:purple_stained_glass_pane minecraft:red_stained_glass minecraft:red_stained_glass_pane minecraft:white_stained_glass minecraft:white_stained_glass_pane minecraft:yellow_stained_glass minecraft:yellow_stained_glass_pane minecraft:glass_pane minecraft:glass
|
block.1202 = honey_block
|
||||||
|
block.1203 = ice frosted_ice
|
||||||
|
block.1204 = nether_portal
|
||||||
|
block.1205 = slime_block
|
||||||
|
|
||||||
block.1200 = nether_portal
|
block.1220 = black_stained_glass black_stained_glass_pane
|
||||||
|
block.1221 = blue_stained_glass blue_stained_glass_pane
|
||||||
|
block.1222 = brown_stained_glass brown_stained_glass_pane
|
||||||
|
block.1223 = cyan_stained_glass cyan_stained_glass_pane
|
||||||
|
block.1224 = gray_stained_glass gray_stained_glass_pane
|
||||||
|
block.1225 = green_stained_glass green_stained_glass_pane
|
||||||
|
block.1226 = light_blue_stained_glass light_blue_stained_glass_pane
|
||||||
|
block.1227 = light_gray_stained_glass light_gray_stained_glass_pane
|
||||||
|
block.1228 = lime_stained_glass lime_stained_glass_pane
|
||||||
|
block.1229 = magenta_stained_glass magenta_stained_glass_pane
|
||||||
|
block.1230 = orange_stained_glass orange_stained_glass_pane
|
||||||
|
block.1231 = pink_stained_glass pink_stained_glass_pane
|
||||||
|
block.1232 = purple_stained_glass purple_stained_glass_pane
|
||||||
|
block.1233 = red_stained_glass red_stained_glass_pane
|
||||||
|
block.1234 = white_stained_glass white_stained_glass_pane
|
||||||
|
block.1235 = yellow_stained_glass yellow_stained_glass_pane
|
||||||
|
|
||||||
####### ----- misc ----- #######
|
####### ----- misc ----- #######
|
||||||
## all blocks here get exluded from POM.
|
## all blocks here get exluded from POM.
|
||||||
|
@ -30,4 +30,25 @@
|
|||||||
#define BLOCK_SOUL_TORCH 1028
|
#define BLOCK_SOUL_TORCH 1028
|
||||||
#define BLOCK_TORCH 1029
|
#define BLOCK_TORCH 1029
|
||||||
|
|
||||||
#define BLOCK_NETHER_PORTAL 1200
|
#define BLOCK_GLASS 1201
|
||||||
|
#define BLOCK_HONEY 1202
|
||||||
|
#define BLOCK_ICE 1203
|
||||||
|
#define BLOCK_NETHER_PORTAL 1204
|
||||||
|
#define BLOCK_SLIME 1205
|
||||||
|
|
||||||
|
#define BLOCK_GLASS_BLACK 1220
|
||||||
|
#define BLOCK_GLASS_BLUE 1221
|
||||||
|
#define BLOCK_GLASS_BROWN 1222
|
||||||
|
#define BLOCK_GLASS_CYAN 1223
|
||||||
|
#define BLOCK_GLASS_GRAY 1224
|
||||||
|
#define BLOCK_GLASS_GREEN 1225
|
||||||
|
#define BLOCK_GLASS_LIGHT_BLUE 1226
|
||||||
|
#define BLOCK_GLASS_LIGHT_GRAY 1227
|
||||||
|
#define BLOCK_GLASS_LIME 1228
|
||||||
|
#define BLOCK_GLASS_MAGENTA 1229
|
||||||
|
#define BLOCK_GLASS_ORANGE 1230
|
||||||
|
#define BLOCK_GLASS_PINK 1231
|
||||||
|
#define BLOCK_GLASS_PURPLE 1232
|
||||||
|
#define BLOCK_GLASS_RED 1233
|
||||||
|
#define BLOCK_GLASS_WHITE 1234
|
||||||
|
#define BLOCK_GLASS_YELLOW 1235
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
struct LpvBlockData { // 8 x1280 =?
|
struct LpvBlockData { // 12 x1280 =?
|
||||||
uint MaskWeight; // 4
|
uint MaskWeight; // 4
|
||||||
uint ColorRange; // 4
|
uint ColorRange; // 4
|
||||||
|
uint Tint; // 4
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef RENDER_SETUP
|
#ifdef RENDER_SETUP
|
||||||
|
@ -617,7 +617,7 @@ uniform.float.shadowMaxProj = 150.0/abs(sunPosY)
|
|||||||
|
|
||||||
# if defined LPV_ENABLED && defined IRIS_FEATURE_CUSTOM_IMAGES
|
# if defined LPV_ENABLED && defined IRIS_FEATURE_CUSTOM_IMAGES
|
||||||
#ifdef LPV_ENABLED
|
#ifdef LPV_ENABLED
|
||||||
bufferObject.0=20480
|
bufferObject.0=204800
|
||||||
|
|
||||||
#if LPV_SIZE == 8
|
#if LPV_SIZE == 8
|
||||||
image.imgVoxelMask = none RED_INTEGER R16UI UNSIGNED_SHORT true false 256 256 256
|
image.imgVoxelMask = none RED_INTEGER R16UI UNSIGNED_SHORT true false 256 256 256
|
||||||
|
@ -25,6 +25,7 @@ void main() {
|
|||||||
float lightRange = 0.0;
|
float lightRange = 0.0;
|
||||||
float mixWeight = 0.0;
|
float mixWeight = 0.0;
|
||||||
uint mixMask = 0xFFFF;
|
uint mixMask = 0xFFFF;
|
||||||
|
vec3 tintColor = vec3(1.0);
|
||||||
|
|
||||||
switch (blockId) {
|
switch (blockId) {
|
||||||
case BLOCK_BEACON:
|
case BLOCK_BEACON:
|
||||||
@ -139,15 +140,90 @@ void main() {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
case BLOCK_HONEY:
|
||||||
|
tintColor = vec3(0.984, 0.733, 0.251);
|
||||||
|
mixWeight = 1.0;
|
||||||
|
break;
|
||||||
case BLOCK_NETHER_PORTAL:
|
case BLOCK_NETHER_PORTAL:
|
||||||
lightColor = vec3(0.502, 0.165, 0.831);
|
lightColor = vec3(0.502, 0.165, 0.831);
|
||||||
|
tintColor = vec3(0.502, 0.165, 0.831);
|
||||||
lightRange = 11.0;
|
lightRange = 11.0;
|
||||||
|
mixWeight = 1.0;
|
||||||
|
break;
|
||||||
|
case BLOCK_SLIME:
|
||||||
|
tintColor = vec3(0.408, 0.725, 0.329);
|
||||||
|
mixWeight = 1.0;
|
||||||
|
break;
|
||||||
|
case BLOCK_GLASS_BLACK:
|
||||||
|
tintColor = vec3(0.3);
|
||||||
|
mixWeight = 1.0;
|
||||||
|
break;
|
||||||
|
case BLOCK_GLASS_BLUE:
|
||||||
|
tintColor = vec3(0.1, 0.1, 0.98);
|
||||||
|
mixWeight = 1.0;
|
||||||
|
break;
|
||||||
|
case BLOCK_GLASS_BROWN:
|
||||||
|
tintColor = vec3(0.566, 0.388, 0.148);
|
||||||
|
mixWeight = 1.0;
|
||||||
|
break;
|
||||||
|
case BLOCK_GLASS_CYAN:
|
||||||
|
tintColor = vec3(0.082, 0.533, 0.763);
|
||||||
|
mixWeight = 1.0;
|
||||||
|
break;
|
||||||
|
case BLOCK_GLASS_GRAY:
|
||||||
|
tintColor = vec3(0.4, 0.4, 0.4);
|
||||||
|
mixWeight = 1.0;
|
||||||
|
break;
|
||||||
|
case BLOCK_GLASS_GREEN:
|
||||||
|
tintColor = vec3(0.125, 0.808, 0.081);
|
||||||
|
mixWeight = 1.0;
|
||||||
|
break;
|
||||||
|
case BLOCK_GLASS_LIGHT_BLUE:
|
||||||
|
tintColor = vec3(0.320, 0.685, 0.955);
|
||||||
|
mixWeight = 1.0;
|
||||||
|
break;
|
||||||
|
case BLOCK_GLASS_LIGHT_GRAY:
|
||||||
|
tintColor = vec3(0.7);
|
||||||
|
mixWeight = 1.0;
|
||||||
|
break;
|
||||||
|
case BLOCK_GLASS_LIME:
|
||||||
|
tintColor = vec3(0.633, 0.924, 0.124);
|
||||||
|
mixWeight = 1.0;
|
||||||
|
break;
|
||||||
|
case BLOCK_GLASS_MAGENTA:
|
||||||
|
tintColor = vec3(0.698, 0.298, 0.847);
|
||||||
|
mixWeight = 1.0;
|
||||||
|
break;
|
||||||
|
case BLOCK_GLASS_ORANGE:
|
||||||
|
tintColor = vec3(0.919, 0.586, 0.185);
|
||||||
|
mixWeight = 1.0;
|
||||||
|
break;
|
||||||
|
case BLOCK_GLASS_PINK:
|
||||||
|
tintColor = vec3(0.949, 0.274, 0.497);
|
||||||
|
mixWeight = 1.0;
|
||||||
|
break;
|
||||||
|
case BLOCK_GLASS_PURPLE:
|
||||||
|
tintColor = vec3(0.578, 0.170, 0.904);
|
||||||
|
mixWeight = 1.0;
|
||||||
|
break;
|
||||||
|
case BLOCK_GLASS_RED:
|
||||||
|
tintColor = vec3(0.999, 0.188, 0.188);
|
||||||
|
mixWeight = 1.0;
|
||||||
|
break;
|
||||||
|
case BLOCK_GLASS_WHITE:
|
||||||
|
tintColor = vec3(0.96, 0.96, 0.96);
|
||||||
|
mixWeight = 1.0;
|
||||||
|
break;
|
||||||
|
case BLOCK_GLASS_YELLOW:
|
||||||
|
tintColor = vec3(0.965, 0.965, 0.123);
|
||||||
|
mixWeight = 1.0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
LpvBlockData block;
|
LpvBlockData block;
|
||||||
block.ColorRange = packUnorm4x8(vec4(lightColor, lightRange/255.0));
|
block.ColorRange = packUnorm4x8(vec4(lightColor, lightRange/255.0));
|
||||||
block.MaskWeight = BuildBlockLpvData(mixMask, mixWeight);
|
block.MaskWeight = BuildBlockLpvData(mixMask, mixWeight);
|
||||||
|
block.Tint = packUnorm4x8(vec4(tintColor, 0.0));
|
||||||
LpvBlockMap[blockId - LpvBlockMapOffset] = block;
|
LpvBlockMap[blockId - LpvBlockMapOffset] = block;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -121,43 +121,35 @@ void main() {
|
|||||||
if (any(greaterThanEqual(chunkPos, LpvSize3))) return;
|
if (any(greaterThanEqual(chunkPos, LpvSize3))) return;
|
||||||
|
|
||||||
PopulateShared();
|
PopulateShared();
|
||||||
|
|
||||||
barrier();
|
barrier();
|
||||||
|
|
||||||
ivec3 imgCoord = ivec3(gl_GlobalInvocationID);
|
ivec3 imgCoord = ivec3(gl_GlobalInvocationID);
|
||||||
if (any(greaterThanEqual(imgCoord, LpvSize3))) return;
|
if (any(greaterThanEqual(imgCoord, LpvSize3))) return;
|
||||||
|
|
||||||
// vec3 viewDir = gbufferModelViewInverse[2].xyz;
|
|
||||||
//vec3 lpvCenter = vec3(0.0);//GetLpvCenter(cameraPosition, viewDir);
|
|
||||||
//vec3 blockLocalPos = imgCoord - lpvCenter + 0.5;
|
|
||||||
|
|
||||||
vec4 lightValue = vec4(0.0);
|
vec4 lightValue = vec4(0.0);
|
||||||
uint mixMask = 0xFFFF;
|
uint mixMask = 0xFFFF;
|
||||||
vec3 tint = vec3(1.0);
|
|
||||||
|
|
||||||
uint blockId = voxelSharedData[getSharedCoord(ivec3(gl_LocalInvocationID) + 1)];
|
uint blockId = voxelSharedData[getSharedCoord(ivec3(gl_LocalInvocationID) + 1)];
|
||||||
float mixWeight = blockId == BLOCK_EMPTY ? 1.0 : 0.0;
|
float mixWeight = blockId == BLOCK_EMPTY ? 1.0 : 0.0;
|
||||||
|
vec3 tintColor = vec3(1.0);
|
||||||
|
|
||||||
if (blockId > 0 && blockId != BLOCK_EMPTY)
|
if (blockId > 0u) {//&& blockId != BLOCK_EMPTY)
|
||||||
ParseBlockLpvData(LpvBlockMap[blockId - LpvBlockMapOffset].MaskWeight, mixMask, mixWeight);
|
ParseBlockLpvData(LpvBlockMap[blockId - LpvBlockMapOffset].MaskWeight, mixMask, mixWeight);
|
||||||
|
|
||||||
#ifdef LPV_GLASS_TINT
|
uint tintData = LpvBlockMap[blockId - LpvBlockMapOffset].Tint;
|
||||||
if (blockId >= BLOCK_HONEY && blockId <= BLOCK_TINTED_GLASS) {
|
tintColor = unpackUnorm4x8(tintData).rgb;
|
||||||
tint = GetLightGlassTint(blockId);
|
|
||||||
mixWeight = 1.0;
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (mixWeight > EPSILON) {
|
if (mixWeight > EPSILON) {
|
||||||
vec4 lightMixed = mixNeighbours(ivec3(gl_LocalInvocationID), mixMask);
|
vec4 lightMixed = mixNeighbours(ivec3(gl_LocalInvocationID), mixMask);
|
||||||
lightMixed.rgb *= mixWeight * tint;
|
lightMixed.rgb *= RGBToLinear(tintColor) * mixWeight;
|
||||||
lightValue += lightMixed;
|
lightValue += lightMixed;
|
||||||
}
|
}
|
||||||
|
|
||||||
lightValue.rgb = RgbToHsv(lightValue.rgb);
|
lightValue.rgb = RgbToHsv(lightValue.rgb);
|
||||||
lightValue.ba = log2(lightValue.ba + 1.0) / LpvBlockSkyRange;
|
lightValue.ba = log2(lightValue.ba + 1.0) / LpvBlockSkyRange;
|
||||||
|
|
||||||
if (blockId > 0 && blockId != BLOCK_EMPTY) {
|
if (blockId > 0u) {// && blockId != BLOCK_EMPTY) {
|
||||||
vec4 lightColorRange = unpackUnorm4x8(LpvBlockMap[blockId - LpvBlockMapOffset].ColorRange);
|
vec4 lightColorRange = unpackUnorm4x8(LpvBlockMap[blockId - LpvBlockMapOffset].ColorRange);
|
||||||
float lightRange = lightColorRange.a * 255.0;
|
float lightRange = lightColorRange.a * 255.0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user