Aline: different lineOpacityBehindObjects per line

I am trying to use different lineOpacityBehindObjects settings per line.

Due to my use case, some lines need to have this set to 0 and other lines need it set to the default value of 0.12f.

I have spent time digging in the code and it appears that DrawingData draws all Meshes with Meshtype.Line using the same lineOpacityBehindObjects settings.

Is it possible to achieve what I want out of the box?

If not then how should I modify Aline to achieve what I’m looking for?

So far here are my current lists of possible ways to achieve this . . . if that is the only way:

  1. Add a new Meshtype called “Line2”: This seems complicated, tracing the code from when you call draw.line to when the mesh type is assigned and then the type is used in DrawingData.Render is a long chain and seems prone to me messing something up
  2. Add new PopLineOpacity and PushLineOpacity commands: This appears to be the preferred way to modify parameters of meshes with the same meshtype to draw differently. My instinct tells me this is the best way to do this.

Any guidance with whether I should use Method 1 or 2 and how best to achieve it would be incredibly helpful.

Thanks for the help!


  1. Definitely doable, but you may have to do a lot of plumbing to get the infromation to where it needs to go. And even then, you’ll only be able to do this per CommandBuilder, not per line.
  2. This will not be possible directly, because the shader has no way to get this information, without adding another uv or color channel to store this information in (totally doable, I suppose). Though, this may be the easiest solution to implement.

Thanks for the reply.

I’m filing this as something not worth fixing at the moment but if I revisit this in the future I will take approach #2 based on your guidance.


1 Like