Thursday, July 2, 2009

First blog - 3ds max caustics tutorial

Hello there
This is my first blog entry and also my first tutorial.
My name is Georgian(aka nimlot). I will make a tutorial for you. A tutorial about many things but mostly about caustics in mental ray.
I guess that if you search over the internet you should probably find a nice caustics tutorial for 3ds max, but I want to get it a little further. I will try to make a tutorial as detailed as I can because I was always frustrated that after I’ve did some things step by step after a tutorial I was never been able to achieve that last example that the writer showed at the end of it. U know….the image that makes u smile for how beautiful it is. I want to try to get you right there…right at the end….with the best results for you. Hope you’ll enjoy it. Also you can download the final scene. You will find the link at the end. :)
This is what we want to achieve.




I’m using Autodesk 3ds max 2009 but it works in all versions what I do now.
My system:
Intel Core2 Quad Q6600 2.4 GHz
4 Gb DDR2
Gigabyte Nvidia 9800 GTX+ 512 Mb
OS: Windows Xp SP2 (so only 3.2 Gb of RAM working :( )

Part 1 : Making some nice caustics
So let’s start:
First set your units to cm. In top menu at customize -> units setup select at display unit scale -> metric and from the dropdown select centimeters. Also go to rendering->render setup(F10) and in the render setup window down there where it says presets select mental.ray.no.gi and press ok.
Next create a plane. About 500x500 it would be fine.
Make 4 GeoSpheres like the ones in img.01. Spheres diameter is 10 and 2 segments. In perspective mode select the GeoSpheres and align them to the plane. Select only the z position and set current object to minimum and target object to maximum. Press ok.



Next step is to create a light for our scene. Go to create standard lights and select from there mr Area Spot. In the left viewport create a light just like the one I did(img02). To be sure it is exactly as I did select the light and right click on the Select and Move icon in main toolbar and set the position to -700 cm on x 0 cm on y and 350 cm on z. The target should be in 0,0,0. Change the multiplier to 4. Change the decay to inverse square and set the start point at 1029.4 and at spotlight parameters change the hotspot/beam to 4.5 and the falloff/field to 74.7. And now we have our first light in place. :)



Now we will start making some nice shaders for GeoSpheres.
1. Open material editor and select the first slot. Name it glass. Open material browser, go to new and from there pick Glass(physics_phen). Leave it how it is.
2. Select the second slot and name it chrome. Open material browser and pick from there Arch&Design(mi). In material editor select from the template’s dropdown select (under metals group) chrome. Leave it how it is.
3. Select the third slot and name it brushed. Open material browser and pick also Arch&Design(mi). In material editor select from the template’s dropdown select (under metals group) brushed metal. Leave it how it is.
4. In the 4th slot we will make a more complex material. Select a slot and name it ruby. Open material browser and pick raytrace. On raytrace basic parameters check the faceted box. Click on the diffuse color and set it to rgb=141,0,0. Click on the transparency color and set it to rgb=255,77,68. Set the index of refraction to 1.77. Click on the specular color and set it to rgb=255,144,144. Set the specular level to 136 and glossiness to 40. Click the button next to reflect and select the falloff map. Change the falloff map to Fresnel and deselect the Override Material IOR checkbox. Go back to your base material and in Extended Parameters rollover, in the Advanced Transparency tab check the Color checkbox and change the end to 20. Click on the color square and change it’s color to RGB=172,0,0. Now go to the SuperSampling rollover and deselect Use Global Settings. From the dropdown select Max 2.5 Star. And we’re done.
5. In the 5th slot create a standard material with diffuse RGB=100,100,100 and assign it to the plane.
6. Now assign to every GeoSphere one of the materials we’ve created.



Create a camera just like mine and make a test render(F9). It should look like this.



Now it’s time to see some caustics :D. Usually caustics are a problem. You have to play with them a lot until you will get the result you want. For instance if you don’t want to wait too much on render you will have to accentuate the intensity of caustics too see them. I will show you how. Select your GeoSpheres and right click in viewport. Go to Object Properties. Now go in Mental Ray tab and click the Generate Caustics checkbox. Click ok. Now we have the caustics generators. All we need now is to tell the renderer to render them. Open Render Setup window(F10) and go to Indirect Illumination tab. Go to Caustics and Global Illumination tab and check the Enable checkbox under Caustics. Now let’s see what we have.



