Announcement

Collapse
No announcement yet.

Vray3 osl cooktorrance BDRF

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

  • Vray3 osl cooktorrance BDRF

    Hi,
    im trying to write a simple OSL shader to work with vray 3ds max.
    The shader im after is simple, diffuse with reflection using cooktorrance BDRF model.

    And another shader using orennayar model.

    These models are normally locked in vray in 3ds max, but are available in osl. Anyone know how to code these two shaders up?

    http://help.chaosgroup.com/vray/help/200R1/vrayosl.htm

    Thanks

  • #2
    Check the examples and simply use different closures in the corresponding code parts.

    http://help.chaosgroup.com/vray/help...es_vrayosl.htm

    Cheers,
    Thorsten

    Comment


    • #3
      Thanks instinct,
      im not really good at coding, how would i apparch this? from a diffuse material template example? then add in each aspect?

      The only example i can see is the "plastic.osl" with closure, would it be a case of replacing the phong with cooktorrance?
      how would i add in cooktorrance closure?

      sorry im not very good with coding

      Thanks in advance

      Comment


      • #4
        Lets start with the OSL documentation.

        As you suggested lets use "plastic.osl" as a code donor.

        The
        Code:
        phong(normal N, float exponent)
        and
        Code:
        vray_cooktorrance(normal N, float glossiness)
        closures have the same signature, and both support the "trace_reflections" keyword parameter so you can in fact just replace "phong" with "vray_cooktorrance" and the shader should compile. It is just that the second argument for the Phong closure expects an exponent value (for example 1, 80, 400, ...) while the Cook-Torrance one expects a glossiness value in the [0, 1) range. And I suppose that's about it. See if it works for you.

        Best regards,
        Ivan Mavrov

        Comment


        • #5
          Tried the Carbon Fiber example. The file loads, but the material looks like black paint without striations. Any tips?

          Comment

          Working...
          X