Skip to content

Instantly share code, notes, and snippets.

@rikumi
Last active May 28, 2023 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rikumi/bf78117afdcae492ca327e0978b3303b to your computer and use it in GitHub Desktop.
Save rikumi/bf78117afdcae492ca327e0978b3303b to your computer and use it in GitHub Desktop.
Light Overlay for BSL Shaders

This is a simple light overlay patch for BSL Shaders ported from Complementary Shaders.

View Screenshot

Usage

  1. Unzip BSL Shaders
  2. Copy the file showLightLevels.glsl to shaders/lib/util/
  3. Open shaders/program/gbuffers_terrain.glsl, add following line before GetLighting(...) and save:
    #include "/lib/util/showLightLevels.glsl"
    
  4. Compress the extracted folder shaders again. Make sure the folder it self is first level inside the zip file, not its contents.
if (NoU > 0.99) {
#ifdef OVERWORLD
float lxMin = 0.000001;
#else
float lxMin = 0.8;
#endif
if (lmCoord.x < lxMin) {
vec2 indicatePos = worldPos.xz + cameraPosition.xz;
indicatePos = 1.0 - 2.0 * abs(fract(indicatePos) - 0.5);
float minPos = min(indicatePos.x, indicatePos.y);
if (minPos > 0.5) {
albedo.rgb *= vec3(0.3, 0.3, 0.05);
emission = 3.0;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment