Creating Mastering V-Ray shaders in Maya: Lesson 02 – Materials 101

A while ago I wrote a blog post called ”Creating Mastering Vray style shaders in Maya”. My goal was to translate some of the techniques Grant Warwick uses in the course Mastering V-Ray in 3ds Max to Maya. A lot of people still contacts me about these techniques and I’ve been feeling more and more bad about how outdated they are. So I thought it was time to update this and show how I would create these shaders today. And with new features like GGX and OSL it’s both faster and simpler to do now!

This post will cover how to create a plastic and a gold shader. Basically what I do is recreate the shaders from Mastering V-Ray: Lesson 02 – Materials 101, but with an updated approach. If this is something that people will find interesting I might continue and cover other Mastering V-Ray lessons in Maya. So please comment or contact me and let me know what you think!

Let’s start with the plastic shader. This is how the node tree looked like with the old setup:

Plastic_Old_NodeTree

It requiered three different V-Ray materials (with different values for Reflection Glossiness) to be blended together. I’ve also used the RemapValue node as an equivalent to the Falloff node in 3ds Max which is not ideal since it is pretty clumsy. V-Ray 3.3 introduces a Falloff node in Maya with a lot of the same features as in 3ds Max.  I’ve only tried it briefly but I was a little bit disappointed by the lack of bezier handles. For this plastic shader I didn’t need any falloff node since I could get the desired result with a simple V-Ray material with GGX as BRDF. Here is the settings I used:

Plastic_GGX_settings

Here is a comparision between the old shader (to the left) and the new (right):

Plastic_comparison

And now on to the gold shader. I’ve used the same approach as with the plastic shader to not blend multiple materials but to rely on a single material with GGX as BRDF.  The other big difference is that I use an OSL texture for the reflection instead of using Remap Value nodes. The OSL texture is called Complex Fresnel and you can read more about it here: http://docs.chaosgroup.com/display/OSLShaders/Complex+Fresnel+shader. The way I use this is that I start by browsing to the right material on http://refractiveindex.info/ and simply type in the right values for n and k based on the wavelength (0.650, 0.510, 0.475 for R, G and B). This is how the page looks like:

Refractive_Index_Gold_red02

There is actually a shelf called ”selected data for 3D artists” and that’s a good place to start. However, I found the values for the gold there made it look to reddish, almost like copper. So I tried a few different other Pages and chose the values from the Babar and Weaver 2015 instead.

And this is how the OSL texture looks in Maya:

All of this is better explained here: http://viscorbel.com/vray-materials-part-3-metals/ so I encourage you to read that as well.

This is how the node tree looks like for the gold shader:

Gold_OSL_Node_Tree

The color correction is for purely artistic reasons to tweak the shader to your own liking. In this setup I tried to make the gold look more like the old shader. This Color Correction node is not a default node but can be created from Create – V-Ray – Create from V-Ray plugin – Texture. By multiplying the reflection with a V-Ray Dirt I make the shader slightly less reflective in occluded areas.

This is the final settings for the shader:

Gold_OSL_settings

And here is a comparision between the old shader (to the left) and the new (right):

As you can see they are not exactly identical but I think they new one is looking better so I didn’t tweak it further to match the old one. Also worth mentioning is the significant dropoff in render time between the old shader and the new.

