-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Added pixelRatio parameter to camera and the frustum objects #8237
Conversation
Thanks for the pull request @IanLilleyT!
Reviewers, don't forget to make sure that:
|
Before merging this PR make sure to add all the fixed CSS pixels bugs in |
52d42af
to
183b56a
Compare
@lilleyse I made some changes. Now camera uses its own scene's pixel ratio, so the Camera.getPixelSize function signature is the same as pre-PR. Anything that needs the more custom behavior can use camera.frustum.getPixelDimensions and pass in its own pixel ratio. |
@IanLilleyT @lilleyse what's the status of this? Are we trying to get this in for the release? |
Yes the plan is to get into the release - I'm good with everything here just need to do some final testing and review. Thanks for the reminder @hpinkos. |
@IanLilleyT looks good. Write an issue to remove the deprecated function definitions and add the 1.65 label. See #8183 for an example. |
Here's the issue for the deprecation: #8320 |
Another CSS pixel fix for #8113
All frustums have a
getPixelDimensions
function that didn't account for different pixel density displays. So this PR adds a newpixelRatio
parameter to these functions. Most systems should pass inframeState.pixelRatio
to get a value in css pixels. This fixes a few different files that use minimum/maximum pixel size, includingBillboardCollection
,Model
,Primitive
, andPointPrimtiveCollection
. This before and after are particularly noticeable on high dpi displays. Toggle the resolution checkbox. In the new version the model stays the same size.Note:
Picking.getPickOrthographicCullingVolume
andPicking.getPickPerspectiveCullingVolume
pass in1.0
instead ofscene.pixelRatio
because picking wants to select from a physically smaller region on higher density screens (aka work with native device pixels instead of css pixels)