diff --git a/shaders/include/light/handheld_lighting.glsl b/shaders/include/light/handheld_lighting.glsl index 01af83cf..bc1f47f1 100644 --- a/shaders/include/light/handheld_lighting.glsl +++ b/shaders/include/light/handheld_lighting.glsl @@ -20,11 +20,23 @@ vec3 get_handheld_light_color(int held_item_id, int held_item_light_value) { bool is_custom = 10064 <= held_item_id && held_item_id < 10300; bool is_candle = 10264 <= held_item_id && held_item_id < 10280; + // Handle lapis and emerald block light + #ifndef EMERALD_BLOCK_LIGHT + is_emitter = is_emitter && held_item_id!= 10059; + #endif + #ifndef LAPIS_BLOCK_LIGHT + is_emitter = is_emitter && held_item_id!= 10060; + #endif + if (is_emitter) { return texelFetch(light_data_sampler, ivec2(int(held_item_id) - 10032, 0), 0).rgb; } else if(is_custom) { if(is_candle) { - return texelFetch(light_data_sampler, ivec2(int(held_item_id) - 10264, 1), 0).rgb * 8.0; + #ifdef COLORED_CANDLE_LIGHTS + return texelFetch(light_data_sampler, ivec2(int(held_item_id) - 10264, 1), 0).rgb; + #else + return (blocklight_color * blocklight_scale * rcp(15.0)) * 8.0; + #endif } else { return texelFetch(light_data_sampler, ivec2(int(held_item_id) - 10032, 0), 0).rgb; } diff --git a/shaders/include/light/lpv/floodfill.glsl b/shaders/include/light/lpv/floodfill.glsl index 4a862a96..eed502a2 100644 --- a/shaders/include/light/lpv/floodfill.glsl +++ b/shaders/include/light/lpv/floodfill.glsl @@ -5,7 +5,17 @@ #include "/include/light/lpv/light_colors.glsl" bool is_emitter(uint block_id) { - return 32u <= block_id && block_id < 64u; + bool isInRange = 32u <= block_id && block_id < 64u; + + // Handle lapis and emerald block light + #ifndef LAPIS_BLOCK_LIGHT + isInRange = isInRange && block_id != 60u; + #endif + #ifndef EMERALD_BLOCK_LIGHT + isInRange = isInRange && block_id != 59u; + #endif + + return isInRange; } bool is_translucent(uint block_id) { @@ -37,7 +47,12 @@ vec3 get_emitted_light(uint block_id) { block_id -= 264u; uint level = uint(floor(float(block_id) / 16.0)); float intensity = get_candle_intensity(level); - return tint_color[block_id - level * 16u] * intensity; + + #ifdef COLORED_CANDLE_LIGHTS + return tint_color[block_id - level * 16u] * intensity; + #else + return light_color[18u] / 8.0 * intensity; + #endif } else { return vec3(0.0); } diff --git a/shaders/include/misc/material.glsl b/shaders/include/misc/material.glsl index c75df960..d4ca1ade 100644 --- a/shaders/include/misc/material.glsl +++ b/shaders/include/misc/material.glsl @@ -600,8 +600,10 @@ Material material_from(vec3 albedo_srgb, uint material_mask, vec3 world_pos, vec #endif } else { // 59 #ifdef HARDCODED_EMISSION - // Emerald block - material.emission = 0.1 * albedo_sqrt; + #if defined(EMERALD_BLOCK_LIGHT) + // Emerald block + material.emission = 0.1 * albedo_sqrt; + #endif #endif } } @@ -609,8 +611,10 @@ Material material_from(vec3 albedo_srgb, uint material_mask, vec3 world_pos, vec if (material_mask < 62u) { // 60-62 if (material_mask == 60u) { // 60 #ifdef HARDCODED_EMISSION - // Lapis block - material.emission = 0.33 * albedo_sqrt; + #if defined(LAPIS_BLOCK_LIGHT) + // Lapis block + material.emission = 0.33 * albedo_sqrt; + #endif #endif } else { // 61 diff --git a/shaders/lang/en_US.lang b/shaders/lang/en_US.lang index e1839cef..0368dc89 100644 --- a/shaders/lang/en_US.lang +++ b/shaders/lang/en_US.lang @@ -248,6 +248,12 @@ option.VOXEL_VOLUME_SIZE = Voxel Volume Size option.VOXEL_VOLUME_SIZE.comment = High performance impact, also affected by shadow distance suffix.VOXEL_VOLUME_SIZE = m option.COLORED_LIGHT_I = Colored Light Intensity +option.COLORED_CANDLE_LIGHTS = Colored Candle Lights +option.COLORED_CANDLE_LIGHTS.comment = Use candle color as the light color for the candles +option.LAPIS_BLOCK_LIGHT = Lapis Blocks emit Light +option.LAPIS_BLOCK_LIGHT.comment = Emit light from the lapis block. Requires Hardcoded Emission to be enabled +option.EMERALD_BLOCK_LIGHT = Emerald Blocks emit Light +option.EMERALD_BLOCK_LIGHT.comment = Emit light from the emerald block. Requires Hardcoded Emission to be enabled suffix.shadowMapResolution = ² suffix.sunPathRotation = ° diff --git a/shaders/settings.glsl b/shaders/settings.glsl index 4fc713e2..14aa6206 100644 --- a/shaders/settings.glsl +++ b/shaders/settings.glsl @@ -145,6 +145,9 @@ const float wetnessHalflife = 70.0; #define VOXEL_VOLUME_SIZE 128 // [64 128 256 512] #define COLORED_LIGHT_I 1.00 // [0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.20 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.30 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.40 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.50 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.60 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.70 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.80 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.90 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.00 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.20 1.21 1.22 1.23 1.24 1.25 1.26 1.27 1.28 1.29 1.30 1.31 1.32 1.33 1.34 1.35 1.36 1.37 1.38 1.39 1.40 1.41 1.42 1.43 1.44 1.45 1.46 1.47 1.48 1.49 1.50 1.51 1.52 1.53 1.54 1.55 1.56 1.57 1.58 1.59 1.60 1.61 1.62 1.63 1.64 1.65 1.66 1.67 1.68 1.69 1.70 1.71 1.72 1.73 1.74 1.75 1.76 1.77 1.78 1.79 1.80 1.81 1.82 1.83 1.84 1.85 1.86 1.87 1.88 1.89 1.90 1.91 1.92 1.93 1.94 1.95 1.96 1.97 1.98 1.99 2.00 2.00 2.25 2.50 2.75 3.00 3.50 4.00 4.50 5.00 6.00 7.00 8.00 9.00 10.00 12.50 15.00 17.50 20.00 25.00 30.00 40.00 50.00 75.00 100.00 150.00 200.00 250.00 500.00 1000.00 2000.00 5000.00 10000.00] + #define COLORED_CANDLE_LIGHTS + #define LAPIS_BLOCK_LIGHT + #define EMERALD_BLOCK_LIGHT // ------- // Sky diff --git a/shaders/shaders.properties b/shaders/shaders.properties index c7561a33..acd0fbc7 100644 --- a/shaders/shaders.properties +++ b/shaders/shaders.properties @@ -17,7 +17,7 @@ screen.post = [color_grading] [exposure] BLOOM BLOOM_INTENSITY DOF [dof_ screen.misc = DEBUG_VIEW DEBUG_SAMPLER WHITE_WORLD FANCY_NETHER_PORTAL CUSTOM_SKY CUSTOM_SKY_BRIGHTNESS TONEMAP_COMPARISON TONEMAP_PLOT tonemap_left tonemap_right [box] [compatibility] screen.box = BOX_MODE BOX_LINE_WIDTH BOX_COLOR_R BOX_COLOR_G BOX_COLOR_B BOX_EMISSION -screen.colored_lights = COLORED_LIGHTS_VANILLA_LIGHTMAP_CONTRIBUTION VOXEL_VOLUME_SIZE COLORED_LIGHT_I +screen.colored_lights = COLORED_LIGHTS_VANILLA_LIGHTMAP_CONTRIBUTION VOXEL_VOLUME_SIZE COLORED_LIGHT_I COLORED_CANDLE_LIGHTS LAPIS_BLOCK_LIGHT EMERALD_BLOCK_LIGHT screen.weather = WEATHER_DAY [weather_d0] [weather_d1] [weather_d2] [weather_d3] [weather_d4] [weather_d5] [weather_d6] [weather_d7] [weather_d8] [weather_d9] [weather_d10] [weather_d11] screen.aurora = AURORA_TYPE [aurora_color] AURORA_NORMAL AURORA_SNOW AURORA_BRIGHTNESS AURORA_BRIGHTNESS_SNOW AURORA_FREQUENCY AURORA_FREQUENCY_SNOW AURORA_SPEED AURORA_SPEED_SNOW AURORA_CLOUD_LIGHTING AURORA_GROUND_LIGHTING screen.clouds = CLOUDS_TEMPORAL_UPSCALING CLOUDS_DAILY_WEATHER CLOUDS_ACCUMULATION_LIMIT CLOUDS_SCALE CLOUDS_AERIAL_PERSPECTIVE_BOOST CLOUDS_CUMULUS [clouds_cumulus] CLOUDS_ALTOCUMULUS [clouds_altocumulus] CLOUDS_CUMULUS_CONGESTUS [clouds_cumulus_congestus] CLOUDS_CUMULONIMBUS [clouds_cumulonimbus] CLOUDS_CIRRUS [clouds_cirrus] BLOCKY_CLOUDS [clouds_minecrafty]