Skip to content
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

Merged
merged 4 commits into from
Sep 29, 2016
Merged

Fix shadowed models in 2D #4382

merged 4 commits into from
Sep 29, 2016

Conversation

bagnell
Copy link
Contributor

@bagnell bagnell commented Sep 29, 2016

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

… 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);
}
Copy link
Contributor

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;
Copy link
Contributor

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.

@lilleyse
Copy link
Contributor

Tested and the code looks good to me, @pjcozzi do you want to take a look?

@pjcozzi
Copy link
Contributor

pjcozzi commented Sep 29, 2016

@bagnell update CHANGES.md in master.

@pjcozzi pjcozzi merged commit 6b22c76 into master Sep 29, 2016
@pjcozzi pjcozzi deleted the disable-2D-shadows branch September 29, 2016 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants