Image based lighting local probe system - first commit. - #3660
Open
scratchyrice wants to merge 6 commits into
Open
Image based lighting local probe system - first commit.#3660scratchyrice wants to merge 6 commits into
scratchyrice wants to merge 6 commits into
Conversation
scratchyrice
commented
Jul 1, 2026
Contributor
- Update to CookTorrance AO.
- Addition of local probes to IBL SRS (Example will follow when I can - I need to convert my in-engine system over to an ogre example).
- Addition of local probes to IBL GLSL.
Updated D3D11 Mip map generation flag - will now only automatically generate mipmaps when TU_AUTOMIPMAP is set.
IBL can now accept seperate diffuse and specular textures.
AO Added to PBR pipeline on R channel in MR texture.
- Update to CookTorrance AO. - Addition of local probes to IBL SRS (Example will follow when I can - I need to convert my in-engine system over to an ogre example). - Addition of local probes to IBL GLSL.
paroj
reviewed
Jul 1, 2026
| mShAtlasSizeParam = psProgram->resolveParameter(GpuProgramParameters::ACT_TEXTURE_SIZE, mLocalProbeShAtlasSamplerIndex); | ||
|
|
||
| //Local probe 1 | ||
| mLocalProbeParams1_1 = psProgram->resolveParameter(GCT_FLOAT4, "IBL_LocalProbe_1_1"); //x, y, z = position. w = probe ID for SH atlas reference. |
Member
There was a problem hiding this comment.
resolveParameter(GCT_FLOAT4, GPV_GLOBAL, -1, "IBL_LocalProbe", 12) to make it an vec4 array for easier handling
Contributor
Author
There was a problem hiding this comment.
Will do. Much cleaner. Didn't know you could do this. Want to extend it to up to 10 probes for large single mesh's - this approach would make it cleaner.
paroj
reviewed
Jul 1, 2026
| //Compute AO | ||
| float visibility = 1.0; | ||
| visibility *= computeMicroShadowing(NoL, pixel.ao); | ||
| //AO / micro shadowing |
Member
There was a problem hiding this comment.
please rebase on master. I corrected the AO computation there
Contributor
Author
There was a problem hiding this comment.
Sorry, didn't realise. Will do.
paroj
reviewed
Jul 1, 2026
| float x = n.x, y = n.y, z = n.z; | ||
|
|
||
| return | ||
| sh0 * 0.2820947918 + |
Member
There was a problem hiding this comment.
pre-multiply the sh by the weights as filament does:
https://github.com/google/filament/blob/b22899f5b2ab1c617c4ddf6a57145f789fa665bc/filament/src/details/IndirectLight.cpp#L75
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.