OutlinePass does not support InstancedMesh
See original GitHub issueDescription of the problem
OutlinePass
does not appear to properly support InstancedMesh
. I’ve created an example here that uses the same setup of OutlinePass
in the example in the docs. The sphere is a regular Mesh
and the squares are the instances of InstancedMesh
.
https://jsfiddle.net/anthonysimone/dL8s2qmv/
It seems like there’s a couple things going on here.
- If you hover over the regular mesh first (sphere), then one of the instanced mesh instances, the base position of the
InstancedMesh
is outlined any time you’re hovering over any of the instances. In the above example all of the instances have been moved from the default position to demonstrate this clearly. - If you first hover over any of the box instances, the entire collection of instances (though not the base position) of the
InstancedMesh
are outlined, but then hovering over a regular mesh (the sphere) causes an error.
I dug into OutlinePass
a bit and it seems like it might just not be taking into account handling instanced meshes separately from regular meshes. I’m still pretty new to Three.js, so I don’t have a potential fix to suggest at this point.
Three.js version
- r113
Browser
- All of them
- Chrome
- Firefox
- Internet Explorer
OS
- All of them
- Windows
- macOS
- Linux
- Android
- iOS
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
three.js - ThreeJS: native Antialias not working with Outline ...
I'm working on a project that uses a lot of lines and marks with the camera at a very low angle (almost at...
Read more >OutlinePass does not show correctly - Questions - three.js forum
Dear All, This is my code below, but the outline didn't show correctly~~~~ The outline only show if the no overlapping part between...
Read more >import LOCAL .obj to load with Three.js OBJLoader using ...
I figured it out. In the webpack config I changed the .obj loader, from 'file-loader' to 'url-loader' const rules = [ { test:...
Read more >[Tutorial] Adding outline detailing to meshes in Three.js with ...
Copy link. Info. Shopping. Tap to unmute. If playback doesn't begin shortly, try restarting your device. Your browser can't play this video.
Read more >mrdoob/three.js r144 on GitHub - NewReleases.io
Support HSL(A) with decimal percentage values. #24461 (@Mugen87) ... Add support for InstancedMesh . ... Editor. Do not call .update() for skeleton helpers....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed via #20135, see https://jsfiddle.net/quf0p415/1/.
No runtime errors occur anymore. Point 1 of the original post is solved. Also the artifact mentioned in https://github.com/mrdoob/three.js/issues/18533#issuecomment-581782781. Point 2 is partially solved since all instanced meshes are highlighted when one is selected. But that is an acceptable behavior for now since some use cases require it anyway. A solution for individual highlighting is explained here: https://github.com/mrdoob/three.js/issues/18533#issuecomment-581782781
@mrdoob I guess this is a good example of what you mean in https://github.com/mrdoob/three.js/pull/20975#issuecomment-805349659. By removing
skinning
, the same effect would be achieved and a singleoverrideMaterial
can be used for normal, instanced and skinned meshes 🎉 .Yes 😉