-
Notifications
You must be signed in to change notification settings - Fork 3.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
Don't allow picking on the sunPostProcess framebuffer. #5496
Conversation
Please update CHANGES.md |
@bagnell Also, it's concerning that picking would "stay broken" even after this code switched back to using the globeDepth framebuffer. Is switching framebuffers here somehow unsafe for picking? |
It will default to whatever the pass state framebuffer is. When picking, it will be the picking framebuffer. If the pass state framebuffer is undefined, it'll render to the default framebuffer (directly to canvas).
Yes, during the pick pass it should never switch framebuffers. All of the post processing and globe depth copying should be disabled when picking. |
Source/Scene/Scene.js
Outdated
@@ -2468,7 +2468,7 @@ define([ | |||
scene._fxaa.clear(context, passState, clearColor); | |||
} | |||
|
|||
if (environmentState.isSunVisible && scene.sunBloom && !useWebVR) { | |||
if (environmentState.isSunVisible && scene.sunBloom && !useWebVR && !picking) { |
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 this is the right fix. The condition should always evaluate to false when picking. All of the environment should not render and all post processing should be disabled when frameState.pick
is true
.
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.
Maybe the environment isn't being updated correctly? The commit that caused this (a9a275f) changes the location of the environment update.
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.
And, notably, the offending commit didn't touch the line I've changed here. It remotely changed the results of this if
check.
During my testing, I added |
I think it might be updating correctly but out of order? If you look at if (!frameState.passes.render) {
return undefined;
} That would cause
That's strange, if you look several lines up you'll see this: |
Oh, I didn't limit my console logging to just the pick pass, fixed now. So yes, in master, the pick pass chooses either Sun bloom (the first clause, when the Sun is visible in the frame), or it falls past all three conditionals to leave the framebuffer alone (skipping over globe depth and fxaa). This means that once the Sun comes into view, the pick framebuffer is permanently set to the Sun Bloom post-process one, permanently breaking picking even after the Sun goes away, which is the observed behavior. |
Ah, OK, I found the real issue. The environment state is never updated on a pick. We simply need to call |
Actually I added the call in two places, is this OK? |
Yup, thanks @emackey! |
Fixes #5478.
Likely fixes #5402.
/cc @bagnell @AnneWoepse
@bagnell I'm curious about the
if
block I'm modifying here. It has twoelse if
clauses which could possibly both be false. What happens if all three paths go false at the same time? Seems like the framebuffer would not be assigned, would it have a reasonable default?