Occluding line depth puzzle?

Hi, I have a visual issue I’m trying to solve. Essentially I need to have to have two spheres connected via a tube. I need the tube to ‘visually’ always be behind the spheres, I can achieve this with two separate geos, then turn off ‘Depth Test’ in the constant material for the tube. That’s great until I instance it and start to rotate around, then you realise all spheres are above all lines. I tried with a GLSL mat but failed. Attaching a basic toe setup with the depth test off on the tube constant, if you flick it on you can see how all the spheres are above all lines which is not what we need, but when it’s off you can also see how on the furthest away spheres jump above their own line which is what we need. Tried a ton of different approaches, it’s beyond me. Has anyone come across this before?
BallsLines.toe (6.8 KB)

Hi @chrisischris,

The Line MAT would come in handy here as it allows for drawing the Lines as well as Points. In case of Points you can also choose to draw them as Spheres.

This simplifies your network quite a bit as you only need to instance a Line SOP, the rest is done with the Line MAT itself.

See attached as an example.

cheers
Markus
BallsLines_LineMAT.toe (5.9 KB)

Hi Markus, thanks for the reply.

Interesting way of doing it, but later on (toe was simplified) this goes into 360 so not sure LineMAT will work. The main problem we are trying to solve was how to keep each line/tube behind the it’s two spheres visually to the viewer/camera, whilst still being able to instance it and not have all spheres above all lines.

Any ideas would be appreciated?

Cheers, Chris