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

Make brush surfaces loading uniform #752

Open
w23 opened this issue Dec 18, 2024 · 0 comments
Open

Make brush surfaces loading uniform #752

w23 opened this issue Dec 18, 2024 · 0 comments
Labels
enhancement New feature or request visual bug Visual glitches, something looks incorrectly water

Comments

@w23
Copy link
Owner

w23 commented Dec 18, 2024

Currently brush model loading consists of the following steps:

  1. Go through all its surfaces and compute counts of each type of surface.
  2. Load regular brush model. This also iterates through all surfaces, gets their type, etc etc. Also determines and handles whether that surface is emissive.
  3. Load water and water sides model. Does some of that processing too.

There's a bunch of duplicate code, and unnatural similar argument passing around.

At this scale it would make sense to consolidate surface processing:

  1. Loop over all surfaces only once.
  2. Compute common parameters for each one.
  3. Handle emissive for each one independent of type, see e.g. Emissive textures on !water textures does not work #56.
  4. Do specific handling based on type, e.g.: regular types go to regular submodel, water/sides go to water submodels, etc.
  5. When done with surfaces, finalize each submodel: create render models, upload geometries, etc.

Note that for efficient model loading we might need to compute vertices+indices count before allocating geometry buffers. That might either need a second pass over loaded surfaces for each submodel type, or using dynamic arrays for temp data.

Doing an explicit finalization step could also allow for more natural extended geometry processing, e.g.:

@w23 w23 added enhancement New feature or request visual bug Visual glitches, something looks incorrectly water labels Dec 18, 2024
@w23 w23 mentioned this issue Dec 19, 2024
26 tasks
w23 added a commit that referenced this issue Dec 19, 2024
Implements new totally automatic barrier placement. Also, staging is refactored.

- [x] image staging
  - [x] some images are corrupted
  - ~~[ ] #745~~ -- postponed until next time we'd need to touch images; current code works good enough for now.
  - [x] use combuf auto barriers everywhere where it makes sense
- [x] corrupted geometry in playdemo ...
- [x] buffer staging
  - [x] #743 
  - [x] track copied staging regions: i.e. staging must know that it has been drained fully
- [x] RT-trad dynamic toggle
  - [x] push-pull staging boundary
- [x] frame dependency tracking: automatically free/flip buffers when frame using them is done
- [x] replace ALL barriers with combuf ones
  - [x] buffers in rtx/resources
  - [x] images
    - [x] track images sync state inline where possible
  - [x] find other uses
- [x] improve staging
  - [x] track staging users explicitly
    - [x] per-user stats: sizes, allocations, etc
    - [x] push remaining data for stale users
  - [x] use ring buffer directly, track frame boundaries externally in fctl
- [x] crash in `buildBlases()`:
  1. load map with rt disabled
  2. change to another map
  3. enable rt
  4. 💥
- [x] suboptimal barrier, see comment #742 (comment)
- [x] simplify creating and building TLAS
- [x] Run rendering tests
  - [x] missing emissive toxic waters
    - Leave as a known problem: it's due to inadvertently skipping some water surfaces when looking for emissive ones, see:
      - #56
      - #752
  - [x] slightly different indirect blur
    - Assuming that this is due to Á-Trous filtering, which could've sneaked through before the gold images were set. Not going to investigate, as we're about to submit a big change to the denoiser.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request visual bug Visual glitches, something looks incorrectly water
Projects
None yet
Development

No branches or pull requests

1 participant