When a Megaplot scene is rendered, it should be the same irrespective of the devicePixelRatio, other than the expected effect of pixelation.
Currently however, when GeometricZoom has a value other than zero (the default), the contribution to rendered size differs depending on the devicePixelRatio.
The offending line is in the computeSize() function in the file shader-functions.ts:
The zoomScale variable currently does not take into account the devicePixelRatio, so when it is used to project the sizeWorld into pixel space, it produces different results for different devicePixelRatio values:
The answer is to incorporate the devicePixelRatio in such a way that when GeometricZoom is 0, the result is unchanged, but when GeometricZoom is 1, then the sizeWorld is effectively the same as a logical pixel:
When a Megaplot scene is rendered, it should be the same irrespective of the
devicePixelRatio
, other than the expected effect of pixelation.Currently however, when
GeometricZoom
has a value other than zero (the default), the contribution to rendered size differs depending on thedevicePixelRatio
.The offending line is in the
computeSize()
function in the fileshader-functions.ts
:The
zoomScale
variable currently does not take into account thedevicePixelRatio
, so when it is used to project thesizeWorld
into pixel space, it produces different results for differentdevicePixelRatio
values:The answer is to incorporate the
devicePixelRatio
in such a way that whenGeometricZoom
is 0, the result is unchanged, but whenGeometricZoom
is 1, then thesizeWorld
is effectively the same as a logical pixel:Make this change and add pixel-color tests to assert that the size computation is correct.