tutorials.render-test.comtutorials.render-test.com/worddocs/caustics.docx  · web viewin this...

22
Caustics - Mental Ray (Working with real caustic generation) In this tutorial we are going to go over some advanced lighting techniques for creating realistic caustic effects. Caustics are the bent reflections of light after it has gone through a surface like water, glass, or gemstones. For example, dancing shapes on the bottom of a swimming pool. We can use mental ray to accomplish realistic caustics and bend the light from our scene to reflect this great dancing shapes like the below image: We will experiment with these lighting effects by creating something called a water box. Water boxes are simple scenes set up for the express purpose of creating and modifying caustics so that when you get to your real scene you can just plug in the data. 1

Upload: tranmien

Post on 04-Feb-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: tutorials.render-test.comtutorials.render-test.com/worddocs/Caustics.docx  · Web viewIn this tutorial we are going to go over some advanced lighting ... We are going to clone this

Caustics - Mental Ray(Working with real caustic generation)

In this tutorial we are going to go over some advanced lighting techniques for creating realistic caustic effects. Caustics are the bent reflections of light after it has gone through a surface like water, glass, or gemstones. For example, dancing shapes on the bottom of a swimming pool. We can use mental ray to accomplish realistic caustics and bend the light from our scene to reflect this great dancing shapes like the below image:

We will experiment with these lighting effects by creating something called a water box. Water boxes are simple scenes set up for the express purpose of creating and modifying caustics so that when you get to your real scene you can just plug in the data.

1

Page 2: tutorials.render-test.comtutorials.render-test.com/worddocs/Caustics.docx  · Web viewIn this tutorial we are going to go over some advanced lighting ... We are going to clone this

As it states in the name, lets create a box in our top viewport, Length and Width of 150, and Height of 100. Simple rooms that are more than boxes work just fine as well, if you are going to have recessed lighting, or anything casting shadows in the scene, etc.

Caustics need surfaces to bounce off of and reflect on. We could add a shell modifier and make this a realistic room and zoom our cameras inside, but in order to really test our caustics above and below the surface of the water we are going to use a different trick.

Select your box, and then right click on it and select Convert To: ---> Editable Poly.

Then go to your Modify tab, and select the Element sub-object selection. --->

Once you are in the Element sub object, click on your box. The entire thing shouldturn bright red letting you know you have the element selected.

2

Page 3: tutorials.render-test.comtutorials.render-test.com/worddocs/Caustics.docx  · Web viewIn this tutorial we are going to go over some advanced lighting ... We are going to clone this

Scroll down in your tools under the Element tools until you find the Edit Elements Rollout. Under this rollout is a button labeled Flip. Click it:

<--- Flip works on the normals of an object's polygons. It inverts them so that the facing is going in the opposite direction. When we first created our box the normals were facing out and away from the box which allows us to perceive it as a solid object.

Once we selected the element (all the polygons of our object) and flipped them, they are now facing inwards. So the solid surface is actually shown facing inside the box towards each other instead of out and away from each other.

Unselect the Element sub object button so you can again edit your scene. Your box was initially a random color generated by 3DS Max and should now be jet black. This is because unless you specifically tell 3DS Max to render both sides of its polygons it will save computer power by only rendering the side where the normals are facing.

3

Page 4: tutorials.render-test.comtutorials.render-test.com/worddocs/Caustics.docx  · Web viewIn this tutorial we are going to go over some advanced lighting ... We are going to clone this

Right click on your box to bring up the quad menu, and find Object Properties:

This will bring up a large dialogue box with all the options for displaying and working with this object.

In the Display Properties area, find and check the box that says "Backface Cull"

This will make it so that instead of showing our opposite side of our polygons as jet black, it will instead make them see through so we can actually look into the box without removing a wall or zooming inside of it.

Once this is checked, click on the OK button.

4

Page 5: tutorials.render-test.comtutorials.render-test.com/worddocs/Caustics.docx  · Web viewIn this tutorial we are going to go over some advanced lighting ... We are going to clone this

This display allows us to see inside the box, and all the opposite walls as we turn around it in our scene. It's like we suddenly have Super X-Ray vision! Good job super heroes! ... (or villains?)

Our stage is set, now we need the second portion of our Waterbox. The Water!We'll make this really easy on ourselves, with your box selected go to your Modify tab and select the Polygon sub-object selection set.

Mark the box that says "Ignore Backfacing" this will prevent us from selecting the polygons that are now Xray see through for us. Then go back to your box and click on the polygon that makes up our floor.

