-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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 reflection mask to reflection probes #50196
Conversation
The fact that cull_mask was being used for both jobs in master was a bug. The "layer" property was used in 3.x to determine what objects receive light from the reflection probe and the cull mask was just used to determine which objects get rendered into the reflections. IMO we should keep the behaviour the same as it was in 3.x. |
Yup, working on a new PR that does just that fix |
Okay, monkey wrench into this one @clayjohn, turns out we don't have access to the layer mask where we need to. Basically the two calls to But as the layer mask is stored on the associated VisualInstance and as a probe in theory can belong to multiple instances (I doubt it ever does) we don't actually have any methods to obtain this mask as we don't know for which instance we're handling the probe. @reduz promised to have a closer look at this tomorrow. |
Famous quote :P Might be worth poking at again soon. |
Any chance this is going to get looked at again in the near future? |
I just tested in 3.x, the layers only determine if the probe should render at all depending on if it's part of the camera's cull mask. Is that not what it's intended to do? Or was it broken since you wrote that?
I wrote a quick and dirty fix over here if you need the 3.x behavior back urgently, but based on the above I'm not sure that's right either. |
What is the status of this? |
Also, maybe related, but I was wondering if it could be implemented a way of |
This comment was marked as off-topic.
This comment was marked as off-topic.
@IPlayKindred Please don't bump without contributing significant new information. Use the 👍 reaction button on the first post instead. Just poking the issue without having something constructive isn't, well, constructive. |
Superseded by #86073. |
The
cull_mask
property on reflection probes had a double function that did not make sense.Rarely do you want to have an object reflect onto itself so a likely use case is where you'd want to exclude the object that gets reflections from being rendered to the probe. But due to this combined function that was impossible.
The documentation stated that it should be doing 1 and never mentioned 2 however seeing that for all other objects that have a
cull_mask
(i.e. lights and decals)cull_mask
behaves as defined at 2 I've chosen to split off 1 into a separate property.This PR introduces a new property called
reflection_mask
that determines which layers are rendered to the probe.Using the material tester demo I've added a reflection probe to the mirror ball:
Note that the mirror ball itself has been placed into layer 2
The result is proper reflections onto the mirror ball:
Fixes #50195