Pff…..almost nothing. Don’t despair….it’s only the beginning.  There are 2 important values to play with when creating caustics. The first one is the multiplier and the second one is the average caustics photons per light. The multiplier is useful when we don’t want to wait a long time at render and we don’t need to achieve a too much realistic render. Increasing the multiplier value will make caustics more intense. I usually use it when I want to see how it comes. The average caustics photons per light is the key for realism. More photons means more accuracy. You will see. In our the image above we barely distinguish any caustics so it will be a good idea to increase the multiplier value. Increase it to 10 and let’s see what we have there.





Now we have something. This means we’re doing great.  Don’t change the multiplier value and change the average caustic photons per light to 100000. Let’s see how it goes now.



Now we have some nice caustics. Let’s play a bit longer. Change the multiplier to 5 and the average caustics photons per light to 500000. Watch out….it will take much longer to render. We’ll see some much realistic caustics. I like them but I think it should be more intense. So I will let the multiplier around 8 or so. This will be the our optimized values for the final render. If you want more depth than increase average caustics photons per light until you are satisfied. For now I think 500000 it’s enough.



Now we will play a little with the light. Just for fun. Move the light a bit closer to our GeoSpheres. Let’s say x=-415 cm and z=190 cm. Also change the decay start point to 607 cm. Change the multiplier value to 8 and average caustics photons to 100000. Let’s see how it looks.




Nice. I really like how it looks. I wonder how it will be if we go closer. Let’s move the light to x=-210cm and z=75cm. Also change the decay start point to 327cm and the hotspot/beam to 12.




Nice. But now the caustics are too intense. So let’s see how it works with multiplier set to 1.5 and the number of photons to 1 mil.(1000000). Don’t worry my render time is still under 1 minute(around 40s).



I would say it’s much nicer. Next thing to do is to get rid of those ugly shadows and get some nice smooth shadows. Select the light and go to the modify panel. Go to Area Light Parameters rollout. Increase the height and width of the rectangle to 100. Also increase the U and V samples to 20. Let’s test it.





Now it looks better. I’m proud of you. Last image took about 2 minutes to render.
I hope you enjoyed this tutorial. I'll post another one in a few days so stick arround.

Here is the link for the scene:
http://rapidshare.com/files/251183657/caustics01.max.html

