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

Emissive textures on !water textures does not work #56

Open
0x4E69676874466F78 opened this issue Sep 11, 2021 · 11 comments · Fixed by #651
Open

Emissive textures on !water textures does not work #56

0x4E69676874466F78 opened this issue Sep 11, 2021 · 11 comments · Fixed by #651
Labels
bug Something isn't working ray tracing water

Comments

@0x4E69676874466F78
Copy link
Collaborator

0x4E69676874466F78 commented Sep 11, 2021

!TOXICGRN and !TOXICGRN2 does not work (c0a0d)

@0x4E69676874466F78 0x4E69676874466F78 added the bug Something isn't working label Sep 11, 2021
@0x4E69676874466F78 0x4E69676874466F78 changed the title Emissive textures !TOXICGRN and !TOXICGRN2 does not work (c0a0e) Emissive textures !TOXICGRN and !TOXICGRN2 does not work (c0a0d) Sep 11, 2021
@w23
Copy link
Owner

w23 commented Sep 11, 2021

Btw, it does get loaded and assigned to a texture. Not sure why it is not applied. Are you sure that's the right texture?

@0x4E69676874466F78
Copy link
Collaborator Author

0x4E69676874466F78 commented Sep 12, 2021

Are you sure that's the right texture?

Yes_1
originalvsmyrad

Not sure why it is not applied.

Maybe parasitic polygons are interfering? z-fighting?
Look carefully there you can see the overlap of polygons.

I decompiled the map and there really is a different texture very close.
изображение
I finally got to grab the texture in the original map use bspguy (it was not easy).
изображение

@0x4E69676874466F78
Copy link
Collaborator Author

0x4E69676874466F78 commented Sep 12, 2021

Although perhaps this block is not just stretched there and I should use CRETE4_FLR01 for emissive?
But then there would be no lighting inside right?
изображение
I will set the emissive to CRETE4_FLR01 later.

@0x4E69676874466F78
Copy link
Collaborator Author

0x4E69676874466F78 commented Sep 12, 2021

With CRETE4_FLR01 has a similar result outside but not inside and !TOXICGRN still needs to be specified because there is only !TOXICGRN on the adjacent surface with a broken tank.
Brush with CRETE4_FLR01 is an error and it should not be there, moreover, in the game brush is somehow removed.

@0x4E69676874466F78
Copy link
Collaborator Author

0x4E69676874466F78 commented Sep 12, 2021

Maybe it's because the textures which prefixed "!" automatically become a simplified water surface? (inside they work like water and there you can suffocate). Thus, the code associated with the water surface (it seems processed by different shader?) breaks the emissive logic.

w23 added a commit that referenced this issue Sep 14, 2021
It was missing msurface_t reference which is (unnecessarily) required for light clusters computation

Also add more verbose debug names for dynamic models.
@w23 w23 closed this as completed in afa1e85 Sep 15, 2021
@0x4E69676874466F78 0x4E69676874466F78 moved this to ✅ Done in HLRT Mar 3, 2023
@0x4E69676874466F78 0x4E69676874466F78 moved this from ✅ Done to 🆕 New in HLRT Nov 7, 2023
@w23 w23 moved this from 🆕 New to 🗒 Next in HLRT Nov 7, 2023
@0x4E69676874466F78
Copy link
Collaborator Author

0x4E69676874466F78 commented Nov 7, 2023

Для c0a0d !TOXICGRN текстуры можно не делать subdivide полигонов, у неё нет func_water тем более (взять WaveHeight неоткуда). Таким образом светящихся полигонов будет в разы меньше (при желании там можно ещё объединить что-то из 18 поверхностей снизу и 10 сверху, но там ещё остаются 18 поверхностей от отсровков, итого без оптимизации будет ~46, с нарезкой видимо там сильно больше). Но нужно при этом оставить искажающую текстуру анимацию.

