NOTICE: Arc Shader Indirect Lighting (SSGI) Technique - Concept Port
========================================================================

This file documents concepts ported from Arc shader's screen-space
indirect lighting (SSGI) into Unbound Visual + PT v9.9's existing Visibility
Bitmask SSGI (program/deferred1.glsl, GetScreenSpaceGI()).

SOURCE PACK:
  Arc [shader] v0.15.2
  By null511 (https://github.com/null511/MC-Arc-Shader)
  Relevant source file referenced:
    program/deferred4.fsh (function: GetSpiralOcclusion)

PORTED BY:
  Ported into Unbound Visual + PT v9.9's existing GetScreenSpaceGI() function
  in program/deferred1.glsl. NOT a line-for-line code copy - Arc's SSGI
  runs on a completely different pipeline (deferred passes, render
  targets, and uniforms named BUFFER_DEFERRED/BUFFER_HDR_PREVIOUS/
  IRIS_FEATURE_SSBO etc. that don't exist in this pack), so the pipeline
  itself was NOT copied. Only two specific techniques/ideas were
  translated into Unbound's own Visibility Bitmask GI algorithm
  (O. Therrien, Y. Levesque, G. Gilet, 2023 - see the existing comment
  block above GetScreenSpaceGI() for that paper's own attribution,
  unrelated to Arc):

WHAT WAS PORTED (as concepts, re-implemented for this pipeline):
  - Luminance-normalized "chroma bounce": Arc divides each sampled
    bounce color by its own luminance + 1.0 before accumulating
    (GetSpiralOcclusion: "sampleColor /= luminance(sampleColor) + 1.0").
    This strips out how BRIGHT the sampled surface is while keeping its
    hue/chroma, so a very bright lit surface doesn't linearly blow out
    the bounce with raw brightness, but its color still visibly tints
    nearby surfaces.
    CALIBRATION FIX: applying Arc's exact "/(luminance + 1.0)" divisor
    verbatim to Unbound's GetScreenSpaceGI() turned out to be miscalibrated
    for this pipeline and killed almost all normal-brightness color bounce
    (confirmed visually - a saturated rainbow-striped wall right next to a
    neutral ceiling/wall produced NO visible color bleed at all). Arc's
    source buffer is routinely far above 1.0 (full HDR pre-tonemap), so
    "+1.0" only meaningfully affects its brightest samples; Unbound's
    colortex0 direct-lit color for ordinary colored blocks under normal/
    shaded light is usually AT OR BELOW 1.0, so the same "+1.0" divided
    nearly every sample roughly in half regardless of brightness. Changed
    to "sampleColor / max(sampleLum, 1.0)" instead - normal-range samples
    (<=1.0) pass through at full strength (same as before the chroma-bounce
    change), only genuinely overbright/HDR samples (>1.0) get divided down.
    This keeps Arc's intent (don't let a blinding light source blow out the
    bounce) without gutting ordinary colored-surface bounce strength.
  - Per-surface bounce-shape variety: Arc's spiral sampler uses a
    per-pixel randomized rotation (interleaved-gradient-noise/hash-based)
    driving its sample offsets, so neighbouring surfaces don't all show
    an identical bounce pattern. Unbound's Visibility Bitmask GI already
    had per-pixel dithered slice rotation; the number of azimuth slices
    (GI_BITMASK_SLICES) was raised from 2 to 3 for richer directional
    variety between surfaces, closer to Arc's visual variety, at a
    moderate extra cost for this pass.

WHAT WAS DELIBERATELY NOT PORTED:
  - Arc's temporal-reprojection scene-color buffer (BUFFER_HDR_PREVIOUS)
    and its full render-target/pass architecture - Unbound's existing
    Visibility Bitmask GI reads the current frame's lit buffer
    (colortex0) directly and has its own temporal/spatial denoiser
    downstream; wiring in a second, parallel history buffer would
    duplicate that system rather than improve it.
  - Arc's separate SSAO computation (AO_TYPE) - Unbound already has its
    own independent AO pipeline, untouched by this port.
  - Bias of bounce toward occluded/shaded areas ("nge-bounce di area
    tertentu") was NOT newly added - Unbound's existing SSGI call site
    already does this (see the "Conservative blend" comment above the
    GetScreenSpaceGI() call in deferred1.glsl: bounce strength is scaled
    by mix(1.0, 0.5, ssao), biasing it toward already-shaded areas).

FILES CHANGED:
  - program/deferred1.glsl (GetScreenSpaceGI(): luminance-normalized
    chroma bounce added; GI_BITMASK_SLICES raised 2 -> 3)

ATTRIBUTION:
  - null511, author of Arc [shader] (https://github.com/null511/MC-Arc-Shader)

LICENSE:
  Arc [shader] is MIT licensed (see its LICENSE file, Copyright (c) 2022
  Minecraft / Shaders), which permits reuse/modification with the
  original copyright and permission notice retained. That notice is
  reproduced below for the ported portion's provenance:

  -----------------------------------------------------------------
  MIT License

  Copyright (c) 2022 Minecraft / Shaders

  Permission is hereby granted, free of charge, to any person obtaining
  a copy of this software and associated documentation files (the
  "Software"), to deal in the Software without restriction, including
  without limitation the rights to use, copy, modify, merge, publish,
  distribute, sublicense, and/or sell copies of the Software, and to
  permit persons to whom the Software is furnished to do so, subject to
  the following conditions:

  The above copyright notice and this permission notice shall be
  included in all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  SOFTWARE.
  -----------------------------------------------------------------
