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

Skybox improvements (E346-E347) #708

Merged
merged 9 commits into from
Dec 18, 2023
Merged

Skybox improvements (E346-E347) #708

merged 9 commits into from
Dec 18, 2023

Conversation

w23
Copy link
Owner

@w23 w23 commented Dec 14, 2023

  • Optimize skybox loading #706
    • Do not load skybox if map doesn't have any SURF_DRAWSKY surfaces.
    • Cache: do not reload the same skybox.
    • Enable loading packed KTX2 cubemaps as skyboxes in engine/imagelib
  • Reuse existing imagelib cubemap loading routines, remove custom skybox loading code
  • Allow hiding SURF_DRAWSKY surfaces via "_xvk_remove_all_sky_surfaces" "1", Draw a skybox if the ray hit on nothing #579
  • Skybox stuff #677
    • Add skybox exposure control for HDR skyboxes
    • Allow reloading skyboxes when reloading patches

w23 added 5 commits December 14, 2023 10:33
- Do not load skybox at all if there are no SURF_DRAWSKY, #706, #579
- Do not reload the same skybox, #706

Also refactor skybox loading a bit. Prepare for KTX2 skyboxes.
Neede for getting rid of some skybox 𝘱𝘦𝘯𝘦𝘵𝘳𝘢𝘵𝘪𝘰𝘯 glitches, see #579
Also:
- add more info to texture upload debug logs
- remove obsoleted code
- prepare for engine/imagelib-side cubemaps
Engine imagelib already has skybox loader. It uses rgbdata_t
IMAGE_CUBEMAP flag.
1. Support IMAGE_CUBEMAP
2. Utilize imagelib skybox loader, do not try to load individual skybox
   sides manually.

This will allow loading KTX2 cubemaps directly.

Known issues:
1. Compressed KTX2 sides are not rotated correctly. Engine/imagelib is
   unable to rotate compressed images.
2. Some KTX2 sides are corrupted. Cause unknown.
For some very unknown reason there's a line that fixes image size to
w*h*4, which would correspond to RGBA8 pixel format w/o alignment.

This is extremely incorrect for other pixel format, e.g. compressed
ones.

Not sure why this size-fixing was there, but removing it fixes sided
KTX2 compressed skybox corruption.
@0x4E69676874466F78
Copy link
Collaborator

0x4E69676874466F78 commented Dec 16, 2023

Прикладываю тестовую кубемапу с текстом для проверки ориентации: cubemap_test.zip
(чтобы не затерялась в личке)

w23 added 2 commits December 18, 2023 11:37
E.g. add `desert.mat` alongside `desert.ktx2` (or
`desrt_{rt,lf,...}.png` files) with the following contents:
```
exposure 0.3
```
Skybox texture color will be multiplied by this value.
@w23 w23 mentioned this pull request Dec 18, 2023
6 tasks
@w23 w23 marked this pull request as ready for review December 18, 2023 17:55
@w23 w23 merged commit 7e0553d into vulkan Dec 18, 2023
9 checks passed
@w23 w23 deleted the stream-E346 branch December 18, 2023 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants