diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-04 00:29:24 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-04 00:29:24 +0100 |
| commit | 4632788c4bef265e58630473eed5559bf125a726 (patch) | |
| tree | 9264d8f59c8914e118adfafc4592ee77377eaf9e /CONTEXT.md | |
| parent | Skybox image: fix HDR sky binding; clip checkbox/arrow drawing (diff) | |
| download | hl2h-4632788c4bef265e58630473eed5559bf125a726.tar.gz hl2h-4632788c4bef265e58630473eed5559bf125a726.zip | |
Skybox image: power-of-two resize; upload at FRAME_RENDER_START
- The material system rejects textures whose dimensions are not multiples of 4
("Image dimensions must be multiple of 4!"), so scale the decoded image to
the next power of two (bilinear). 798x798 -> 1024x1024. The invalid VTF also
crashed the renderer after the apply.
- Move skybox_update() out of the VGUI paint hook into the FRAME_RENDER_START
FrameStageNotify stage. ITexture::Download only regenerates bits when the
material system considers the frame render-safe; during paint it returned
early, the regenerator never ran (no pixels), and a later upload of the
empty VTF crashed.
- Log the regenerator entry so the log shows whether the upload path ran.
Diffstat (limited to '')
| -rw-r--r-- | CONTEXT.md | 8 |
1 files changed, 7 insertions, 1 deletions
| @@ -368,7 +368,9 @@ vocabulary / decisions. | |||
| 368 | the INI). Not `sv_skyname`: that did not take effect at runtime in this | 368 | the INI). Not `sv_skyname`: that did not take effect at runtime in this |
| 369 | build, so the skybox card now works on materials instead. | 369 | build, so the skybox card now works on materials instead. |
| 370 | - The PNG is decoded by our own reader (`zlib`'s `uncompress` + PNG filters; | 370 | - The PNG is decoded by our own reader (`zlib`'s `uncompress` + PNG filters; |
| 371 | 8-bit non-interlaced RGB/RGBA/gray/palette). Do **not** use the system | 371 | 8-bit non-interlaced RGB/RGBA/gray/palette) and scaled to the next power of |
| 372 | two, because the material system rejects textures whose dimensions are not | ||
| 373 | multiples of 4 ("Image dimensions must be multiple of 4!"). Do **not** use the system | ||
| 372 | libpng: `client.so`, `engine.so` and `vguimatsurface.so` each export their | 374 | libpng: `client.so`, `engine.so` and `vguimatsurface.so` each export their |
| 373 | own `png_create_read_struct`, so libpng16's internal PLT calls bind to the | 375 | own `png_create_read_struct`, so libpng16's internal PLT calls bind to the |
| 374 | game's older libpng with a different `png_struct` layout and crash in | 376 | game's older libpng with a different `png_struct` layout and crash in |
| @@ -394,6 +396,10 @@ vocabulary / decisions. | |||
| 394 | string as a fallback) and restored when the feature is disabled. Records | 396 | string as a fallback) and restored when the feature is disabled. Records |
| 395 | survive level changes so a reused sky material can still be restored; the | 397 | survive level changes so a reused sky material can still be restored; the |
| 396 | override is re-applied to the new map automatically. | 398 | override is re-applied to the new map automatically. |
| 399 | - `skybox_update()` runs from the `FRAME_RENDER_START` FrameStageNotify hook, | ||
| 400 | not from the VGUI paint hook: `ITexture::Download` only regenerates texture | ||
| 401 | bits on a render-safe frame stage. Running it during paint skipped the | ||
| 402 | regenerator and left an empty VTF (upload warnings + crash). | ||
| 397 | - The card shows the image path and has a Reload image button. A missing or | 403 | - The card shows the image path and has a Reload image button. A missing or |
| 398 | unreadable PNG raises an error toast; the image is only re-read on Reload. | 404 | unreadable PNG raises an error toast; the image is only re-read on Reload. |
| 399 | - Saved as `[skybox] active/bind`. | 405 | - Saved as `[skybox] active/bind`. |