30 comentarii:

  1. Thanks man!... good jobs... waiting for more tutorials XD
    ReplyDelete
  2. ur welcome....maybe tomorow i'll manage to make another one :)
    ReplyDelete
  3. Heya, awesome tutorial.
    But I'm having trouble achieving the same effects.
    I do everything the same as you (I can't select mentalray.no.gi, only mentalray.no.gi.high or mentalray.no.gi.draft), but the material on my plane doesn't render. It's a black void.

    The glass material looks good, but the arch&design materials are a little distorted.

    I'm a novice 3D animator, making space scenes. My scenes lack realistic lighting. 2 examples:
    http://www.youtube.com/watch?v=IaocEzOmmTw

    http://www.youtube.com/watch?v=a0ideQpLRi8&feature=channel_page

    I was hoping you could teach me a little on how to improve on my lightning.
    Could you please send me an email so I can explain what goes wrong with this caustics tutorial in more detail, and maybe for future contact, if you're willing to help me further?

    Many thanks in advance,
    Jens
    aka
    Capjanway
    jens8472[at]gmail.com
    ReplyDelete
  4. I will help you. I think the problems with the tutorial appeared because you use another version of 3ds max. If the base plane is black apply another material to it....a standard material should work. About selecting mental ray no gi just select the high preset. It should work. Make sure caustics are enabled in indirect illumination tab and values for average caustics photons and multiplier are set like in my example. Make a render and let me see what is the problem with the arch&design material.
    Good luck
    ReplyDelete
  5. Thanks :D Great TuTorial !!!!
    ReplyDelete
  6. Great tutorial nimlot!!! Keep 'em coming!!! I learned a lot from this one!!! THNX!!!
    ReplyDelete
  7. Hello nimlot, gr8 tutorial, i'm an architect and i'm workin onmax 2009. So i was wondering what are the best settings in mental ray to make an exterior scene looks the most realistic.

    Thank you
    ReplyDelete
  8. @alex31
    Thanks!
    Usually using an daylight system and GI should work, but sometimes u can set up a scene using a direct light for the sun, an skyline for ambient occlusion or an HDRI image for more depth. Maybe i'll make a tutorial soon about it.
    ReplyDelete
  9. I'll be grateful for that. Nice work

    Thank you
    ReplyDelete
  10. Good job I just started to render materials and such. I found an older tutorial similar to this one but you explain the tools more which is the best approach to tutorials, but more images that explain a lot with less text talky are my favs:).
    ReplyDelete
  11. Great Work mate, Thanks for this I like if you can make one more tutorail on Architecture Lighting.

    Thanks Again
    ReplyDelete
  12. great tutorial, thank you very much, you're a lifesaver
    ReplyDelete
  13. THANK U NIMLOT.............:)
    THIS IS VERY HELPFUL TUTORIAL ......... 3DS MAX STUDENTS LIKE US

    WE R WAITHING FOR MORE USEFUL TURORIALS LIKE THIS ONE............
    THANK U
    ReplyDelete
  14. @ Ajie ur welcome :)
    @ soona i really hope it helped....ur welcome
    ReplyDelete
  15. hi..your tutorial is very gud...but it doesnt work on my pc...can u tell me why i have applied the same settings but no result of caustics...may be graphic card problem?
    ReplyDelete
  16. This comment has been removed by the author.
    ReplyDelete
  17. Thanks for the tutorial!
    The materials are quite awesome.
    But I shouldn't have thought it would take only 4 * (time taken for you) to render this one because he has a core to quad and I've a single core
    Very stupid of me!
    It took 2 hours to render 56% of it!
    this is what I got,

    http://www.flickr.com/photos/44701969@N04/4455209179/

    thanks again for the tutorial :D
    ReplyDelete
  18. @Shenya de Silva I think it is too much time for ur render(this if the only diferece between our pcs is the processor).....either u rendered a very big image or u have some options activated around there like high sampling for AA or high sample for finalgather. Anyway i hope it helped u.
    ReplyDelete
  19. Oh no! I've only got 1GB RAM so processor isn't the only difference
    Nope again. Final gather is fully disabled
    I don't know about the other thing though(AA?)
    Image is 640*480 pixels,that is not very large.

    Thanks for the tutorial anyway
    I like all those materials
    ReplyDelete
  20. If u also have a weak video card then the render time is not that weird :)
    AA is antialiasing.
    ReplyDelete
  21. Hello,

    I'd appreciate if you can give me some feedback on our site: http://www.regencyshop.com/Bar-Stools/c33/index.html?osCsid=c57d1fcff64e9730d85dc1e8b59a7c5f

    I realize that you are home decor-modern design connoisseur :) I'd like to hear your opinion/feedback on our products. Also, it'd be swell if you can place our suede wassily chair in a bag set in a bag on your blog.

    Thank you,

    Nancy
    ReplyDelete
  22. @Nancy
    I really digg some of your stuff....maybe i'll model a few... one day when i'll have a little more time to spare. I didn't really understood the "bag set in a bag" issue :) Send me a mail pls and we'll see what we can do about it. Ty
    ReplyDelete
  23. Wow great work nice tutorials
    Thanks
    ReplyDelete
  24. aahh...!!!
    really really good job.. which you are doing.. can you pls. remove "Helvetica" fonts in default font style in css. coz it will making a error to read the text. (it called junk character)
    Jignesh Mujpara
    ReplyDelete
  25. hello nimlot, im having a huge trouble recently, i dont know why i dont have the mantel.ray.no.gi.high and draft presets, the only no.gi that i have is the mental.ray.no.gi and the mental.ray.photometric.lighting.with.gi...PLEASE, can u explain me why???
    by the way thanks for the well explained tutorials
    ReplyDelete
  26. @vilas
    It is not a problem. U just have a different version of 3ds max. It is enough that u have mental ray no gi. That means the renderer is mental ray and the final gather an global illumination are of(no gi). U can activate them by just checking the boxes in the indirect illumination tab in render settings. There is no difference between ur mental ray no gi preset and mental ray no gi draft preset. All you have to do is to select that mental ray preset and follow the tutorial step by step. Hope this answer helps.
    ReplyDelete
  27. thanks for ur attention Nimlot, just waiting for more tutorials =D
    ReplyDelete
  28. Hi its Nice but i m not able to find Illumination Tab instead its showing Reder Elements So how to about it if you could help n I m using Max 9 only
    ReplyDelete
  29. @astha
    if u can't find illumination tab it means u didn't load mental ray renderer.
    ReplyDelete