Announcement

Collapse
No announcement yet.

VRayOSLTex and Dome Light problem

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

  • VRayOSLTex and Dome Light problem

    Hi Chaosgroup,

    I am trying to use the VRayOSLTex in "Vray3.00.02 Edu" in conjuction with the VRay Dome Light.
    But when I try to use the global variables u and v in the OSL script, the rendering has errors on the dome light.

    Click image for larger version

Name:	vrayDomeOSLProblem.png
Views:	1
Size:	64.7 KB
ID:	879526

    I narrowed it down to the very simple OSL script:

    Code:
    shader test
    (
    	output color result = 0
    )
    {
    	result = color(v);
    }
    When I put the texture on a normal object, it works fine. It also works when I return a constant color.
    So it looks like the u and v variables receive wrong values for the dome light.
    Is there a way to fix this?

    Best regards

  • #2
    You might have to use the viewing direction to compute the texture mapping; the dome light doesn't have u/v coordinates.

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

    Comment


    • #3
      I'm not shure how to achieve the mapping with the viewing direction only. I tried to use P, but this results in kind of the same errors then with u/v (which probably makes sense, since the dome light does not have a defined distance from the origin??).
      I guess I could achieve the mapping if I had the viewing position in addition to the viewing direction, but there is no variable in OSL for that.

      Comment


      • #4
        You take the viewing direction, do inverse spherical mapping, and you get u/v values that you can use. If you need help with the inverse spherical mapping, let me know.

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

        Comment


        • #5
          If you could give me some information about the inverse spherical mapping, that would be great! Thanks!

          However, if I try to use the viewing direction (with the OSL global variable I) just as a simple output for testing, it renders completely black:

          Code:
          shader test
          (
          	output color result = 0
          )
          {
          	result = color(I[0], I[1], I[2]);
          }
          I thought this should at least output some weird colors. When I put the same OSL script on an object, it seems to work.

          Best regards,
          Manuel

          Comment


          • #6
            Yes, we found a limitation related to that (the dome light uses a different shade context); will fix it.

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

            Comment

            Working...
            X