Incorrect visualization of UsdGeomPoints.primvars:displayColor on Fabric scene delegate

Hello,

I have been experimenting with the Fabric scene delegate and USDRT. I know they are still under development and Fabric scene delegate is marked as preview feature, I still use these features to my advantage while developing my applications.

I am mainly working with point clouds, hence UsdGeomPoints is the most relevant geometric primitive type to use. It is very performant for my use cases, as well. However, I stumbled on an issue when I set displayColor primvar while Fabric scene delegate is enabled: it won’t show the correct colors. This happens in both cases when I use pxr.UsdGeom and usdrt.UsdGeom.

Additional question: I am also not sure how to set displayColor primvar’s interpolation value to "vertex" when using USDRT. It looks like USDRT has no support for Usd PrimVars, at least not yet, as far as I can see from the docs and the API. Setting Primvar interpolation was discussed on a different topic from last year and applicable to pxr.UsdGeom: Applying per vertex color to point cloud

I’d like to share a code snippet to show how I set the displayColor primvar:

from pxr import Usd, UsdGeom
#from usdrt import Usd, UsdGeom

# Assuming correct "stage" (pxr.Usd.Stage or usdrt.Usd.Stage) is available and active
prim: Usd.Prim = stage.GetPrimAtPath("/somePath")
points: UsdGeom.Points = UsdGeom.Points(prim)
points_attr: Usd.Attribute = points.GetPointsAttr()

# Create points and set using points_attr.Set(Vt.Vec3fArray.FromNumpy(...))
# If using USDRT points_attr.Set(Vt.Vec3fArray(...))
# Assuming the length of the points is "n", can be retrieved via UsdGeomPoints.GetPointCount()

# Using USD
pv_api = UsdGeom.PrimvarsAPI(prim)
pv = pv_api.GetPrimvar("displayColor")
pv.Set(Vt.Vec3fArray.FromNumpy(...))
pv.SetInterpolation("vertex")

# Using USDRT
color_attr: Usd.Attribute = prim.GetAttribute("primvars:displayColor") color_attr.Set(Vt.Vec3fArray(...))
# Additional question: How to set the primvar interpolation value to "vertex"?

When save and reload the file while the Fabric scene delegate enabled, I can see the correct colors. I can also see the correct colors when I use pxr.UsdGeom without the Fabric scene delegate enabled. However, dynamically setting primvars:displayColor when Fabric scene delegate is enabled won’t show the correct colors.

Are there any workarounds on this issue that I can apply while keeping the Fabric scene delegate on?

So just to be clear, the issue is only when you have FSD enabled ? With FSD disabled the issue with displayColor is not present ? What kind of performance drop are you getting if you disable FSD ? I will try to find some specific answers but, as you said, it may be a limitation of the current FSD code.

Hey @Richard3D, you are correct. It only happens when Fabric Scene Delegate is enabled. IF FSD is disabled, no issues with primvars:displayColor is observed. Just to make the reproduction easier, I’d like to share my use case below:

  • Convert a point cloud to UsdGeomPoints and save as a separate USD file
  • Add the USD file as a reference or a payload to the OV stage
  • Use the following table to add primvars:displayColor to the prim of the referenced USD file (assuming the UsdGeomPoints geometric primivite is set as the default prim in the separate USD file)
  • X means the problem may be observed
pxr usdrt
FSD enabled X X
FSD disabled N/A
  • Using pxr, I can use the Primvars API to add “per point” interpolation
  • However, I couldn’t find a way to add interpolation when using usdrt (it may be possible without the Primvars API, but I don’t know how to)
  • Try to delete the reference/payload from the stage – it would stay visible when FSD is enabled

FSD is very fast when I load ~10M points via multiple UsdGeomPoints geometric primitives compared to non-FSD alternative. I don’t have any statistical comparison data, but I can definitely observe performance issues when I zoom in to see individual points. The performance issues become less when FSD is enabled.

Kit versions used during testing (via kit-app-template):

  • 106.0.2
  • 106.2.0

Thanks for your detailed reply. I will follow up with the Fabric team. I am going to file a ticket to get a detailed response.

1 Like