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

PMREMGenerator: Fix viewport/scissor settings. #18447

Merged
merged 1 commit into from
Jan 22, 2020
Merged

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Jan 21, 2020

This should fix the broken PMREMGenerator on dev (for computer with device pixel ration > 1).

@elalish When using WebGLRenderer.setViewport(), the viewport is automatically multiplied with the device pixel ratio e.g.:

state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).floor() );

However, when you directly set WebGLRenderTarget.viewport and WebGLRenderTarget.scissor, it's not necessary to divide through the device pixel ratio because it's not respected in WebGLRenderer.setRenderTarget().

_currentViewport.copy( renderTarget.viewport );
_currentScissor.copy( renderTarget.scissor );

@Mugen87 Mugen87 changed the title PMREMGenerator: Fix viewport settings. PMREMGenerator: Fix viewport/scissor settings. Jan 21, 2020
@Mugen87 Mugen87 added this to the r113 milestone Jan 21, 2020
@WestLangley
Copy link
Collaborator

Pixel ratio does not apply to WebGLRenderTarget.

@Mugen87 Mugen87 force-pushed the dev11 branch 2 times, most recently from e5ca25c to 5e8c279 Compare January 22, 2020 09:53
@Mugen87
Copy link
Collaborator Author

Mugen87 commented Jan 22, 2020

Updated the PR to resolve the dependency to Vector4.

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Jan 22, 2020

Merging and updating builds for further testing.

@Mugen87 Mugen87 merged commit 9772d31 into mrdoob:dev Jan 22, 2020
@Mugen87
Copy link
Collaborator Author

Mugen87 commented Jan 22, 2020

The issue is fixed on my Pixel, too.

@mrdoob
Copy link
Owner

mrdoob commented Jan 22, 2020

Thanks!

@elalish
Copy link
Contributor

elalish commented Jan 23, 2020

@Mugen87 Thanks! Sorry the DPR thing caught me yet again...

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.

None yet

5 participants