Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colored flood fill lighting #428

Open
wants to merge 76 commits into
base: 1.20
Choose a base branch
from

Commits on Jun 2, 2023

  1. Working light propagation and data storage

    Light removal is still somewhat broken and
    sometimes cause lingering light data
    spiralhalo committed Jun 2, 2023
    Configuration menu
    Copy the full SHA
    59405b7 View commit details
    Browse the repository at this point in the history
  2. Cleanup cruft

    spiralhalo committed Jun 2, 2023
    Configuration menu
    Copy the full SHA
    e890130 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0fdac19 View commit details
    Browse the repository at this point in the history
  4. Perform light replacement in heap

    + Ensure widening cast safety
    spiralhalo committed Jun 2, 2023
    Configuration menu
    Copy the full SHA
    47e53d5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    9582811 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    fa9d2ea View commit details
    Browse the repository at this point in the history
  7. Small improvements

    - Enqueue only occlusion change
    - Compare based on pure light
    - Skip empty queue (don't upload)
    spiralhalo committed Jun 2, 2023
    Configuration menu
    Copy the full SHA
    ee28df8 View commit details
    Browse the repository at this point in the history

Commits on Jun 3, 2023

  1. Prevent propagating in the opposite direction

    Except for light sources which propagate in every direction.
    Bright nodes found while looping through light removal (decrease)
    queue are treated as light sources.
    spiralhalo committed Jun 3, 2023
    Configuration menu
    Copy the full SHA
    0fac619 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2499b0d View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2023

  1. Configuration menu
    Copy the full SHA
    6703cb7 View commit details
    Browse the repository at this point in the history
  2. Do per-face occlusion

    spiralhalo committed Jun 4, 2023
    Configuration menu
    Copy the full SHA
    73096f7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3853ba6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f2e3503 View commit details
    Browse the repository at this point in the history
  5. Propagate to neighboring chunks, do updates in render thread

    - Fix light source restoration; was blocked by occlusion check
    spiralhalo committed Jun 4, 2023
    Configuration menu
    Copy the full SHA
    6a9dc23 View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2023

  1. Loop through every regions within extent for update

    Don't use queue since we already have per region queue
    spiralhalo committed Jun 5, 2023
    Configuration menu
    Copy the full SHA
    f38b99b View commit details
    Browse the repository at this point in the history
  2. Propagate chunk edge lights for new regions

    Add froglight colors
    Rename light data texture to "canvas:alpha/light_data"
    Cleanup cruft
    spiralhalo committed Jun 5, 2023
    Configuration menu
    Copy the full SHA
    b597751 View commit details
    Browse the repository at this point in the history

Commits on Jun 6, 2023

  1. Configuration menu
    Copy the full SHA
    7875071 View commit details
    Browse the repository at this point in the history

Commits on Jun 7, 2023

  1. Configuration menu
    Copy the full SHA
    4c16822 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b4a26cd View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0e976c9 View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2023

  1. Configuration menu
    Copy the full SHA
    d3a974f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b06e315 View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2023

  1. Configuration menu
    Copy the full SHA
    f1370ba View commit details
    Browse the repository at this point in the history
  2. Fix fluid occlusion value, refactor

    - API registry only holds pure RGB
    - Always cache all light
    - Restructure and separate "API" from internal code
    spiralhalo committed Jun 9, 2023
    Configuration menu
    Copy the full SHA
    8106230 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b130eaa View commit details
    Browse the repository at this point in the history
  4. Whoops

    spiralhalo committed Jun 9, 2023
    Configuration menu
    Copy the full SHA
    cc30e9d View commit details
    Browse the repository at this point in the history
  5. Account for state change

    spiralhalo committed Jun 9, 2023
    Configuration menu
    Copy the full SHA
    996468b View commit details
    Browse the repository at this point in the history

Commits on Jun 10, 2023

  1. Keep doing decrease until it's done

    - Remove decrease self occlusion check completely,
      Occluding blocks should be able to propagate decrease
      outwards after all.
    - Add more filtering for increase queuing
    - Some simplifications
    spiralhalo committed Jun 10, 2023
    Configuration menu
    Copy the full SHA
    2ae11a1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3051e47 View commit details
    Browse the repository at this point in the history

Commits on Jun 28, 2023

  1. Add license

    spiralhalo committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    1cc7e37 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9166f31 View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2023

  1. Properly reload regions on pipeline selection

    This is done by fully parsing pipeline description, which impacts
    resource reload time.
    spiralhalo committed Jun 29, 2023
    Configuration menu
    Copy the full SHA
    b346b27 View commit details
    Browse the repository at this point in the history
  2. Comment, style, cleanup

    spiralhalo committed Jun 29, 2023
    Configuration menu
    Copy the full SHA
    d66c739 View commit details
    Browse the repository at this point in the history
  3. Rename "light volume" to "colored lights"

    This feature is more than just providing light volume, since we also
    do propagation and manage the custom light color registry.
    
    And ultimately the goal is to add colored lights. Voxel tracing, LPV,
    and other light volume related aspects would count as separate or
    spin-off projects.
    spiralhalo committed Jun 29, 2023
    Configuration menu
    Copy the full SHA
    6ea5ea0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d7dd044 View commit details
    Browse the repository at this point in the history
  5. Fixed big stupid

    spiralhalo committed Jun 29, 2023
    Configuration menu
    Copy the full SHA
    4aea58e View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2023

  1. Add shader API, consolidate LightOp

    - Built-in selective neighbor filtering
    - Move decrease and increase operations to LightOp
    - Do multiple loop for increase too
    spiralhalo committed Jul 1, 2023
    Configuration menu
    Copy the full SHA
    51afa24 View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2023

  1. Configuration menu
    Copy the full SHA
    0b02b8c View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2023

  1. Improve / fix complex light sampling around the edges

    It's a tad more complex
    
    This also includes "fix" for a bug that was discovered
    after sampling was improved. The bug remains, this only
    reduces the frequency (pretty much "edge case" for now).
    spiralhalo committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    a033f2d View commit details
    Browse the repository at this point in the history
  2. Lazy region buffer allocation; test sparse allocator

    Additionally: respect useOcclusionData for sparse allocation
    spiralhalo committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    34978e0 View commit details
    Browse the repository at this point in the history
  3. Implement working sparse allocation

    - Light texture consists of: pointer-meta header, pointer storage, and
    data storage
    - Generates new texture when the storage (data or pointer) is doubled
    - Sampler bindings are now `int` suppliers to account for changing light
    texture ID
    - Pipeline declares occlusion data usage as it impacts number of
    allocation
    
    Possibly temporary:
    - Pipeline declares active radius for light execution. This won't be
    necessary if light execution is actually scalable
    - Reclaimable addresses are stored in an array-backed stack. This
    might be slow
    - Pointer-meta header might be moved to uniforms for simplicity
    
    NOT (yet) implemented:
    - Built-in light sampler for material programs
    - Prevent pipeline stalling by writing to a swap buffer
    - Proper registry for built-in textures available to use by program
    passes
    spiralhalo committed Jul 12, 2023
    Configuration menu
    Copy the full SHA
    9bc0044 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9507420 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5388f2f View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2023

  1. Configuration menu
    Copy the full SHA
    6058c58 View commit details
    Browse the repository at this point in the history
  2. Deprecate light update extent; use Set-based queue

    Should have been done earlier:
    - Remove notions of extent-origin and redrawing when origin was moved
    - Redraw every allocated regions on texture remake instead of the above
    
    Experimentally:
    - Iterate through queue using native malloc "array"
    (slightly faster than regular array)
    
    Additionally:
    - Checkstyle fixes
    spiralhalo committed Jul 22, 2023
    Configuration menu
    Copy the full SHA
    56c0835 View commit details
    Browse the repository at this point in the history
  3. Merge pull request #1 from spiralhalo/light-prism-sparse

    Colored lights sparse allocation
    spiralhalo committed Jul 22, 2023
    Configuration menu
    Copy the full SHA
    cdc0341 View commit details
    Browse the repository at this point in the history
  4. Implement built-in sampler; Demo in abstract pipeline

    - Minor style change
    spiralhalo committed Jul 22, 2023
    Configuration menu
    Copy the full SHA
    967f264 View commit details
    Browse the repository at this point in the history

Commits on Jul 23, 2023

  1. Block Light API defaults/examples

    Some light levels are adjusted to account for perceived luminance.
    Note that this is inaccurate.
    spiralhalo committed Jul 23, 2023
    Configuration menu
    Copy the full SHA
    bbfea2f View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2023

  1. Fix erroneous macro usage

    spiralhalo committed Jul 29, 2023
    Configuration menu
    Copy the full SHA
    b5a52f7 View commit details
    Browse the repository at this point in the history

Commits on Dec 27, 2023

  1. Configuration menu
    Copy the full SHA
    beadb2b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b5cdbf3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    eced5f6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    aa9b355 View commit details
    Browse the repository at this point in the history

Commits on Dec 28, 2023

  1. Try small optimize and add comments about redundancy, fix concurrency…

    … issue
    
    Note: simple deque is faster than Set, likely takes more memory
    spiralhalo committed Dec 28, 2023
    Configuration menu
    Copy the full SHA
    3d2fdef View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9543aaa View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    364099d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    927fa38 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e7a29aa View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    453c8b3 View commit details
    Browse the repository at this point in the history

Commits on Dec 29, 2023

  1. Configuration menu
    Copy the full SHA
    462c059 View commit details
    Browse the repository at this point in the history
  2. Robust reload on pipeline state change

    - Revert LightDataManager.reload() change from 2 days ago
    spiralhalo committed Dec 29, 2023
    Configuration menu
    Copy the full SHA
    606765f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    413764d View commit details
    Browse the repository at this point in the history

Commits on Dec 31, 2023

  1. Fix 1-tick emitter replacement (fire to nether portal)

    - Shorten profiler output
    spiralhalo committed Dec 31, 2023
    Configuration menu
    Copy the full SHA
    f2f338c View commit details
    Browse the repository at this point in the history

Commits on Jan 4, 2024

  1. Configuration menu
    Copy the full SHA
    eb009dd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fa8363d View commit details
    Browse the repository at this point in the history

Commits on Jan 5, 2024

  1. Configuration menu
    Copy the full SHA
    96ae964 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    73ff9a1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    56c8a63 View commit details
    Browse the repository at this point in the history

Commits on Jan 6, 2024

  1. Configuration menu
    Copy the full SHA
    1c120b7 View commit details
    Browse the repository at this point in the history

Commits on Jan 7, 2024

  1. Implement item-based virtual lighting for entity held light and item …

    …entity
    
    - Rename VirtualLightManager to LightLevel
    - Make item light encoding consistent in LightRegistry and everywhere
    - Reformat
    spiralhalo committed Jan 7, 2024
    Configuration menu
    Copy the full SHA
    bf97937 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cde4831 View commit details
    Browse the repository at this point in the history
  3. Entity JSON light loader, refactor CachedBlockLight

    - Entity JSON light is a simple light without predicate
    - CachedBlockLight -> FloodFillBlockLight, make all values consistent
    - `blaze` and `glow_squid` light in canvas/default resource pack
    - EntityLightProvider API (unused for now)
    spiralhalo committed Jan 7, 2024
    Configuration menu
    Copy the full SHA
    f5f78da View commit details
    Browse the repository at this point in the history

Commits on Jan 8, 2024

  1. Let pipeline disallow virtual lights, more robust reload

    - More robust LightLevel and EntityLightTracker reload
    - More robust CanvasState requireReload
    spiralhalo committed Jan 8, 2024
    Configuration menu
    Copy the full SHA
    bf67085 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f59115c View commit details
    Browse the repository at this point in the history
  3. Clamp item light intensity when converting to block light

    Our flood fill-based model doesn't support HDR, so it's better to preserve
    the color hue instead of clipping to white on high intensity.
    spiralhalo committed Jan 8, 2024
    Configuration menu
    Copy the full SHA
    4afb98b View commit details
    Browse the repository at this point in the history

Commits on Jan 9, 2024

  1. Configuration menu
    Copy the full SHA
    4cae0d2 View commit details
    Browse the repository at this point in the history