Open WrobotGames opened 6 months ago
Backlighting has no effect on GI.
As I understand it, this is difficult to do with real-time GI techniques, although it could be implemented for the lightmapper. I don't think raytraced GI even bothers with this, unless it's full pathtracing.
As far as I know, the backlight property should drive a full diffuse sample with reversed normals, and then tinted with the backlight color. This diffuse sample should not only include the lights, but also a cubemap sample and a gi sample (VoxelGI and DynamicGI).
Sampling GI twice would make it much more expensive, so I'm not sure if this is viable. Even sampling reflection probes isn't cheap if you have multiple overlapping reflection probes that have to be blended together.
Describe the project you are working on
3D scenes with foliage, and experiments with materials. Note: this proposal contains several issues, but the solutions are so close that it made sense to combine them.
Describe the problem or limitation you are having in your project
The backlight property in Godot currently has a few issues:
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Possible solutions (for every problem):
Used as source: https://academysoftwarefoundation.github.io/OpenPBR/#model/thin-walledcase The model in this paper also includes energy conservation, but this is more of an artistic decision. For more realistic graphics the artist can lower the albedo color to get the look they want.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
(I am by all means not a shader expert) Mockup:
sample_diffuse() would be the combination of light diffuse (lambert, burley, toon) and gi and environment diffuse, just like how it is right now.
Total_diffuse = sample_diffuse(albedo_color, normal) + backlight_color * sample_diffuse(albedo_color, -normal)`;
With 'realistic' energy conservation according to OpenPBR: With g = anisotrophy from -1 to 1 (default = 0)
Total_diffuse = 0.5 * (1 - g) * sample_diffuse(albedo_color, normal) + 0.5 * (1+g) * backlight_color * sample_diffuse(albedo_color, -normal);
This with g = 1 would just mean default sample with reversed normals, and g = -1 is default sample.If this enhancement will not be used often, can it be worked around with a few lines of script?
Part of the built in shader.
Is there a reason why this should be core and not an add-on in the asset library?
Part of the built in shader.