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 setViewport & setScissor pixelRatio bug #11445

Merged
merged 2 commits into from
Jun 6, 2017
Merged

Conversation

06wj
Copy link
Contributor

@06wj 06wj commented Jun 5, 2017

The current setBiewport&setScissor is not multiplied by pixelRatio.

@@ -2675,7 +2677,7 @@ function WebGLRenderer( parameters ) {
state.scissor( _currentScissor );
state.setScissorTest( _currentScissorTest );

state.viewport( _currentViewport );
!window.xx && state.viewport( _currentViewport );
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... What's this test for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, i forgot remove debug code

@mrdoob
Copy link
Owner

mrdoob commented Jun 6, 2017

Hmm, I wonder why the current examples that use setViewport() and setScissor() don't render incorrectly. Do you have a test case showing the bug?

@06wj
Copy link
Contributor Author

06wj commented Jun 6, 2017

@mrdoob It just looks right. Because setViewport first sets viewport to the wrong value and then resets to the correct value in this line.
It will call gl.viewport twice.

@mrdoob
Copy link
Owner

mrdoob commented Jun 6, 2017

Because setViewport first sets viewport to the wrong value and then resets to the correct value in this line.
It will call gl.viewport twice.

Interesting...

@mrdoob mrdoob merged commit ab5bcc4 into mrdoob:dev Jun 6, 2017
@mrdoob
Copy link
Owner

mrdoob commented Jun 6, 2017

Thanks!

@06wj 06wj deleted the patch-pixelRatio branch June 7, 2017 02:35
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.

2 participants