Hi all,
It looks to me like the LineStyle proposal schema definition is incomplete? It talks about a few requirements:
- Line cap
- Line joint
- Screen-space line width
- Line dot-dash pattern
... but only proposes the "style" attribute for handling line patterns, and doesn't specify any of the inputs to the pattern e.g. what the opacity along the curve parameterization is. I'd love to see this specified and think it could be done so in an abstract way; e.g. as attributes describing styling, rather than shader code. I also think this is potentially a place where an API schema would be pretty compelling; e.g. UsdGeomCurveStyleAPI.
On the implementation end: implementing the mechanisms of stylization as GLSL shaders that replace the bound material breaks some of the abstractions we have around the USD object model. If the stylization is expressed as USD attributes, I think there are a few natural places to add them to (for example) Storm rendering:
(1) Storm uses tessellation shaders to support cubic curve drawing. The drawing pipeline for linear curves is much simpler, but we could augment it to handle caps and joints, it seems like.
(2) Storm already has some internal hooks for interpreting "width" in units of pixels, and if we have a standard USD way to flag this we could just connect those mechanisms.
(3) Storm code-generates a fragment shader main body for lines, which then calls into the material to compute color. If we add a stylization step before we call into the material, we can combine the results of that stylization step (opacity for line patterns/possibly for rounding caps) with the result of material evaluation, letting stylized curves keep using materials. I think that would make for a richer feature.
Thanks!
Tom
Hi all,
It looks to me like the LineStyle proposal schema definition is incomplete? It talks about a few requirements:
... but only proposes the "style" attribute for handling line patterns, and doesn't specify any of the inputs to the pattern e.g. what the opacity along the curve parameterization is. I'd love to see this specified and think it could be done so in an abstract way; e.g. as attributes describing styling, rather than shader code. I also think this is potentially a place where an API schema would be pretty compelling; e.g. UsdGeomCurveStyleAPI.
On the implementation end: implementing the mechanisms of stylization as GLSL shaders that replace the bound material breaks some of the abstractions we have around the USD object model. If the stylization is expressed as USD attributes, I think there are a few natural places to add them to (for example) Storm rendering:
(1) Storm uses tessellation shaders to support cubic curve drawing. The drawing pipeline for linear curves is much simpler, but we could augment it to handle caps and joints, it seems like.
(2) Storm already has some internal hooks for interpreting "width" in units of pixels, and if we have a standard USD way to flag this we could just connect those mechanisms.
(3) Storm code-generates a fragment shader main body for lines, which then calls into the material to compute color. If we add a stylization step before we call into the material, we can combine the results of that stylization step (opacity for line patterns/possibly for rounding caps) with the result of material evaluation, letting stylized curves keep using materials. I think that would make for a richer feature.
Thanks!
Tom