http://www.miikahweb.com/feed.php MiikaHweb - Blender Eevee-closure-lib-cleanup Branch http://www.miikahweb.com/ MiikaHweb - Blender Eevee-closure-lib-cleanup Branch fi Tue, 26 Oct 21 22:26:57 +0000 MiikaHweb RSS contact at miikahweb.com <![CDATA[[42d5896]: EEVEE: Refactor closure_lit_lib.glsl]]> http://www.miikahweb.com/en/blender/git-logs/commit/42d589684106a5199efd25f39336c37cf7fd822a 42d5896
Branches : eevee-closure-lib-cleanup
Author : Clément Foucault (fclem)
----------------------------------------
EEVEE: Refactor closure_lit_lib.glsl

This refactor was needed for some reasons:
- closure_lit_lib.glsl was unreadable and could not be easily extended to use new features.
- It was generating ~5K LOC for any shader. Slowing down compilation.
- Some calculations were incorrect and BSDF/Closure code had lots of workaround/hacks.

What this refactor does:
- Add some macros to define the light object loops / eval.
- Clear separation between each closures which now have separate files. Each closure implements the eval functions.
- Make principled BSDF a bit more correct in some cases (specular coloring, mix between glass and opaque).
- The BSDF term are applied outside of the eval function and on the whole lighting (was separated for lights before).
- Make light iteration last to avoid carrying more data than needed.
- Makes sure that all inputs are within correct ranges before evaluating the closures (use `safe_normalize` on normals).
- Making each BSDF isolated means that we might carry duplicated data (normals for instance) but this should be optimized by compilers.
- Makes Translucent BSDF its own closure type to avoid having to disable raytraced shadows using hacks.
- Separate transmission roughness is now working on Principled BSDF.
- Makes principled shader variations using constants. Removing a lot of duplicated code. This needed `const` keyword detection in `gpu_material_library.c`.
- SSR/SSS masking and data loading is a bit more consistent and defined outside of closure eval. The loading functions will act as accumulator if the lighting is not to be separated.
- SSR pass now do a full deferred lighting evaluation, including lights, in order to avoid interference with the closure eval code. However, it seems that the cost of having a global SSR toggle uniform is making the surface shader more expensive (which is already the case, by the way).
- Principle fully black specular tint now returns black instead of white.
- This fixed some artifact issue on my AMD computer on normal surfaces (which might have been some uninitialized variables).
- This touched the Ambient Occlusion because it needs to be evaluated for each closure. But to avoid the cost of this, we use another approach to just pass the result of the occlusion on interpolated normals and modify it using the bent normal for each Closure. This tends to reduce shadowing. I'm still looking into improving this but this is out of the scope of this patch.
- Performance might be a bit worse with this patch since it is more oriented towards code modularity. But not by a lot.

Render tests needs to be updated after this.

Differential Revision: https://developer.blender.org/D10390

----------------------------------------
3 Paths Changed]]>
Fri, 12 Feb 2021 23:54:30 +0000 http://www.miikahweb.com/en/blender/git-logs/commit/42d589684106a5199efd25f39336c37cf7fd822aClément Foucault
<![CDATA[[251ad8b]: EEVEE: Fix issue with planar SSR]]> http://www.miikahweb.com/en/blender/git-logs/commit/251ad8bf604e8d5af47ea86a33d7fda573096d34 251ad8b
Branches : eevee-closure-lib-cleanup, eevee-ggx-lut-fix, eevee-probe-roughness-fix
Author : Clément Foucault (fclem)
----------------------------------------
EEVEE: Fix issue with planar SSR

----------------------------------------
1 Path Changed]]>
Tue, 09 Feb 2021 01:02:18 +0000 http://www.miikahweb.com/en/blender/git-logs/commit/251ad8bf604e8d5af47ea86a33d7fda573096d34Clément Foucault
<![CDATA[[6eaeb62]: EEVEE: Fix occlusion applied on SSR]]> http://www.miikahweb.com/en/blender/git-logs/commit/6eaeb6272ef7efa3e9aae7cb623c773c4d87d67b 6eaeb62
Branches : eevee-closure-lib-cleanup, eevee-ggx-lut-fix, eevee-probe-roughness-fix
Author : Clément Foucault (fclem)
----------------------------------------
EEVEE: Fix occlusion applied on SSR

