LDraw.org Discussion Forums
Drawing conditional lines - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: Models and Parts (https://forums.ldraw.org/forum-18.html)
+--- Forum: Parts Authoring (https://forums.ldraw.org/forum-19.html)
+--- Thread: Drawing conditional lines (/thread-9015.html)

Pages: 1 2

Re: Drawing conditional lines - Roland Melkert - 2013-05-10

This is because alpha blending is applied to the pixel color that's present at the time of rendering the transparent poly. If you draw something else later on that's further away gl will ignore it based on the z buffer.

To prevent this you need to render all solid things before you render any transparent stuff. You also might need to sort individual poly/parts when using multiple transparent colors in a single scene. If you don't do that the colors won't blend naturally.

Re: Drawing conditional lines - Steffen - 2014-11-28

I found these links insightful about cond lines:

Re: let's make this thread sticky - Tim Gould - 2014-11-28

Done. Maybe edit your title back to something descriptive since those links do belong Smile

Re: Drawing conditional lines - Nils Schmidt - 2014-12-26

I already described a possible mathematical solution here.

I also use hierarchical bounding boxes to check the visibility of subfiles on the screen.
LDPartEditor does not calculate the conditional line visibility for subfiles (sub-subfiles...) which are out of the screen.
The first matrix product (viewport x modelview matrix) can be cached. Therefore, only four vector transformations, two substractions, additionally 8 substractions, 8 multiplications, 8 additions and a final multiplication are necessary to create the discriminant for conditional line visibility. You can cache the result, too.