5

Page 6: tutorials.render-test.comtutorials.render-test.com/worddocs/Caustics.docx  · Web viewIn this tutorial we are going to go over some advanced lighting ... We are going to clone this

The Floor should highlight bright red and should be the only part of our room we have selected. We are going to clone this polygon and make it a new shape which will be the surface of our water. It's the exact same size and shape as our room so this is the easiest way to create a new plane object.

Once your floor is highlighted red, get your move tool and hold down your shift key. Drag up on the blue Z axis arrow in your perspective view and you should see a new polygon rise up with it:

When you have it at the height you want your water to fill the room with, let go of the mouse button. The clone dialogue box will open up.

6

Page 7: tutorials.render-test.comtutorials.render-test.com/worddocs/Caustics.docx  · Web viewIn this tutorial we are going to go over some advanced lighting ... We are going to clone this

Mark the radial button that says Clone to Object: and give it a name like the one above.When you have done that click the OK button on the dialogue box, and then make sure to unselect your polygon sub-object selection in your modify tab.

You should now have 2 objects, he box, and the surface of our water. Our next step is to give our water and our box a texture so they actually resemble what they are supposed to be.

Open your material editor (M) and we'll make a couple of quick textures.

Select an empty texture slot.

<---- You can click this checkered button to turn on the rainbow background if you want to see that your opacity changes take effect.

Give it a name if you wish.

Then in the Basic Parameters change the Diffuse color swatch to black, change the Opacity level down to 15 or so (anything low depending on whether or not you want your water to be perfectly clear or have a hint of color to it.)

Then change the specular level to about 150, and the glossyness to about 50 give or take a few.

We can see the first texture slot change as we do this, and we have a nice mostly clear shiny material. However, water has some reflective and refractive properties in the real world and is never just see through.

When you put a stick into a pool, you'll notice that it appears as though the water is pending the angle of the stick. This effect is called refraction and will help us make our water look and feel thicker and more realistic.

7

Page 8: tutorials.render-test.comtutorials.render-test.com/worddocs/Caustics.docx  · Web viewIn this tutorial we are going to go over some advanced lighting ... We are going to clone this

In your material settings, scroll down and open the rollout that says Maps:

Find the entry for Reflection, and click on the large button on the right side that says None.

This will open a large list of maps, scroll through the list until you find the one that says "Raytrace" select it and then hit the OK button to apply it to the Reflection map. It will take you into the raytrace map settings, but we don't have to change anything here. So just click on the Go To Parent button between the settings and the texture slots.

<---- Go To Parent button.

Back under your Maps, click and drag the Map#1 (Raytrace) map from the reflection button to the None button just below it marked for Refraction. When the dialogue box pops up just tell it to be a copy.

8

Page 9: tutorials.render-test.comtutorials.render-test.com/worddocs/Caustics.docx  · Web viewIn this tutorial we are going to go over some advanced lighting ... We are going to clone this

Then modify the amount of reflection and refraction like the image above.Next we will need to give our water some ripples and waves. In order to do this we will apply a simple Bump map.Click on the none button next to the Bump selection in your Maps rollout:

The maps list will open up again, scroll down until you find "Noise" and select it and then hit the OK button.It will take you to the settings for the noise. We are just going to reduce the size in the Noise Parameters to 5.0 and then click on the go to parent button to return to our top layer:

9

Page 10: tutorials.render-test.comtutorials.render-test.com/worddocs/Caustics.docx  · Web viewIn this tutorial we are going to go over some advanced lighting ... We are going to clone this

Back in the Maps: rollout give the bump a bit more in the Amount, I put mine at 60 and then take a look at your texture and what it is doing to the light and objects behind it.

Our water is looking pretty good, click and drag it from the spheroid texture slot, and drop it on the surface of our water to apply the texture.

Good, now we'll make one for the room so that our colors match and in my case are something other than bright pink.

10

Page 11: tutorials.render-test.comtutorials.render-test.com/worddocs/Caustics.docx  · Web viewIn this tutorial we are going to go over some advanced lighting ... We are going to clone this

Select another empty texture slot in your material editor.Click on the Diffuse: color swatch and give your texture any color you like. I gave mine kind of a warm peachy orange color for no other reason than I was feeling peachy and wanted a warmer inviting room.

Then click and drag it to the Box in our scene just like we did the water.

