-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
base: master
Are you sure you want to change the base?
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 |
@Calinou The issue seems to be fixed. I love the result. Much more artistic control and blend happen more natural between inside and outside. |
2cfc14e
to
c4c72d0
Compare
@Calinou is this ready to merge? |
This needs a final review from other rendering contributors (I can't merge my own PRs). |
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. |
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