Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
hiroGotoh opened this issue Nov 8, 2018 · 10 comments
Closed

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

hiroGotoh opened this issue Nov 8, 2018 · 10 comments

Comments

@hiroGotoh
Copy link

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

@hiroGotoh hiroGotoh changed the title [Hydra]PrimVar: displayColor of cubic catmull-rom spline [Hydra] PrimVar: displayColor of cubic catmull-rom spline Nov 8, 2018
@c64kernal
Copy link
Contributor

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
Copy link

jtran56 commented Nov 16, 2018

Filed as internal issue #USD-4914.

@hiroGotoh
Copy link
Author

hiroGotoh commented Feb 14, 2019

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

  • Support for points rendering based on curves in Hydra GL.

Does this solve this issue? or no?

@c64kernal
Copy link
Contributor

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

@hiroGotoh
Copy link
Author

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
Copy link
Contributor

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

@hiroGotoh
Copy link
Author

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

@blevin
Copy link
Member

blevin commented Mar 26, 2019

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
Copy link
Author

hiroGotoh commented Mar 27, 2019 via email

@c64kernal
Copy link
Contributor

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

AdamFelt pushed a commit to autodesk-forks/USD that referenced this issue Apr 16, 2024
Refine test stages together with new skip list and Linux test enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants