-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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 Blend Distance property to ReflectionProbe #99958
Add Blend Distance property to ReflectionProbe #99958
Conversation
b9ac141
to
755e323
Compare
Looks awesome. I notice that you can blend above the bounds of the probes. Is that correct? I tried and I got nice results but I wonder why above the bounds |
I don't think limiting the property based on the size of the box really gives any UX improvements, if anything it could lead to unwanted changes of that value if the user accidentally makes the bounding box smaller than the max blending distance for those bounds. It would also feel needlessly restrictive, in my opinion. The actual blending is 24_12_03_15_02__godot.windows.editor.x86_64_JzzmqvKW5A.mp4 |
755e323
to
b9ba4b8
Compare
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.
Tested locally, it works as expected in Forward+ and Mobile. This new blending makes a lot more physical sense overall.
Testing project: test_reflection_probes_mirage_palace.zip
master |
This PR |
---|---|
Additionally, this allows for better fake area lights using bright custom ambient colors:
In Compatibility, I get a shader compilation error and the scene looks fully white. This doesn't occur in master
.
ERROR: SceneShaderGLES3: Fragment shader compilation failed:
0(1085) : error C1503: undefined variable "reflections"
0(1085) : error C1503: undefined variable "ref_index"
0(1087) : error C1503: undefined variable "reflections"
0(1087) : error C1503: undefined variable "ref_index"
The only visual change I see using blender distance further is that you control how much of the sky blends. But maybe we can have a separate slider to control how much the sky blends when using |
b9ba4b8
to
3d06b31
Compare
Should be fixed now! :) |
3d06b31
to
2945d91
Compare
Maybe its the expected behavior but it feel strange to go beyond the limits of the probes. Like in my mind I dont know what it means to blend further that. Like I said, the only thing I notice was the sky. To me, if the probe is only 1x1x1m, the maximum blend distance should be .5m. But I like better the unity approach that is with a float value from 0 to 1. Meaning 0 not blending at all and 1 the maximum distance from the center of the probe. Does it make sense in this case? |
I'll add a bit more context in the tooltip.
This is strange, I cannot reproduce this. Once the blend distance reaches it's internal limit, there's no visual change for me when going far beyond that value. Looking at it pragmatically though, I don't think it matters too much. In normal use cases the blend range will only be a small part of the box.
I think this is mostly a case of getting used to this behavior if you're unfamiliar with it. In the end they're not vastly different. |
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.
It works great in Compatibility now 🙂
ec551b3
to
f39662f
Compare
f39662f
to
0501018
Compare
Rebased to resolve conflict. :) |
Thanks! |
Supersedes #61416
This PR adds the "Blend Distance" property to reflection probes. This parameter is exposed to offer artists control over how quickly a reflection probe blends into the scene.
Some context on why this property is necessary: #61416 (comment)
This PR builds on @Calinou's initial work, however I've entirely reworked how the blend parameter is calculated and smoothed.
This is for two reasons:
Blend Distance is a float representing the length of the blend in meters, with a default range of 0 to 8, or greater.
I've added an interior wireframe to display the extends of the blend-distance within the AABB of the main probe. This makes it clear at what point the blending stops, and where the probe emits "full strength". (For the sake of presentation, I commented out the lines between the corners and center_offset for this GIF, this would be the case if #99920 gets merged)
Wall test scene, replication of the example scenario I gave in the context comment:
Comparison of the same scene to 4.3:
Unadjusted probes have the same bounds as in the PR.
Adjusted probes have enlarged bounds, which is why the wall in the adjusted probes get stronger reflections. However, since this needs to happen on both sides of the wall to accommodate for the view from that side, you get bleeding.
Notice how despite that adjustment and being well within the bounds of the probe, the wall is still significantly darker due to not receiving full reflection strength.