SpriteNodeMaterial: Honor sizeAttenuation for perspective camera only#31628
SpriteNodeMaterial: Honor sizeAttenuation for perspective camera only#31628WestLangley merged 2 commits intomrdoob:devfrom
sizeAttenuation for perspective camera only#31628Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
I think we should discuss here before merging why #29517 is reverted. Just saying "it has been a policy so far" isn't sufficient to me, tbh. Why is it an issue to have size attenuation for orthographic cameras? I understand the feature is coupled to how perspective works but for artistic purposes it's nice to have this feature for orthographic cameras as well. @RenaudRohlinger What was your motivation to add size attenuation for orthographic cameras? |
|
Orthographic cameras do not size attenuate by definition. Furthermore, #29517 is using it to mean something else. Quoting the OP,
|
|
I agree with WestLangley - the concept or wording of "sizeAttenuation" does not make sense for an orthographic camera (I've also never been a huge fan of the API here anyway since it's not clear about the scales). #31630 is a more sensible solution to this problem, imo.
The clarity and sensibility of three.js' API has long been one of its strengths imo and the concept of size attenuation does not make sense for an orthographic projection. The previous changes strikes me as a spot fix to enable a use case without considering the understandability of the flag and instead I think that ensuring API changes are clear and understandable should be encouraged. |
|
Yay! We have agreement! Merging, to get WebGLRenderer and WebGPURenderer to match. |
Reverts #29517.
The
sizeAttenuationproperty only applies when rendering with a perspective camera (see docs). This has been a policy since the early days of three.js.It probably should have been named
.perspectiveSizeAttenuationfor clarity.In any event, the current goal is to match
WebGLRenderer's output, and this PR does that. We can discuss API changes in another PR.