Texture Packs Other Packs

HAL Lighting Vanilla Shader

  • 1.1k views 2 today
  • save_alt 235 downloads
Game Version
Minecraft 1.21.11
Resolution
16x
Progress
100% complete
Changes include
  • Art
  • Environment
  • Misc
  • Mobs
  • Particles
  • Terrain
  • 18
  • 15
  • 2
SilentPaltos
Lvl 44Master Demolitionist
33

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 example 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

1 Update Logs

Update #1 : by SilentPaltos 01/07/2026 3:15:06 amJanuary 7 @ 8:15 am UTC

Now you can blend colors! And structure is much better I think

More like this

  Have something to say?

Hightechik
01/06/2026 1:53 pm
He/Him • Level 23 : Expert Procrastinator
палтос, поставь этот скрин на превью, он больше заинтересовывает кликнуть2025-12-31_00 21 30
2
SilentPaltos
01/06/2026 11:15 pm
She/They • Level 44 : Master Demolitionist
Сейчас сделаю
1

Welcome