@0x4E69676874466F78 0x4E69676874466F78 changed the title Emissive textures !TOXICGRN and !TOXICGRN2 does not work (c0a0d) Emissive textures on !water textures does not work Nov 7, 2023
@0x4E69676874466F78 0x4E69676874466F78 changed the title Emissive textures on !water textures does not work Emissive textures on !water textures does not work Nov 7, 2023
@w23 w23 moved this from 🗒 Next to 🏗 In progress in HLRT Nov 14, 2023
@w23
Copy link
Owner

w23 commented Nov 14, 2023

Polygon lights can be only loaded for surfaces which have loaded geometry. We only have geometry for BrushSurface_Regular and BrushSurface_Animated. Water surfaces do not load their geometry as other surfaces do. They are subdivided and loaded into special water models separately.

We still need to somehow load water surfaces geometry for this.

For performance reasons we might even have to join the bsp-split surfaces back into as large polygons as possible, and then do a lighting-aware triangulation.

@w23
Copy link
Owner

w23 commented Nov 14, 2023

Disregard the geometry part, it is not true. For polygon lights we do load geometries by hand explicitly.

What's broken is emissive color tracking. It works through bmodel->surface_to_geometry_index, which is global per bmodel, not for individual submodels (regular-vs-water-vs-watersides).

The fix is about moving relevant parts to submodels, and collect emissive values for those.

w23 added a commit that referenced this issue Nov 16, 2023
Makes acid water surfaces emissive again.
However, they are not assinged proper emissive color values for direct
ray hits yet, so they do emit light, but look dar still.

Ref: #56
@w23 w23 closed this as completed in #651 Nov 16, 2023
w23 added a commit that referenced this issue Nov 16, 2023
E331: make water emissive again

- [x] Make acid water surfaces emissive again.
- [x] Update emissive color for them, fix #56
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in HLRT Nov 16, 2023
@0x4E69676874466F78
Copy link
Collaborator Author

0x4E69676874466F78 commented Nov 17, 2023

Светится почему-то только наружная сторона нормально, подводная светится плохо (если вообще светится).
image

Это реально актуально на c1a4g (там можно попасть под жижу):
GL:
image
VK rt:
image

@w23 w23 moved this from ✅ Done to 🏗 In progress in HLRT Nov 17, 2023
@w23
Copy link
Owner

w23 commented Nov 17, 2023

This is because polygon lights are one-sided. They only illuminate things in front of them, not in the back. This is a rather important optimization (at least now).

The workaround would be to add back-side polylights for water surfaces. However, that eats too much polylight budget, and makes the rest of the level look way worse due to missing lights (that didn't fit into a budget).

Another way to approach this would be to note the fact that physical reason for this emissive acid is not its surface being emissive, but the whole body of acid emitting lights. So probably we should do some kind of "participating medium" thing, similar to fog, etc. Which we need to do for underwater volumes eventually anyway.

Will do this later.

w23 added a commit that referenced this issue Nov 17, 2023
@0x4E69676874466F78 0x4E69676874466F78 moved this from 🏗 In progress to 📋 Backlog in HLRT Nov 17, 2023
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in HLRT Nov 17, 2023
@0x4E69676874466F78 0x4E69676874466F78 moved this from ✅ Done to 📋 Backlog in HLRT Nov 17, 2023
@w23
Copy link
Owner

w23 commented Dec 18, 2024

There's also missing emissive water surfaces in e.g. test_brush2 and test_brush3 maps. This is seemingly due to emissive surfaces handler function not being called for some surfaces in some circumstances: e.g. water-only brush model will completely skip regular model loading, and thus will not encounter this function at all.

I tried experimentally addressing this issue here: 65f2403 but it solves only half of it, and also makes code way messier. I'm hesitant to accept it as a solution.

It does not address double-sided issue either.

This was referenced Dec 18, 2024
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
bug Something isn't working ray tracing water
Projects
Status: 📋 Backlog
Status: Todo
Development

Successfully merging a pull request may close this issue.

2 participants