You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, objects can be added to the OutlineEffect's selection array in order to be rendered with an outline. The outline is either "on" or "off", with whatever opacity settings that may be provided at instantiation of the OutlineEffect itself (i.e. opacity affects all objects).
Describe the solution you'd like
Would it be possible to add an opacity setting to individual objects? For example, rather than merely adding Object3Ds to the selection array, perhaps a javascript object with per-Object3D parameters could be passed? e.g.
// At initialization:constoutlineEffect=newOutlineEffect(this.scene,this.camera,{ ... });constcube=newMesh(newBoxGeometry(1,1,1),newMeshBasicMaterial());
...
// Later:this.outlineEffect.selection.push({object: cube,opacity: 0.5});// Even later:this.outlineEffect.selection[0].opacity=0.1;
Describe alternatives you've considered
I could create many OutlineEffect layers with pre-configured opacity, but when the number of objects combined with the opacity settings is large, the number of effect passes increases exponentially.
Additional context
As an example, I'd like to make the outline around this lamp "fade in" gently when selected, then "fade out" when deselected:
There are a number of ways the current OutlineEffect implementation could be improved, especially in terms of performance and visual quality. Supporting per-object opacity would be nice, but figuring out if and how that's possible requires further research. I'm currently prioritizing other issues in postprocessing, some of which will make it easier to implement features like this one. In that sense, let's keep this ticket open and revisit it later.
Activity
vanruesc commentedon Mar 2, 2022
There are a number of ways the current
OutlineEffectimplementation could be improved, especially in terms of performance and visual quality. Supporting per-object opacity would be nice, but figuring out if and how that's possible requires further research. I'm currently prioritizing other issues inpostprocessing, some of which will make it easier to implement features like this one. In that sense, let's keep this ticket open and revisit it later.canadaduane commentedon Mar 2, 2022
I sure appreciate your work. Thanks for the insights & for keeping this as a tracker for potential improvement.
canadaduane commentedon Jul 4, 2022
A related feature request: per-object outline color (e.g. red outlines vs white outlines on the same pass).
vanruesc commentedon Jul 4, 2022
I'll put it on the outlines revamp feature list 😅
vanruesc commentedon Aug 21, 2025
Folding this into #727