PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
6.11k stars 1.21k forks source link

[Hydra] PrimVar: displayColor of cubic catmull-rom spline #690

Closed hiroGotoh closed 5 years ago

hiroGotoh commented 5 years ago

Description of Issue

I have an issue of Hydra-GL: Color of catmull-rom spline with USD18.11. Complexity:Low: Color of curves is correct. Complexity:Medium: Color is not correct? It seems to be shifted. cubic-catmullrom_refinelevel0 cubic-catmullrom_refinelevel1 I'd like to use the catmull-rom spline as the output curve of the hair simulator. Therefore, the first 2 and the last 2 vertices are output as the same position. and, primvars:displayColor is "vertex" interpolation.

Catmull-rom defines 1 segment with 4 vertices, which is formed between the 2nd vertex and the last previous vertex. (e.g. points: 0, 1, 2, 3 -> segment: 1-2) when refine level = 1 or more, it should be interpolated with the colors of these 2 vertices (points: 1, 2). I also tried varying interpolation, but it seemed that the result did not change the result of vertex interpolation. As a result, The color interpolation does not seem to be correctly based on basis, primvars:interpolation. When refine level = 0 and vertex interpolation, The spline is displayed as linear. The color should be the same color of each vertex.

btw, If "varying" interpolation is used, what do you think should differ from "vertex" interpolation?

Steps to Reproduce

  1. make .usda for curves.
  2. open it with usdview
  3. increase/decrese RefineLevel(Ctrl +/- Key)

Repro data

sample1:

#usda 1.0
def BasisCurves "cubic_catmullRom_2splines"
{
    uniform token type = "cubic" #linear
    uniform token basis = "catmullRom"
    int[] curveVertexCounts = [6, 5]
    point3f[] points = [(-50, 0, 0), (-50, 0, 0), (-25, 50, 0), (25, 50, 0), (50, 0, 0), (50, 0, 0), (-50, 50, 0), (-50, 50, 0), (0, 100, 0), (50, 50, 0), (50, 50, 0)]
    color3f[] primvars:displayColor = [(1, 0, 0), (1, 0, 0), (1, 1, 0), (0, 1, 0), (0, 0, 1), (0, 0, 1), (0, 0, 1), (0, 0, 1), (1, 0, 0), (0, 1, 0), (0, 1, 0)] (
        interpolation = "vertex")
    #color3f[] primvars:displayColor = [(1, 0, 0), (1, 1, 0), (0, 1, 0), (0, 0, 1),    (0, 0, 1), (1, 0, 0), (0, 1, 0)] (
    #    interpolation = "varying")
    #float[] widths = [3.5, 3.5, 9, 1.5, 0.1, 0.1, 3, 3, 0.3, 3, 3] (
    #    interpolation = "vertex"
    #)
    float[] widths = [3, 9, 1.5, 0.1,   3, 0.3, 3] (
        interpolation = "varying"
    )
}

sample2:

#usda 1.0
def BasisCurves "cubic_catmullRom_1spline"
{
    uniform token type = "cubic" #linear
    uniform token basis = "catmullRom"
    int[] curveVertexCounts = [6]
    point3f[] points = [(-75, -50, 0), (-50, 0, 0), (-25, 50, 0), (25, 50, 0), (50, 0, 0), (75, -50, 0)]
    color3f[] primvars:displayColor = [(1, 1, 1), (1, 0, 0), (1, 1, 0), (0, 1, 0), (0, 0, 1), (1, 0, 1)] (
        interpolation = "vertex")
    #color3f[] primvars:displayColor = [(1, 0, 0), (1, 1, 0), (0, 1, 0), (0, 0, 1), (1, 0, 1), (1, 1, 1)] (
    #    interpolation = "varying")
    #float[] widths = [3.5, 3.5, 9, 1.5, 0.1, 0.1] (
    #    interpolation = "vertex")
    #float[] widths = [3.5, 9, 1.5, 0.1] (
    #    interpolation = "varying")
    float[] widths = [4.0](interpolation = "constant")
}

System Information (OS, Hardware)

OS: Windows7 pro 64bit GPU: Quadro K4000/GV100

Package Versions

USD v18.11

Build Flags

embree support, alembic plugin, maya plugin

Thanks, Hiro

c64kernal commented 5 years ago

Thanks again for filing this, @hiroGotoh

Adding a link to the original post here from the interest group here: https://groups.google.com/forum/#!topic/usd-interest/qD9h6GCsU3Q

jtran56 commented 5 years ago

Filed as internal issue #USD-4914.

hiroGotoh commented 5 years ago

@c64kernal @jtran56 Can I check one? I saw changelog of usd 19.03.

Does this solve this issue? or no?

c64kernal commented 5 years ago

Hi @hiroGotoh -- no unfortunately that is completely unrelated, sorry about that!

hiroGotoh commented 5 years ago

Hi @c64kernal I thought so. This improvement is just to draw a curve as a point. OK. I hope that this problem is resolved ASAP. If possible, Could you please give an estimate of the time scale involved in starting this? I would appreciate your cooperation.

c64kernal commented 5 years ago

Apologies @hiroGotoh, I don't have an estimate for this fix at this point, unfortunately.

hiroGotoh commented 5 years ago

Hi @c64kernal -- I see. That's a real shame. thank you.

blevin commented 5 years ago

Hi Hiro, thanks for the detailed bug report. I have checked in a fix for this in our internal USD codebase. It should be up on the github dev branch before long. Results now look like:

sample1, refined: image

sample2, un-refined: image

sample2, refined: image

cheers, Brett.

hiroGotoh commented 5 years ago

Hi Brett,

oh, thank you so much. I wil check it, I would like to be merged to release branch.

Best, hiro

2019/03/27 5:49、Brett Levin notifications@github.comのメール:

Hi Hiro, thanks for the detailed bug report. I have checked in a fix for this in our internal USD codebase. It should be up on the github dev branch before long. Results now look like:

sample1, refined:

sample2, un-refined:

sample2, refined:

cheers, Brett.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

c64kernal commented 5 years ago

Hi @hiroGotoh this fix is slated for the upcoming 19.05 release, so should be in the release branch in the next few weeks.