Skip to content

OutlinePass does not support InstancedMesh #18533

@anthonysimone

Description

@anthonysimone
Description 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.

  1. 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.
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions