drei icon indicating copy to clipboard operation
drei copied to clipboard

Svg component overwrites render order from props

Open audapter opened this issue 1 year ago • 1 comments

  • @react-three/drei version: v9.109.3

Problem description:

The svg patch in v9.109.3 overwrites the renderOrder with a value between 0 and the number of paths in the svg. Having a model with complex transparency that is highly dependent on render order, I had to do a workaround to restore render order. I'm looping over my svg materials and setting the render order to my specific preferred value every time my svg have updated its materials.

Relevant code:

See Svg.tsx lines 42, 53 and 69 in v9.109.3

Suggested solution:

If renderOrder is supplied - set the same renderOrder on every material, otherwise iterate as it's done today, or do something more clever.

audapter avatar Oct 24 '24 14:10 audapter

also experiencing this issue, specifically with strokes no longer rendering

for my case, i had to pass depthTest: false to strokeMaterial in order for the stroke to become visible again

opeologist avatar Feb 27 '25 16:02 opeologist