I have some plans to continue with these blog posts and the next one up would be a Green Metallic Paint shader, which is similar to the one Grant creates in Mastering V-Ray: Lesson 04 – Advanced Material Creation Part 1. But like I said earlier, it depends if someone actually finds this interesting. So please comment and let me know what you think and what you would like to see in the future.

  1. Minh Nguyen

    Exactly what a maya user wanted to see while having experiment with the Warwick’s course ! I’ve tried your method and it worked perfectly. Really want another tutorial about the lesson 4, which I’m currently having struggle with.
    Thank you for theses wonderful informations !

  2. didier

    Hello, I would like to be grateful for you very much for this tutorial.You helped me very much since I had the same problem. I would delight that you were continuing with this great work since you help very much the users of Maya and vray. I will be very attentive, a lot of congratulations and very much success!!!

    • Hi Didier,

      I’m glad you found this helpful. Hopefully I can find some time to do the next one. It motivates me to hear that some Maya users like it.

  3. Hi Magnus,

    To be honest I have been following your post since last year and still look back to it from time to time whenever I forget things. This is very wonderful! I’ve only found out about this blog from your comment in your old post. http://www.magnus-olsson.se/?p=133 I’m quite excited what you have in store for the lesson 4. Keep it up! And thank you for helping us Maya users.

    • Hi James,

      Nice to hear that you find my posts helpful. I’m aware that I’m not the best at marketing this so I’m glad you found this! Like I said in the post I have some plans to continue depending on the intesest. It looks like at least some Maya users find this interesting which motivates me to continue!

  4. Bobonrop

    Hey Hi!

    Really thanks a lot for that post 😉
    Looking forward to see more on that topic.
    Keep it up 🙂

    • Hi,

      You’re welcome! I’ve been busy lately so it’s been a while since I posted anything but hopefully I can find some time in the near future.

  5. Seb

    Hi,

    Thank you very much for this write up, it helped me loads with Lesson Two of the Mastering Vray Course! Did you manage to do a write up for Lesson 04?

    Thanks,

    • Hi,

      Nice to hear that it helped you! I haven’t written anything for lesson 4 yet. A reason for the delay is that I really want this to be updated and would like to incorporate the new techniques from Mastering Lighting – Lesson 05 in the next post.

  6. Thank you for your post! your translation of Warwick’s course to Maya is brillant and help me a lot 😀
    I hope to see soon a new post. Keep it up! Thank you

  7. Issac

    Thanks a lot. I think in ”Gold_OSL_Complex_Fresnel03.jpg” the color output should be set to col_out, as on image it is set to result which took me a while to get the correct result.
    Also waiting for the next lesson – 04.
    Thanks again

    • Thanks for pointing this out! You are absolutely right, it should be set to col_out and that’s what I have in my scene as well. Something went wrong along the way but it’s updated now.

  8. Issac

    Hi, I wanted to know one more thing. Can we use OSL texture for non-metals (because values are available on refractiveindex.info ? If yes then what value to enter in VRay K ?

    • Hi Issac, the Complex Fresnel OSL shader is designed for metals only. Values for N and K are available for non-metals on refractiveindex.info but they all have a simple fresnel reflective curve so there’s no need to use anything other than the regular fresnel checkbox in the vray material for those types of materials.

  9. Thank you for making a simplified plastic shader, I was thinking to myself, that there is no need, for it to be that complex, most client’s don’t really care, as long as it looks good to be honest.

    I’m a Maya user too and wanted to go through Grant’s tutorials. I was wondering if download your Maya version of the Mastering V-Ray: Lesson 02 – Materials 101 tutorial please, I tried to quickly redo it in Maya, but it didn’t come out the same.

    Cheers,
    Carlito

    • Hi Carlito,

      You’re welcome. Sorry for the late reply. If you e-mail me I can send you the files. You can use the Contact Form for that.

      /Magnus

  10. Burce Boran

    This is really informative! Thanks Magnus and please continue to add new lessons. Looking forward to hear from you.

  11. Emma

    Hi Magnus,

    very late feedback, but it’s never too late to express my gratitude as a Maya user. Thank you for this great tutorial and if you find the time and energy more tutorials would be more than welcome. But this already meant a lot! Thank you for all your efforts and work.

    Best wishes,
    Emma

    • Hi Emma,

      Thanks for your kind words. Glad you found this helpful. I would love to do more tutorials, but yeah time is an issue when working with visual effects…

      /Magnus

  12. Manny Morales

    this is GOLD!

  13. Manny Morales

    Hello Magnus, this is a really silly question, how do I use the N and K values? I only see the first value applied but dont undestrand where the other 4 came from, meaning the other two for each N and K slots

    • Hi Manny,

      You get the different values for N and K by using a different number for the wavelength. You need to enter separate values for red, green and blue wavelength. You can use these values: 0.650, 0.510, 0.475 for R, G and B.

      I hope that was an answer to your question.
      /Magnus

Leave a Reply