-
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
Fix shadowed models in 2D #4382
Conversation
… is allowed. One for just OIT in 2D and one with OIT + shadows for 3D/CV.
derivedCommands.oit = oit.createDerivedCommands(command, context, derivedCommands.oit); | ||
} | ||
if (lightShadowsEnabled && command.receiveShadows) { | ||
derivedCommands.oit.shadows = oit.createDerivedCommands(command.derivedCommands.shadows.receiveCommand, context, derivedCommands.oit.shadows); | ||
} |
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.
Similarly I think this area can be
if (lightShadowsEnabled && command.receiceShadows) {
create derivedCommands.oit.shadows
} else {
create derivedCommands.oit
}
@@ -525,6 +527,9 @@ define([ | |||
var framebuffer = passState.framebuffer; | |||
var length = commands.length; | |||
|
|||
var shadowsEnabled = scene.frameState.shadowHints.shadowsEnabled; | |||
var scene2D = scene.mode === SceneMode.SCENE2D; |
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.
You don't have to check for SCENE2D here - scene.frameState.shadowHints.shadowsEnabled
will be false if the scene isn't 3D.
Tested and the code looks good to me, @pjcozzi do you want to take a look? |
@bagnell update CHANGES.md in master. |
Creates two sets of derived OIT commands when changing the scene mode is allowed. One for just OIT in 2D and one with OIT + shadows for 3D/CV.
Fixes #4378.
CC @pjcozzi @lilleyse