Compatibility
Minecraft: Java Edition
Links
Creators
Details
Minecraft-HAL-Lighting-VanillaShader
I don't remember why it is named HAL..
I created it as a tool for making lighting on maps
Minecraft 26.1 Snapshot 1
Incompatible with Sodium!
Video: https://youtu.be/WDjhtDT9G6Y
It might be not perfect but I just wanted to create some lighting system using minecraft vanilla shaders. Just for fun.
It affects blocks, entities and particles, but it is still unfinished since not all object are affected by this system. And there is a lot of things that can be done to improve this shader. Probably I'll fix all of it.
Here is some screenshots from the developing process:
This shader allow you to create areas that filled with light
It has next files:
hal_config.glsl- some values to configurehal_list.glsl- list of areas that will be filled with lighthal_modes.glsl- blend modes for lightinghal_shapes.glsl- shapes of areas in which light "spreads"hal.glsl- main file for lighting.
Mainly you need only hal_list.glsl and hal_config.glsl
in hal_config.glsl you only need these lines:
#define AREA_LIGHTS_COUNT 100
#define LIGHT_RENDER_DISTANCE -1
#define FIX_OUT_OF_BOUNDS_MIX true
AREA_LIGHTS_COUNT- defines how many light areas you can store in the shaderLIGHT_RENDER_DISTANCE- defines how far light rendersFIX_OUT_OF_BOUNDS_MIX- I don't remember why exactly I needed to add this but probably it's important
Talking about creating lights...
You can create them in the hal_list.glsl
There is some examples how you can create them
// default way to create
area_light[0] = arealight(
vec4( 1.0, 0.0, 0.0, 0.0 ), vec4( 0.0, 0.0, 0.0, 0.0 ),
vec3( 0.5, 0.0, 0.0 ), LIGHT_MODE_ADD,
vec3( -247, -44, 14 ), vec3( 5.0, 0.0, 0.0 ),
LIGHT_SHAPE_CUBOID, vec3( 5.5, 5.5, 5.5 )
);
// using variables
arealight CHECKPOINT_DEFAULT = arealight(
vec4( 0.4, 0.6, 1.0, 0.0 ) * 1.1, vec4( 0.0, 0.0, 0.0, 0.0 ),
vec3( 1.0, 0.25, 1.0 ), LIGHT_MODE_ADD,
vec3( 0, 0, 0 ), vec3( 0.0, 1.5, 0.0 ),
LIGHT_SHAPE_CUBOID, vec3( 1.5, 1.5, 1.5 )
);
area_light[5] = CHECKPOINT_DEFAULT;
area_light[5].pos = vec3( 24.5, -48.5, 9.5 );
// by components
area_light[11].mode = LIGHT_MODE_ADD;
area_light[11].start_color = vec4( 1.0, 0.7, 0.1, 0.0 ) * 0.8;
area_light[11].end_color = vec4( 0.0, 0.0, 0.0, 0.0 );
area_light[11].mix_strength = vec3( 0.0, 0.0, 0.8 );
area_light[11].shape = LIGHT_SHAPE_CUBOID;
area_light[11].pos = vec3( -3.5, -49.0, 16.0 );
area_light[11].shape_parameter = vec3( 1.0, 1.0, 1.9 );
area_light[11].offset = vec3( 0.0, 1.0, 0.0 );
As you can see every light source(if it can be called that way) has 8 parameters
start_color(vec4, rgba) - start_color of the lightend_color(vec4, rgba) - end_color of the lightmix_strngth(vec3, xyz) - how color blends between start and end colors in each axismode(int) - how color applies to verticiespos(vec3, xyz) - center position of the light areaoffset(vec3, xyz) - offset off the light starting point from the area centershape(int) - shape of the areashape_parameter(vec3, xyz) - light "spread" distance in each axis (both positive and negative direction)
More screenshots:



