Suggestion: Add points to Mesh*Material for gl.POINTS drawing
Description of the problem
What do you folks think of adding .points property to Mesh*Material for gl.POINTS drawing?
If .points is true, render with gl.POINTS mode. It's similar to .wireframe.
I needed this when I worked on SkinnedMesh with particles. I couldn't use THREE.Points because model requires skinning.
https://twitter.com/superhoge/status/914785053661712384 https://twitter.com/superhoge/status/914786091332505600
Three.js version
- [x] Dev
- [ ] r87
- [ ] ...
Browser
- [x] All of them
- [ ] Chrome
- [ ] Firefox
- [ ] Internet Explorer
OS
- [x] All of them
- [ ] Windows
- [ ] macOS
- [ ] Linux
- [ ] Android
- [ ] iOS
Hardware Requirements (graphics card, VR Device, ...)
Hmm what about a drawMode attribute? Values possible would be WIREFRAME, POINTS or TRIANGLES or something similar.
Would be a better approach than having multiple boolean flags, and can be easily poly-filled for compatibility with old code.
Is adding skinning/morph support to PointsMaterial what you are looking for?
@tentone
It might be also ok.
(We might need to reconsider where peoperty specifying draw mode should be, in Mesh(Object3D) or in Material?)
@WestLangley
If I'm right, the combination of (Skinned)Mesh and PointsMaterial doesn't draw with gl.POINTS mode.
In the current implementation, only Points can be drawn with gl.POINTS mode
@takahirox Yes, we would have to fix that somehow, if we were to add skinning/morph support to PointsMaterial.
@WestLangley
In my case, I use ShaderMaterial so I need gl.POINTS drawing mode property in it.
But maybe having skinning/morph support in PointsMaterial would satisfy the users who just wanna render SkinnedMesh with gl.POINTS.
But maybe having skinning/morph support in PointsMaterial would satisfy the users who just wanna render SkinnedMesh with gl.POINTS.
That would probably also require a SkinnedPoints class -- in addition to adding morph target support.
If that is not appealing, then the proposal by @takahirox to add a .points property similar to .wireframe is a possibility.
Probably SkinnedPoints would be good enough in my case.
@mrdoob Do you agree with adding SkinnedPoints?
/ping @mrdoob
The new node material provides a beautiful solution for this use case: https://threejs.org/examples/webgpu_skinning_points
I would prefer a node material solution rather than introducing SkinnedPoints or having an additional points material property.
The new node material provides a beautiful solution for this use case
Were you able to get that to work with WebGLRenderer?
webgpu_skinning_points also works with WebGL thanks to WebGLBackend (just test the example with Firefox or Safari). The node material provides a solution for both WebGPU and WebGL.
Certain features are hard or inconvenient to implement with WebGLRenderer due to its architecture. It makes more sense to support things like selective lighting, per-instance uniforms or skinned points just with WebGPURenderer. So I think this issue can be closed.