Announcement

Collapse
No announcement yet.

OSL texture common coordinates space

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

  • OSL texture common coordinates space

    Hi,

    I'm having trouble getting world position in SOL texture shader. What coordinate space P is?
    I thought that a simple implementation like below will give me world position but the results are not what I expected.

    point p = transform("common","world",P);
    result=color(p[0],p[1],0);

    Am I doing something wrong here? thank you.

  • #2
    The P is in world space. Also common is the same thing as world, so the transform call won't do anything.
    Probably you don't see what you're expecting, because you don't set the P[2] to the blue channel of the output.

    Here is an example shader that is exactly the same as the worldPosition render element
    Code:
    shader worldSpace(output color out=color(1,1,1)) {
    	out=color(P[0], P[1], P[2]);
    }
    V-Ray developer

    Comment


    • #3
      Hi,

      it is not in word as it doesn't "stick" to the geo. When I move the camera the values slide on the surface. it only works when my camera is aligned with Z.
      Thank you for confirming that is is supposed to be in world space and that it should work that way.

      Originally posted by t.petrov View Post
      The P is in world space. Also common is the same thing as world, so the transform call won't do anything.
      Probably you don't see what you're expecting, because you don't set the P[2] to the blue channel of the output.

      Here is an example shader that is exactly the same as the worldPosition render element
      Code:
      shader worldSpace(output color out=color(1,1,1)) {
      	out=color(P[0], P[1], P[2]);
      }

      Comment


      • #4
        In V-Ray for Maya, the "common" space is not the same as "world" space. It looks like we are not doing the transformation between the two properly - will make a note to fix it.

        Best regards,
        Vlado
        I only act like I know everything, Rogers.

        Comment


        • #5
          Indeed there is a mismatch between the "common" and "world" coordinate spaces.
          I cannot come up with a workaround, sorry.
          The problem is fixed for the next service pack.

          Best Regards,
          Ivan Mavrov

          Comment

          Working...
          X