----------------------------------------
2 Paths Changed]]>
Mon, 08 Feb 2021 15:45:38 +0000 http://www.miikahweb.com/en/blender/git-logs/commit/6eaeb6272ef7efa3e9aae7cb623c773c4d87d67bClément Foucault
<![CDATA[[744427b]: EEVEE: Cleanup: Remove use of macros for the loops]]> http://www.miikahweb.com/en/blender/git-logs/commit/744427b729959956d0a191032ea551a9e0c0c0e4 744427b
Branches : eevee-closure-lib-cleanup, eevee-ggx-lut-fix, eevee-probe-roughness-fix
Author : Clément Foucault (fclem)
----------------------------------------
EEVEE: Cleanup: Remove use of macros for the loops

----------------------------------------
1 Path Changed]]>
Mon, 08 Feb 2021 16:11:05 +0000 http://www.miikahweb.com/en/blender/git-logs/commit/744427b729959956d0a191032ea551a9e0c0c0e4Clément Foucault
<![CDATA[[7ca2427]: EEVEE: Fix most regression with ambient occlusion]]> http://www.miikahweb.com/en/blender/git-logs/commit/7ca2427ce22d2a1a68d7b53e094f0756658beb77 7ca2427
Branches : eevee-closure-lib-cleanup, eevee-ggx-lut-fix, eevee-probe-roughness-fix
Author : Clément Foucault (fclem)
----------------------------------------
EEVEE: Fix most regression with ambient occlusion

Occlusion had change because of the way it was applied.
Get back to almost the same thing we had previously. The only thing
that changed is the occlusion of Normal mapped surface.

It is a bit less noticeable due to a new approximation we make.

----------------------------------------
3 Paths Changed]]>
Tue, 09 Feb 2021 00:36:20 +0000 http://www.miikahweb.com/en/blender/git-logs/commit/7ca2427ce22d2a1a68d7b53e094f0756658beb77Clément Foucault
<![CDATA[[1d56589]: EEVEE: Add back support for user occlusion on eevee_specular...]]> http://www.miikahweb.com/en/blender/git-logs/commit/1d56589f149bd733a47a2f53de705a99165c70a9 1d56589
Branches : eevee-closure-lib-cleanup, eevee-ggx-lut-fix, eevee-probe-roughness-fix
Author : Clément Foucault (fclem)
----------------------------------------
EEVEE: Add back support for user occlusion on eevee_specular BSDF

----------------------------------------
7 Paths Changed]]>
Mon, 08 Feb 2021 14:43:24 +0000 http://www.miikahweb.com/en/blender/git-logs/commit/1d56589f149bd733a47a2f53de705a99165c70a9Clément Foucault
<![CDATA[[f6cc14f]: EEVEE: Split closure_lit_lib.glsl]]> http://www.miikahweb.com/en/blender/git-logs/commit/f6cc14f86e3695150a033e99f0ad0b27a55d0007 f6cc14f
Branches : eevee-closure-lib-cleanup, eevee-ggx-lut-fix, eevee-probe-roughness-fix
Author : Clément Foucault (fclem)
----------------------------------------
EEVEE: Split closure_lit_lib.glsl

----------------------------------------
14 Paths Changed]]>
Mon, 08 Feb 2021 00:25:21 +0000 http://www.miikahweb.com/en/blender/git-logs/commit/f6cc14f86e3695150a033e99f0ad0b27a55d0007Clément Foucault
<![CDATA[[1df2f7a]: EEVEE: Fix missing shadowing factor]]> http://www.miikahweb.com/en/blender/git-logs/commit/1df2f7a7133471ea3e99888bf6a0c922b78f593a 1df2f7a
Branches : eevee-closure-lib-cleanup, eevee-ggx-lut-fix, eevee-probe-roughness-fix
Author : Clément Foucault (fclem)
----------------------------------------
EEVEE: Fix missing shadowing factor

