File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
packages/front/src/core/PostproductionRenderer/src Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,12 @@ export class EdgeDetectionPass extends Pass {
3333
3434 private _mode = EdgeDetectionPassMode . DEFAULT ;
3535
36+ /**
37+ * When enabled, invisible materials still produce edges,
38+ * giving an X-ray effect where hidden geometry is shown as outlines.
39+ */
40+ xray = false ;
41+
3642 get mode ( ) {
3743 return this . _mode ;
3844 }
@@ -280,9 +286,15 @@ export class EdgeDetectionPass extends Pass {
280286 if ( "isLODGeometry" in mesh . geometry ) {
281287 continue ;
282288 }
289+
283290 if ( apply ) {
284291 mesh . userData . edgePassPreviousMaterial = mesh . material ;
285- mesh . material = [ this . _overrideMaterial ] ;
292+ // Single material bypasses geometry groups, so all triangles
293+ // produce edges (xray). Array respects groups, so only
294+ // visible groups produce edges (normal).
295+ mesh . material = this . xray
296+ ? this . _overrideMaterial
297+ : [ this . _overrideMaterial ] ;
286298 } else if ( "edgePassPreviousMaterial" in mesh . userData ) {
287299 mesh . material = mesh . userData . edgePassPreviousMaterial ;
288300 }
You can’t perform that action at this time.
0 commit comments