Our scene is set, and now all we need to add is a light. Then we can turn our caustics on and watch the magic happen.

11

Page 12: tutorials.render-test.comtutorials.render-test.com/worddocs/Caustics.docx  · Web viewIn this tutorial we are going to go over some advanced lighting ... We are going to clone this

On your create tab, find the lights button and in the drop down menu find Standard Lights.

We will use a "mr Area Omni" for this one. The mr stands for Mental Ray of course! Click the button to turn it on and then click in the middle of your box in your top viewport to create the light.

It will automatically put the light at the zero point on your Z axis so you will have to then grab your move tool and simply move it up by clicking on the axis arrow pointing up and dragging the light towards the ceiling of our box in either the front or left viewports.

Let's change a few settings on our light to get the most out of this little bugger. With your light selected go to your modify tab and scroll down the settings list until you find the Area Light Parameters rollout.

12

Page 13: tutorials.render-test.comtutorials.render-test.com/worddocs/Caustics.docx  · Web viewIn this tutorial we are going to go over some advanced lighting ... We are going to clone this

Here we can change the shape of our light to get the most out of our caustics scene. Check the box that says show Icon in renderer. This will let us see the light when we render and will give us something more to reflect in our water.

Change the Type: to Cylinder (think florescent tube) and then change its Height to about 65 or so.

This can be done with any type of light, I have chosen this one to get a longer range of light for our caustics.

If you watch the light icon in your scene as you changed the height number you will notice that it is going up and down and filling our room from top to bottom. This needs to be rotated so that the light runs across our ceiling instead.

So with your light selected, grab your rotation tool and head down to the bottom of your 3DS Max window to find the XYZ coordinates. Type 90 in the X: field and hit enter.

This will rotate our light exactly 90 degrees so that it runs along the length of our ceiling instead of top to bottom.

13

Page 14: tutorials.render-test.comtutorials.render-test.com/worddocs/Caustics.docx  · Web viewIn this tutorial we are going to go over some advanced lighting ... We are going to clone this

If you click on the lights height adjustment number you can see it going in the correct direction now.

We have a box, some water, and a light! We are ready to turn on Caustics and see the result of all our hard work.

Go to your render setup (F10) and click on the Tab at the top of the dialogue box that says Indirect Illumination.Scroll down until you see the Caustics and Global Illumination (GI) rollout and open it up.

Check the box that says Enable to turn the caustics generation on like the image above.

14

Page 15: tutorials.render-test.comtutorials.render-test.com/worddocs/Caustics.docx  · Web viewIn this tutorial we are going to go over some advanced lighting ... We are going to clone this

Then scroll down in your settings a bit more until you see the Light Properties area.

We are doing a caustics Waterbox test so in the Average Caustic Photons per Light: add a couple zeros to the end of the default 20,000. Make it 2,000,000 so we have lots and lots of photons to work with! You can make this number really huge if you want super realistic caustics. Your render will take longer than you probably have life left to render it however, so we fake it with a couple million.

Our next number down is the Decay: This number dictates how thick our caustic light shapes will be. If you are ever having trouble seeing your caustics in a scene, it is probably because this number is too high. The lower the number the bigger the dancing light shapes. I like to reduce this just slightly so we can get some really defined caustic shapes. Reduce it from the default of 2.0 to about 1.8

Lastly since we want all of the objects in our scene to work with our caustics check the box that says "All Objects Generate & Receive GI and Caustics".

In a scene though just remember that you can leave this unchecked and by right clicking on lights and objects and going to the Object properties dialogue box, on the Mental Ray tab you can set only specific objects to generate and receive caustics as well, like the image below:

15

Page 16: tutorials.render-test.comtutorials.render-test.com/worddocs/Caustics.docx  · Web viewIn this tutorial we are going to go over some advanced lighting ... We are going to clone this

Since we checked the All Objects button in our render setup however, it should automatically turn everything in our scene on to generate caustics.

Now adjust your Perspective window to get a good view into your box, and click the Render button to see the results!

Notice the differences between the caustic shapes that are generated above the surface of our water and below. Mental Ray automatically calculates the reflective light shapes for your and can seriously add some nice depth to anything from an ocean scene, to a pool, or a glass with liquid and ice in it! Pretty much anything that reflects and refracts light from gemstones to liquids.

16

Page 17: tutorials.render-test.comtutorials.render-test.com/worddocs/Caustics.docx  · Web viewIn this tutorial we are going to go over some advanced lighting ... We are going to clone this

17