You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SpriteMaterial (and others such as PointsMaterial) has a sizeAttenuation flag which can be set to false to make sure the sprite maintains the same size on screen no matter where the camera is placed. This is very convenient to display cursors etc. in Three.js.
When switching to node materials, this option is unfortunately missing from SpriteNodeMaterial.
I wonder whether this could be added?
Solution
Add a sizeAttenuation variable on SpriteNodeMaterial that works like sizeAttenuation on SpriteMaterial. Here's an example of how it could be used: jsfiddle-latest-release WebGPURenderer
The problem with this approach is that there's a difference between the displayed sprite size in a PerspectiveCamera vs an OrthographicCamera, which wasn't a problem with sizeAttenuation: false in SpriteMaterial.
Additional context
No response
The text was updated successfully, but these errors were encountered:
Description
SpriteMaterial
(and others such asPointsMaterial
) has asizeAttenuation
flag which can be set to false to make sure the sprite maintains the same size on screen no matter where the camera is placed. This is very convenient to display cursors etc. in Three.js.When switching to node materials, this option is unfortunately missing from
SpriteNodeMaterial
.I wonder whether this could be added?
Solution
Add a
sizeAttenuation
variable onSpriteNodeMaterial
that works likesizeAttenuation
onSpriteMaterial
. Here's an example of how it could be used: jsfiddle-latest-release WebGPURendererAlternatives
The problem with this approach is that there's a difference between the displayed sprite size in a
PerspectiveCamera
vs anOrthographicCamera
, which wasn't a problem withsizeAttenuation: false
inSpriteMaterial
.Additional context
No response
The text was updated successfully, but these errors were encountered: