Grasshopper

algorithmic modeling for Rhino

Hey David,

This is a minor request... but I was wondering why alpha channel support was never added for geometry like lines and points.  I noticed that when overriding the DrawViewportWires method that it allows you to specify the rendering color (and one of the constructor types includes ARGB).  However, the alpha channel doesn't really affect geometry like lines and points... Is this a limitation of the drawing conduit (meaning it is impossible)?  Or is this a attribute that could be added?  Thanks in advance for any clarification.

Best,

Andy

Views: 1058

Replies to This Discussion

Rhino properties editor only allows RGB values for lines Display colors. So this might be a limitation of the Rhino display pipeline... I'm not sure though.

I think OpenGL is certainly capable of drawing lines and points with alpha channels, however there's always a big problem with z-order. Whether an object is actually visible in an OpenGL depth-buffered viewport depends on whether there's another object in front of it or not. If that object in front is partially transparent then the draw order becomes very important, as a z-buffer channel cannot encode transparency. If the object in front is drawn first then it will fully obscure anything behind it, even if it's transparent. This is why meshes in Rhino are sorted by distance to camera prior to drawing, to minimize the visual artefacts that result from this approach. 

I don't think we also sort points and curves in Rhino which is probably why we don't directly support drawing partially transparent curves and points.

Note that there is no single list of Grasshopper preview geometry which can be sorted front to back so in fact GH preview often suffers from the draw order artefacts of partially transparent objects:

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Ahh.  Thanks for the clarification.  Any chance a proper sorting algorithm will be added in the future?  Just curious, as it seems like it could add several advantages in rendering capabilities (you're screenshot is an excellent example).

-Andy

Very unlikely. This would require that all geometry would be collected into a single list first, so at the very least it would be a breaking SDK change. I'm not sure where Rhino6 is going to go display wise, but I think until we have some certainly there I'm not changing any fundamentals.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service