-
-
Notifications
You must be signed in to change notification settings - Fork 35.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
EffectComposer: Introduce .setPixelRatio() and harmonize resizing. #16404
Conversation
Thanks! |
EffectComposer has nothing to do with CSS and should not be sized in CSS units. |
@@ -244,7 +244,7 @@ | |||
camera.updateProjectionMatrix(); | |||
|
|||
renderer.setSize( window.innerWidth, window.innerHeight ); | |||
composer.reset(); | |||
composer.setSize( window.innerWidth, window.innerHeight ); |
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.
As is was before.
composer.reset()
should auto-size the composer based on the renderer's drawing buffer size.
A pixel ratio is not appropriate. |
This PR should be reverted, and then I think you can get the feature you want easily.
|
I see this different. The user-level code is now much easier to comprehend. |
You said #16393 (comment) that we could discuss this issue in this PR. I was not given an opportunity to express my view. |
I have pointed out that is not true. In fact, it is more complicated than it needs to be. Pixel ratio does not make sense for the composer as it is not sized in CSS pixel units. The composer has been designed to auto-size to the render's drawing buffer size, which is in device pixels, as it should be. It should size automatically when it is created and when the window is resized. To accommodate users who want to size the composer differently, we have That is all that is needed. |
I think your point of view is just a different interpretation of BTW: I find the term CSS/device pixels very confusing. Eventually, pixel ratio is nothing else than a scale factor and |
You shouldn't be using pixel ratio then. DPR has units of (physical pixels per logical pixel) and has no bearing on
The approach prior to this PR is valid. What you have implemented here is not valid and should be reverted. |
The overall usage of TBH, I'm a bit disappointed that you don't understand the simplification this PR introduces for app-level code. And I don't buy your argumentation with physical pixels per logical pixel since it's just a different view on the same thing: Pixels and scale factors. I don't see why |
Ops! Sorry for not giving a window to discuss this. I'm a bit busy this week (for the last few weeks really...) but I'll take a look as soon as the storm is over. |
Successor of #14340
EffectComposer.setPixelRatio()
provides more flexibilty rather than using the pixel ratio of the renderer in all cases. The parameters ofEffectComposer.setSize()
andWebGLRenderer.setSize()
now have the same unit.