-
-
Notifications
You must be signed in to change notification settings - Fork 22k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a Fade Start property to ReflectionProbe #61416
Add a Fade Start property to ReflectionProbe #61416
Conversation
a4af986
to
435663f
Compare
435663f
to
cdd4527
Compare
Fade Start = 0.0 is the existing behavior in |
@Calinou sorry, I ment 1.0 |
In that case, I'm not sure how this can be prevented due to floating-point precision issues. You can make ReflectionProbes slightly overlap each other to work around this. |
They are overlap already. That happen at the end of the Reflection Probes set as Edit: One way of solving this is to add a parameter fade away the sky from the edge of the reflection probes and other parameter to fade away the probe into another probe. This will fix transitions like this also |
That way you can completely fade away the sky reflection in the edge but smootly fade away the probe with other probes and avoid this issue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that this addresses the use-case in godotengine/godot-proposals#3013
This change may be helpful as it allows users to control where the blend starts and thus may help with some edge cases, but ultimately, the problem will still exist. Take for example, the example in the OP. With this change, the user could tweak the blend start so that very little light leaked into the room, by setting the fade start at roughly the room extents. The issue is this just pushes the blend portion outside of the room, so you will end up with occlusion artifacts outside of the room. What is needed is for us to save a depth map with the reflection probe and then use the depth map to blend.
servers/rendering/renderer_rd/shaders/scene_forward_lights_inc.glsl
Outdated
Show resolved
Hide resolved
servers/rendering/renderer_rd/shaders/scene_forward_lights_inc.glsl
Outdated
Show resolved
Hide resolved
cdd4527
to
be108b6
Compare
One more situation where this popped up: https://www.reddit.com/r/godot/comments/10gux8y/why_is_the_skybox_overlaying_the_reflection/ In this particular example (mostly outdoor scene), increasing Fade Start would do the trick well.
Is this cheap enough to be feasible on the Forward Mobile backend, let alone Compatibility? Would this be something you need to enable on every ReflectionProbe (for performance reasons), or would it always be done? |
Isn't that literally the same as adding lights with shadows to the scene? That can't be good for performance if it's enabled by default despite it fixing issues. I think being able to customize fade start is many times better. |
be108b6
to
69e800c
Compare
Rebased and tested again in both Forward+ and Mobile, it works as expected. (Compatibility doesn't support reflection probes yet.) @jcostello I've fixed the issue you mentioned by decreasing the |
@Calinou nice, I'm testing this again |
Artifacts have expired and I'd like to test this since my original proposal is being mentioned quite a lot here. I agree with ClayJohn, I'm not sure this actually resolves the proposal. Is there a build with this available somewhere? |
If you dont mind running a build someone else compiled, I can make one. EDIT: Hold on, can the automatic builds be re-run? |
When testing features I’d prefer to use an automatic or official build for security reasons. Thank you for the offer though! |
c4c72d0
to
774ddc2
Compare
I've pushed a rebase with no changes to create a new build (check back in 1 hour).
I don't intend this PR to resolve the linked proposal, which is why it doesn't say "closes" before the PR link. However, I believe this feature is still needed for artistic control (and it can help somewhat if you encounter the sky occlusion situation). |
I agree. I would have it merge since it gives control over the reflections. In order to fix the underline issue, how complicated is to capture another sky reflection but with the geometry oclussion instead of using the whole sky box? |
As mentioned in clayjohn's comment, you need to store a depth cubemap along the color cubemap (or perhaps store it in the cubemap's alpha channel so that no separate texture is needed). This will require slightly more time to update the cubemap but it should allow for properly occluding the sky. This may also allow for improving parallax-corrected cubemaps with something similar to parallax occlusion mapping, as seen in God of War Ragnarok's fidelity mode. |
I don't mind that requires more time. In the future, cubmaps should be baked in editor unless they are move or updated |
Completely disabling blending when fade start is 1.0 might also work, I think |
In testing this definitely doesn't solve that proposal (that's not really news though). Multiple exterior probes in an interior with fade at 1 creates too many artifacts at the boundaries, and setting these probes to Interior nullifies exterior reflections. Exterior Reflection probe, fade at 0.5: Exterior reflection probe, fade at 1: Interior reflection probe. Exterior reflections are far less present: One exterior reflection probe for the bar, intersecting with the exterior reflection probe for the room. Both have a fade at 1. This artifact on the wood is too obvious and both probes would need to be interior instead: Couple important things I've noticed:
UPDATE: Proposal to change the probe bounds HERE. |
Definitely probe prioritization and depth cubemaps should be a must to have acuarte results. @clayjohn can you write a propsal (or comment in the OP proposal) about depth cubemaps since you know better what should be done? |
Is this PR dead? I'm a little worried considering that this (OR the depth cubemaps solution) is pretty important to have. |
Unfortunately since the Godot project does not have individual task prioritization or a comprehensive public-facing roadmap we have no idea. I have pushed for both in the past for this very reason. It doesn't matter how in-demand a feature is: either a core team member has to be interested enough to do it or an external contributor needs to come along and implement it themselves. In the case of the latter, there's a chance it could be stuck in yet-to-be-merged limbo for a while. I also consider this an important feature and as of right now, reflection probes aren't useful for mixed exterior/interior spaces. |
The default value of 0.5 makes reflections from ReflectionProbes more visible. To get the old behavior back, set Fade Start to 0.0.
774ddc2
to
d4dac0d
Compare
Rebased and tested again, it works as expected. I've implemented the feature in Compatibility as well, following #88056. |
BOOYAH! This will probably get marked as off topic, but I'm so glad this is not dead, considering how essential of a feature this is. I hope this is getting cherry picked once its done? |
As per the release policy, new features are not cherry-picked to previous releases to minimize the risk of regressions. |
I would argue for the opposite, a higher default value makes more sense. Especially with the context of the probe priority PR (#89408). Generally you'd want whatever is within the volume of a probe to be able to fully rely on that probe by default, and just want a bit of blending towards the probe borders to avoid a sudden obvious change. Since probe workflows very commonly involve having nested probes (for which we need probe priority), a small fade start would introduce a lot of duplicated reflections. A default factor of 0.5 means half of the area covered by the probe experiences those double reflections, which is essentially leakage from other probes, this is definitely something we'd want to minimize by default. I tried to demonstrate this in a test project, it is not an ideal demonstration due to probe prioritization not being implemented yet, however it shows the effect that would happen on these transition areas between probes: I also wanted to note that "band" of brighter reflections along the transition area is caused by the skylight getting blended in. This band should not be there once we have priority blending. Something like 0.75 seems like a more appropriate default value to me: You get a bit of blending at the borders as a smooth transition into the probe, and the majority of objects covered by that probe will receive clean (i.e. not double or blended) reflections. I do think part of the reason it might feel too aggressive is because for the ambient light from probes these higher values are in fact too aggressive as a default. I think it could be worth considering having a separate fade value for the ambient light, since ambient light is a much lower frequency effect compared to reflections. This would allow great artistic control of minimizing visible seams between nested probes (especially probes placed for detailing) where you'd still want the probe to take over reflections quickly (i.e. high-fade start), but want the ambient light influence to remain subtle and blend well with the "parent" probe. Lastly, I think it could make sense to rename and re contextualize this property. Fade start makes sense as a property name when you look at what happens under the hood, but I think from an artists POV it would be a more intuitive experience if 0 means no blending (sharp edge), and increasing this parameter increases this blending distance from the edge of the probe. The property could be name "blending" (Or reflection blending, ambient blending) Besides these things I've brought up: the behavior of the fade start works mostly as expected, though having non-cubic probes means there are inconsistencies with blending distances on the various sides of the probe. I could imagine this be an issue for things like alleyways, corridors, etc. |
I believe the concept of Fade Start is used in others places in Godot? Namely the distance fade option in lights, so maybe the name is approriate. |
@lander-vr Can you clarify whether the fade start property is needed because artists need finer control over how probes blend together, or is it needed simply to avoid the nasty artifacts that we currently get as a result of blending across the entire probe? Based on the discussion here and in godotengine/godot-proposals#3013 it seems to me like the real problem is not that fine-tuned blending is needed, but rather we need to give artists a way to avoid having the sky and other probes blend in to the center of the current probe. Accordingly, I feel like the solution would be:
The reason I ask is that this setting will reduce performance for every reflection probe and once we add it we can't take it back, even if we solve the root of the issue later. |
I think that's a different context. The probe itself as an object is not getting faded, there's also an extra parameter there called "begin". In this case there's also already a specific distance context: the bounds of the probe. I strongly believe presenting this parameter as a setting that "blends from the edges of the probe" is a much more intuitive UX for artists: number goes up -> you get more of the effect Edit: |
|
The default value of
0.5
makes reflections from ReflectionProbes more visible. This significantly reduces the notorious "sky is visible through solid objects in reflections" issue that people tend to notice when setting up reflection probes in Godot. If you set it to1.0
in an indoor scene, the issue should be entirely prevented now, provided the probe's origin is not within solid one-sided geometry.Please test this on more complex scenes to check if the proposed default value is actually a good idea. It may be a bit too aggressive; perhaps
0.2
would be a better fit.To get the old behavior back, set Fade Start to
0.0
.See godotengine/godot-proposals#3013.
Testing project: test_reflection_probes_mirage_palace.zip
Preview
Fade Start 1.0 is meant to be used when you have a single probe cover an entire room, so it's not the best fit for this situation, but here it is anyway for comparison purposes:
TODO