Skip to content

Conversation

@sunag
Copy link
Collaborator

@sunag sunag commented Dec 12, 2024

Related issue: #29555 (comment), #29659 (comment)

Description

The PR fixes the SpriteMaterial fog and brings some improvements related to MVP and Vertex.

  • Fix fog in SpriteMaterial and SpriteNodeMaterial
  • NodeMaterial: Add .setupPositionView()
  • NodeMaterial: Add .setupVertex()
  • modelViewProjection is a const now instead of a function like modelViewProjection()
  • Add mediumpModelViewMatrix
  • Rename highPrecisionModelNormalViewMatrix -> highpModelNormalViewMatrix
  • Rename highPrecisionModelViewMatrix -> highpModelViewMatrix

@sunag sunag added this to the r172 milestone Dec 12, 2024
@github-actions
Copy link

github-actions bot commented Dec 12, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 339.21
79.01
339.21
79.01
+0 B
+0 B
WebGPU 486.3
134.97
486.18
134.92
-123 B
-54 B
WebGPU Nodes 485.76
134.87
485.64
134.82
-123 B
-52 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 465.1
112.06
465.1
112.06
+0 B
+0 B
WebGPU 555.41
150.39
555.32
150.35
-91 B
-46 B
WebGPU Nodes 511.26
140.1
511.23
140.11
-30 B
+5 B

@sunag sunag marked this pull request as ready for review December 12, 2024 07:24
@mrdoob
Copy link
Owner

mrdoob commented Dec 12, 2024

Maybe we can follow use WebGL's lowp, mediump and highp?

lowpModelViewMatrix
mediumpModelViewMatrix
highpModelViewMatrix

@sunag sunag merged commit 0d57860 into mrdoob:dev Dec 12, 2024
12 checks passed
@sunag sunag deleted the dev-vertex branch December 12, 2024 17:57
0b5vr added a commit to pixiv/three-vrm that referenced this pull request May 16, 2025
We can't use `positionView` in `setupPosition` because using `positionView` there will make it calculate the `positionView` earlier and it won't be calculated again after setting the `positionNode`
It might be an unexpected bug on the Three.js side...?
It caused by mrdoob/three.js#30108 I think
0b5vr added a commit to pixiv/three-vrm that referenced this pull request May 21, 2025
We can't use `positionView` in `setupPosition` because using `positionView` there will make it calculate the `positionView` earlier and it won't be calculated again after setting the `positionNode`
It might be an unexpected bug on the Three.js side...?
It caused by mrdoob/three.js#30108 I think
0b5vr added a commit to pixiv/three-vrm that referenced this pull request May 27, 2025
We can't use `positionView` in `setupPosition` because using `positionView` there will make it calculate the `positionView` earlier and it won't be calculated again after setting the `positionNode`
It might be an unexpected bug on the Three.js side...?
It caused by mrdoob/three.js#30108 I think
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants