Announcement

Collapse
No announcement yet.

[HOU-1969] OSL dPdu, dPdv partial derivatives always seem to be 0,0,0?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [HOU-1969] OSL dPdu, dPdv partial derivatives always seem to be 0,0,0?

    When running the following OSL, I would expect dPdu and dPdv to be valid?

    --snip--
    vector worldTangent = normalize(dPdu);
    vector worldBitangent = normalize(dPdv);
    vector worldNormal = normalize(N);
    //
    printf("worldTangent: %f\n", worldTangent);
    printf("worldBitangent: %f\n", worldBitangent);
    printf("worldNormal: %f\n", worldNormal);
    --snip--

    I'm only getting 0,0,0 while N is correctly being passed

    --snip--
    worldTangent: 0.000000 0.000000 0.000000
    worldBitangent: 0.000000 0.000000 0.000000
    worldNormal: -0.027439 -0.272305 0.961820
    worldTangent: 0.000000 0.000000 0.000000
    worldBitangent: 0.000000 0.000000 0.000000
    worldNormal: 0.929598 -0.367538 0.027624
    worldTangent: 0.000000 0.000000 0.000000
    worldBitangent: 0.000000 0.000000 0.000000
    worldNormal: -0.084531 0.070302 0.993938
    --snip--

    This makes it impossible to do any anisotropy type effects.

    It would be good to check Dx(), Dy(), Dz() to see if these are working as expected.

  • #2
    Hello malcolmh , I've logged the issue in our system and some of the devs will take a look at this problem.
    Georgy Chakarov | QA
    www.chaosgroup.com
    georgy.chakarov@chaosgroup.com

    Comment


    • #3
      Great Georgy, it would be good to check this shader https://docs.chaosgroup.com/display/.../Fabric+shader works as expected as it uses dPdu and dPdv

      For Dx() and Dy() it would be good to check that these work with the other globals (like P and N) so it's possible to compute the curvature of the surface regardless of the parameterisation of the underlying surface. eg (http://madebyevan.com/shaders/curvature)

      Comment

      Working...
      X