Skip to content

Merge LTC and DFG LUTs into a texture array#24004

Closed
beicause wants to merge 3 commits intobevyengine:mainfrom
beicause:ltc-dfg-luts-to-tex-array
Closed

Merge LTC and DFG LUTs into a texture array#24004
beicause wants to merge 3 commits intobevyengine:mainfrom
beicause:ltc-dfg-luts-to-tex-array

Conversation

@beicause
Copy link
Copy Markdown
Member

@beicause beicause commented Apr 27, 2026

Objective

Reduce texture bindings in mesh view bind group.

Solution

Merge LTC and DFG LUTs into a texture array and remove dfg_lut feature.

Since #23288 adds luts, bevy_pbr should enable bevy_image/ktx2 and bevy_image/zstd.

The ltc_dfg.ktx2 is created using KTX-Sofeware, DFG lut is converted from Rg16Float to Rgba16Float:

ktx extract ltc1.ktx2 ltc1.exr
ktx extract ltc2.ktx2 ltc2.exr
ktx extract dfg.ktx2 dfg.exr
ktx create --format R16G16B16A16_SFLOAT --layers 3 --zstd 22 ltc1.exr ltc2.exr dfg.exr ltc_dfg.ktx2

Testing

Run testbed_3d. Solari is untested.

@github-actions
Copy link
Copy Markdown
Contributor

Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke!
You can review it at https://pixel-eagle.com/project/B04F67C0-C054-4A6F-92EC-F599FEC2FD1D?filter=PR-24004

If it's expected, please add the M-Deliberate-Rendering-Change label.

If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it.

@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 27, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering Apr 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke!
You can review it at https://pixel-eagle.com/project/B04F67C0-C054-4A6F-92EC-F599FEC2FD1D?filter=PR-24004

If it's expected, please add the M-Deliberate-Rendering-Change label.

If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it.

@beicause
Copy link
Copy Markdown
Member Author

beicause commented Apr 28, 2026

Do we want to keep the dfg_lut feature and also gate ltc luts (for rect light) behind a feature flag #23737 (comment)? If so we should only convert the 2 ltc luts into a texture array.

Edit: If we decide replace point light implementation with ltc #23400, then we should not gate ltc otherwise neither point light nor rect light can be used.

@beicause beicause marked this pull request as draft April 28, 2026 03:14
@kfc35
Copy link
Copy Markdown
Contributor

kfc35 commented May 1, 2026

This PR, after having main merged into it, currently fixes #23975 for me (since it reduces the number of SampledTextures)

However, since it’s still a WIP, I won’t place it into the milestone yet until I reconfirm after it is back to being ready for review (Although I think putting back the feature gating will still keep the sampledTextures number lower than the limit?)

@beicause
Copy link
Copy Markdown
Member Author

beicause commented May 2, 2026

I prefer #24065 to gate ltc luts.

@beicause beicause closed this May 2, 2026
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in Rendering May 2, 2026
@beicause beicause deleted the ltc-dfg-luts-to-tex-array branch May 2, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants