Applying per vertex color to point cloud

Hello-I am opening a .usd file that has x,y,z,r,g,b data for 3 points. I watched the video Primitive Variables (Primvars) Overview in Omniverse Create - YouTube on primvars to apply a material and hook it up to the displayColor in the .usd file. Unfortunately, I am only seeing the default colors on all three points. I get a warning in the console, but am unable to find a fix. Any help is appreciated!

2022-12-10 17:25:37 [Warning] [omni.usd] Warning (secondary thread): in GetColor at line 688 of /buildAgent/work/ca6c508eae419cf8/USD/pxr/usdImaging/usdImaging/gprimAdapter.cpp – Prim /World/smallpointtest/pointcloud has 3 element(s) for primvars:displayColor even though it is marked constant.

The warning message explains what’s wrong.

You have provided three color entries for the displayColor primvar although the interpolation on that primvar is marked with constant which means that the whole object gets a single color.

If you want per vertex color attributes, you would need to change that interpolation from constant to vertex.

See this USD documentation: https://graphics.pixar.com/usd/dev/api/class_usd_geom_primvar.html#Usd_InterpolationVals

Hello and thank you for your response. I am new to Omniverse and am not sure where to go to change the interpolation on the displayColor primvar. I am attaching the .usda file if it is helpful.
smallpointtest.usda (9.6 KB)
I appreciate the help!

That would usually look like this.
This is a (very small) single triangle with red, green, blue displayColors per vertex:

#usda 1.0
(
    defaultPrim = "Root"
    metersPerUnit = 0.01
    upAxis = "Y"
)

def Xform "Root"
{
    def Mesh "Geometry"
    {
        int[] faceVertexCounts = [3]
        int[] faceVertexIndices = [0, 1, 2]
        normal3f[] normals = [(0.0, 0.0, 1.0), (0.0, 0.0, 1.0), (0.0, 0.0, 1.0)]
        point3f[] points = [(-0.5, -0.5, 0.0), (0.5, 0.0, 0.0), (0.0, 0.5, 0.0)]
        color3f[] primvars:displayColor = [(1, 0, 0), (0, 1, 0), (0, 0, 1)] (
          interpolation = "vertex"
        )
        texCoord2f[] primvars:st = [(0.0, 0.0), (1.0, 0.0), (0.0, 1.0)] (
          elementSize = 2
          interpolation = "vertex"
        )
        uniform token subdivisionScheme = "none"
    }
}

and this would be a minimal MDL shader which picks up that displayColor:

mdl 1.6;

import ::df::*;
import ::scene::*;

export material diffuse_display_color()
=
material(
  surface: material_surface(
    scattering: df::diffuse_reflection_bsdf(
      tint: scene::data_lookup_color("displayColor", color(1.0))
    )
  )
);

I just can’t seem to make the same work with the point cloud in my (old) version of Create. though.
I’ll leave that for someone in the Omniverse team to figure out.

Hi-
Thank you for your response! I could get vertex color interpolation working with your triangle example, but when I added (interpolation = “vertex”) to my four point usda file, I still get no per vertex colors. How do I go about contacting the Omniverse team to continue troubleshooting this, or are you able to pass it along? Thanks!


Hi @jaylene.naylor. This is a known issue. We have an internal issue, OM-54856, to add support for this in our RTX renderers. It does currently work with Storm though.

Hi,
I was recently asked about Points in Omniverse and came across this report.

I have created a sample usda file.
Even though I specify DisplayColor for Points, the color does not seem to be reflected for RTX.

I wrote the usda file as follows.

def Points "points1"
{
    point3f[] points = [(-3.0, 0.0, 0.0), (-2.0, 0.0, 0.0), (-1.0, 0.0, 0.0), (0.0, 0.0, 0.0),  (1.0, 0.0, 0.0)]
    color3f[] primvars:displayColor = [(1.0, 0.0, 0.0), (1.0, 0.5, 0.0), (0.0, 1.0, 0.0), (0.0, 1.0, 0.5), (0.5, 0.0, 1.0)] (
        interpolation = "vertex"
    )
    float[] widths = [1.0, 1.0, 1.0, 1.0, 1.0]
}

sample usda file :
PointClouds.usda (1.5 KB)

Am I correct in my response that this report is not about VertexColor, but about Points color, which is not yet supported in RTX?

Running into the same issue. When will this be supported in the RTX renderer?

This issue has been fixed in the latest internal build. It should make its way to the next Beta Release at the end of the year.

Thanks @Richard3D - is this fix and the current bug applicable just to the displayColor primvar? Or any primvar on points / pointInstancers?

Wondering if writing an mdl shader to looks up another primvar (that’s not displayColor) would work?