nineMinecraft is a joke site.
nineMinecraft is in no way affiliated with Modrinth or 9minecraft. (And frankly, who wants to be affiliated with the latter?)

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:
2025-12-30_21 56 08 2025-12-30_15 41 03 2025-12-31_00 42 59 2025-12-30_15 43 17 2026-01-06_17 52 12 2026-01-06_17 59 47 2026-01-06_02 47 52 2026-01-02_22 05 24

This shader allow you to create areas that filled with light
It has next files:

  • hal_config.glsl - some values to configure
  • hal_list.glsl - list of areas that will be filled with light
  • hal_modes.glsl - blend modes for lighting
  • hal_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 shader
  • LIGHT_RENDER_DISTANCE - defines how far light renders
  • FIX_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 light
  • end_color (vec4, rgba) - end_color of the light
  • mix_strngth (vec3, xyz) - how color blends between start and end colors in each axis
  • mode (int) - how color applies to verticies
  • pos (vec3, xyz) - center position of the light area
  • offset (vec3, xyz) - offset off the light starting point from the area center
  • shape (int) - shape of the area
  • shape_parameter (vec3, xyz) - light "spread" distance in each axis (both positive and negative direction)

More screenshots:
2025-12-31_15 18 36 2025-12-31_14 48 50 2025-12-30_21 14 59 2025-12-31_00 21 30 2025-12-30_16 54 55 2025-12-31_15 49 31 2025-12-30_21 34 53 2025-12-30_17 42 23

External resources


Project members

SilentPaltos

Member


Technical information

License
MIT
Project ID