----------------------------------------
1 Path Changed]]>
Sun, 07 Feb 2021 19:46:37 +0000 http://www.miikahweb.com/en/blender/git-logs/commit/1df2f7a7133471ea3e99888bf6a0c922b78f593aClément Foucault
<![CDATA[[36b066e]: EEVEE: Fix lightgrid accumulation not using diffuse_accum]]> http://www.miikahweb.com/en/blender/git-logs/commit/36b066ee9826b3f1218fcc49fd523d17efe77c32 36b066e
Branches : eevee-closure-lib-cleanup, eevee-ggx-lut-fix, eevee-probe-roughness-fix
Author : Clément Foucault (fclem)
----------------------------------------
EEVEE: Fix lightgrid accumulation not using diffuse_accum

Also add safe normalize to interpolated normals.

----------------------------------------
1 Path Changed]]>
Sun, 07 Feb 2021 19:46:37 +0000 http://www.miikahweb.com/en/blender/git-logs/commit/36b066ee9826b3f1218fcc49fd523d17efe77c32Clément Foucault
<![CDATA[[60b2e41]: EEVEE: Fix typo in macro leading to undefined behavior]]> http://www.miikahweb.com/en/blender/git-logs/commit/60b2e410a7cc6cbc5f0cf57d77469298ce6b20d7 60b2e41
Branches : eevee-closure-lib-cleanup, eevee-ggx-lut-fix, eevee-probe-roughness-fix
Author : Clément Foucault (fclem)
----------------------------------------
EEVEE: Fix typo in macro leading to undefined behavior

Only the 1st closure radiance accumulator was initialized correctly.

----------------------------------------
1 Path Changed]]>
Sun, 07 Feb 2021 19:13:09 +0000 http://www.miikahweb.com/en/blender/git-logs/commit/60b2e410a7cc6cbc5f0cf57d77469298ce6b20d7Clément Foucault
<![CDATA[[bb05f6d]: EEVEE: Replace constant booleans by const float]]> http://www.miikahweb.com/en/blender/git-logs/commit/bb05f6d33572e3e17f5298a6e792d529e2b77cb3 bb05f6d
Branches : eevee-closure-lib-cleanup, eevee-ggx-lut-fix, eevee-probe-roughness-fix
Author : Clément Foucault (fclem)
----------------------------------------
EEVEE: Replace constant booleans by const float

This makes principled optimization easier and less verbose. Tests shows
no differences in performance.

----------------------------------------
4 Paths Changed]]>
Sun, 07 Feb 2021 19:46:37 +0000 http://www.miikahweb.com/en/blender/git-logs/commit/bb05f6d33572e3e17f5298a6e792d529e2b77cb3Clément Foucault
<![CDATA[[fe00859]: EEVEE: Rewrite closure_lit_lib to reduce complexity]]> http://www.miikahweb.com/en/blender/git-logs/commit/fe008592024c3081c5b43b82482d46e41262fdb1 fe00859
Branches : eevee-closure-lib-cleanup, eevee-ggx-lut-fix, eevee-probe-roughness-fix
Author : Clément Foucault (fclem)
----------------------------------------
EEVEE: Rewrite closure_lit_lib to reduce complexity

This rewrite improves:
- Code clarity: Less duplicated code and removes a few hacks.
- Compile time performance: Shader code was divided by 3 in average.
I did not profile the compilation time but it is faster.
- Shading Perf: Noticed a 25% performance improvement on
the shading pass with default dielectric principled bsdf.
- Fix Principled Tint being white if color is black
- It seems to have fixed issues on some drivers giving some incorect
results.
- Changes Principled BSDF support to be less hacky.

----------------------------------------
23 Paths Changed]]>
Sun, 07 Feb 2021 17:03:58 +0000 http://www.miikahweb.com/en/blender/git-logs/commit/fe008592024c3081c5b43b82482d46e41262fdb1Clément Foucault