MR Shaders Dielectric Materials Rendering Glass and Simple Caustics

Similar documents
Caustics - Mental Ray

Chapter 11. Caustics and Global Illumination

Materials in Kerkythea ~ a beginners guide

Submerge Camera Shader

Advanced Maya Texturing and Lighting

Turn your movie file into the homework folder on the server called Lights, Camera, Action.

critical theory Computer Science

Caustics - Mental Ray

TUTORIAL 7: Global Illumination & Ambient Occlusion

MITOCW MIT6_172_F10_lec18_300k-mp4

Advanced Maya e Texturing. and Lighting. Second Edition WILEY PUBLISHING, INC.

CGS 3220 Lecture 4 Shaders, Textures, and Light

Raycast Rendering Maya 2013

BIBIN FX.COM RENDERING BOTTLES IN MAYA MOSTAFA TALEBI BIBINFX.COM MOSTAFATALEBI.WEEBLY.COM

O Hailey: Chapter 3 Bonus Materials

V-RAY MATERIAL SETTINGS

Chapter 9- Ray-Tracing

Cast Shadows Maya 2013

CS130 : Computer Graphics Lecture 8: Lighting and Shading. Tamar Shinar Computer Science & Engineering UC Riverside

Let s Make a Front Panel using FrontCAD

Property of: Entrada Interactive. PBR Workflow. Working within a PBR-based environment

Shading, lighting, & BRDF Theory. Cliff Lindsay, PHD

Ok, so to get started we will take a look at the settings in the Render setup. If we were to take a render right now this is what we would see...

Rendering and Radiosity. Introduction to Design Media Lecture 4 John Lee

5: Electromagnetic Waves (Chapters 33 & 34) Snapshot of a light wave. Wave vs Particle. A Brief History of Light

Chapter 12- NURBS & Meta Shape Basics

Basic Texturing Tutorial by Gary Wu

Lecture 15: Shading-I. CITS3003 Graphics & Animation

Mental Ray for BK5100

IBL/GI & GLASS. Getting Realistic Results By Yon Resch. The Three Types of GI lighting and Glass

The Special Effects Handbook

Chapter 4- Blender Render Engines

Build Your Own Textures for Precious Vol. 1. Greetings!

Chapter 6- Lighting and Cameras

Mia Round Corners Node

CS 5625 Lec 2: Shading Models

Autodesk Fusion 360: Render. Overview

Shading 1: basics Christian Miller CS Fall 2011

Computer Graphics (CS 543) Lecture 7b: Intro to lighting, Shading and Materials + Phong Lighting Model

Rendering Part I (Basics & Ray tracing) Lecture 25 December 1, 2015

The Rendering Equation. Computer Graphics CMU /15-662

Lighting and Shading

So far, we have considered only local models of illumination; they only account for incident light coming directly from the light sources.

521493S Computer Graphics. Exercise 3

Visual cues to 3D geometry. Light Reflection and Advanced Shading. Shading. Recognizing materials. size (perspective) occlusion shading

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

Lighting & 3D Graphics. Images from 3D Creative Magazine

Shading I Computer Graphics I, Fall 2008

Problem Set 4 Part 1 CMSC 427 Distributed: Thursday, November 1, 2007 Due: Tuesday, November 20, 2007

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

4) Finish the spline here. To complete the spline, double click the last point or select the spline tool again.

How does light energy travel? transparent transmit mediums media medium

CS 465 Program 5: Ray II

COPYRIGHTED MATERIAL. Working in Maya. Chapter 1. Maya Nodes

3ds Max certification prep

Lab 9 - Metal and Glass

Topic 9: Lighting & Reflection models 9/10/2016. Spot the differences. Terminology. Two Components of Illumination. Ambient Light Source

MASY Easy Caustics. A Manual

Advanced Distant Light for DAZ Studio

Topic 9: Lighting & Reflection models. Lighting & reflection The Phong reflection model diffuse component ambient component specular component

Topics and things to know about them:

Optics INTRODUCTION DISCUSSION OF PRINCIPLES. Reflection by a Plane Mirror

Ray Tracer Due date: April 27, 2011

Me Again! Peter Chapman. if it s important / time-sensitive

Lecture 7 Notes: 07 / 11. Reflection and refraction

Computer Graphics (CS 4731) Lecture 16: Lighting, Shading and Materials (Part 1)

Shading. Brian Curless CSE 557 Autumn 2017

CS 4620 Program 4: Ray II

COMP environment mapping Mar. 12, r = 2n(n v) v

Comp 410/510 Computer Graphics. Spring Shading

QUICK EXCEL TUTORIAL. The Very Basics

Recall: Basic Ray Tracer

Purpose: To determine the index of refraction of glass, plastic and water.

Simple Nested Dielectrics in Ray Traced Images

Movie: For The Birds. Announcements. Ray Tracing 1. Programming 2 Recap. Programming 3 Info Test data for part 1 (Lines) is available

Recollection. Models Pixels. Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows

An Approach to Content Creation for Trainz

Photorealism: Ray Tracing

Ray Tracing. CSCI 420 Computer Graphics Lecture 15. Ray Casting Shadow Rays Reflection and Transmission [Ch ]

diffuse diffuse reflection refraction diffuse mapping diffuse reflection reflection filter mapping mapping reflection

Reflections and Refractions in Ray Tracing

4. Refraction. glass, air, Perspex and water.

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet.

PHY 112: Light, Color and Vision. Lecture 11. Prof. Clark McGrew Physics D 134. Review for Exam. Lecture 11 PHY 112 Lecture 1

Texture Mapping. Images from 3D Creative Magazine

Mastering Truspace 7

Rendering. Illumination Model. Wireframe rendering simple, ambiguous Color filling flat without any 3D information

Advanced Gemstone Shaders

GLOBAL ILLUMINATION. Christopher Peters INTRODUCTION TO COMPUTER GRAPHICS AND INTERACTION

COMP371 COMPUTER GRAPHICS

AR-media TUTORIALS IMPROVING REALISM AMBIENT OCCLUSION. (June, 2011)

GEOMETRIC OPTICS. LENSES refract light, so we need to know how light bends when entering and exiting a lens and how that interaction forms an image.

I have a meeting with Peter Lee and Bob Cosgrove on Wednesday to discuss the future of the cluster. Computer Graphics

What is it? How does it work? How do we use it?

Assignment 10 Solutions Due May 1, start of class. Physics 122, sections and 8101 Laura Lising

Reflection & Refraction

REFLECTION & REFRACTION

Refraction Ch. 29 in your text book

CS452/552; EE465/505. Intro to Lighting

TSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY

Transcription:

Dielectric Material This shader is a physically based material shader that can be used to simulate dielectric media such as glass, water, and other liquids. The shader uses Fresnel's formulas for dielectric interfaces. This means that most light is transmitted through the surface for perpendicular incident directions while most light is reflected by the surface for grazing incident angles, simulating the behavior of real dielectric materials. The shader also uses Beer's law for absorption of light that passes through a medium. This means that the light is subject to an exponential falloff as it is transmitted between two surfaces with dielectric material. One of the most asked questions I get, aside from skin, is how I render glass and liquids without a lot of work. Often rendering glass and liquids will elicit headaches for the artist, have no fear, take two Excedrin s, and call on Mental Ray. With MR s dielectric materials we have the ability to acquire sharp looking glass with little work. There is however a couple of problems that could stump the artist during its use resulting in bad render errors. Hopefully, this info sheet will shed some light onto the myth that is Dielectric and get you rendering glass and liquids in no time. First, let s get some of the basic stuff out of the way for those whom have never worked with mental ray shader s and their integration into the Maya workflow. There are numerous ways to attach MR shaders within Maya so let s keep it simple. The best way to build a custom shader network for mental ray is to start off with a standard Maya shader like a Blinn, or a Lambert in Hypershade. Bring Blinn to the workspace and then display the input and output connections, as shown in figure 1. figure 1 Mental Ray shaders will always attach to the shading figure 2 group of a particular shader like our Blinn. Bringing up the attribute editor for the blinn1sg and then dropping down the MR tab displays all the connections for Mental Ray shaders, there are allot, but most often you will only use a couple and they are pretty self explanatory figure 2. Like any other attribute in Maya clicking the little checker icon will bring up the create render node window figure 3 for mental ray shaders. figure 3 Any questions you may have regarding this list seek the Maya help docs. On the left hand side of the window under the heading Rendering and Render Setup there is a little section titled Mental Ray Reference figure 4. Be warned that allot of the reference material is coding examples and more, shall we say, not so friendly techy jargon. Nonetheless, it can be beneficial as I will demonstrate later. Alright, with that little bit of the way that s build our glass shader. figure 4

Starting with a fresh Maya scene build a simple cup out of Nurbs, or Polys, like the one I am using shown in figure 5. Here I have a simple revolved cup made with nurbs and one spotlight shinning onto the surface. One thing to note is I have kept the nurbs patches for the outside, interior, and lip of the cup separate. Its best practice if you model your glass in this fashion and you ll soon see why. A render of this scene is demonstrated in figure 6. figure 5 figure 6 Next, open the Hypershade and create a Blinn shader, rename it to glass and bring up the attribute editor. Change the following to the settings displayed in figure 7. Highlighted elements are the ones I changed. figure 7 Once you have adjusted your settings attach the shader to the glass element, or nurbs patches. Now, open up the Render Settings and change Render Using to Mental Ray and then set quality to production. Fire off a test render and you will see something like figure 8. figure 8 Not too bad, a glass most people are happy with. Put a little reflection on it, some fake fresnel and it may suffice. Ah, but we can make it better!!

Alright time for MR to work its magic. Bring up the Hypergraph and open the attribute editor for the glass shader. Click the icon Go to Output Connection. The tab should switch to blinnsg1. Under the mental ray tab -> custom shaders locate and click the checkered box next to Material Shader and then select Dielectric Material figure 9. Your attribute editor will change to the settings for the newly attached material figure 10. figure 9 Leave everything default except Ior which is our refraction index for the medium, in this case glass, which for all intents and purposes is 1.34. Additionally set phong coef to something like 200. Close this window and fire off a render. You may get something like figure 11. If you did and are now confused, fantastic, just like everyone else who attempts a glass shader. If your render came out like nice glass, will that s awesome too, however you should still read what follows because one day you will encounter this problem its guaranteed. figure 10 This is a common rendering error when working with this particular material so let us find out why by opening the Maya help docs and looking up dielectric material. The description, presented below, sheds some light on the inner working of the dielectric material and provides the fix. Two achieve physically correct simulations it is important to use the correct surface interfaces. When modeling a glass of cognac three different interfaces are required: glass-air, glass-cognac, and cognac-air. The dielectric material uses the normals of the surface to distinguish the media on either side of the interface. For a dielectric-air interface the normals point into the air. For a dielectric-dielectric interface the normal point into a dielectric material which is "outside". To use the dielectric material the model normals must be oriented correctly unless the ignore_normals parameter is set to true. This shader cannot be used as a shadow shader. figure 11

Essentially this is a modeling problem concerning the direction of our surface normals. When a ray is sent out from the camera it hits the first wall of our glass and the shader basically goes Okay I have a ray hitting, because my normal points out to air I am entering a new dielectric material, lets start the calculation as the ray pass through the material it encounters the inner wall and says Alright I have just passed through one wall now the inner wall surface normal points toward the outer wall which tells me im entering another, new, dielectric material, guess I need to bend the light again. Resulting in no refraction and just reflection. Figure 12. How it should read is Alright I have just passed through one wall now the inner wall surface normal is pointing opposite the outer wall so I must be completely through the medium and I am now exiting back into air. Figure 13. Glass Profile Camera Ray Ray Hit Point (In and Out) Air Air or Liquid Ray bends through medium (Refraction) Surface Normal Air Air or Liquid figure 12 figure 13 Figure 12 is what we have happening within our render. Figure 13 is what we want happening. This is an easy fix and the reason why I keep the nurbs patches separate. For me I just select the inner wall and reverse the surface direction Edit Nurbs-> Reverse Surface Direction. If you modeled your glass differently display your normals to find out their direction. Select your object or patch of concern Nurbs Normal Display : Display -> Nurbs Componets -> Normals (Shaded Mode) Polygons: Display -> Custom Polygon Display (click little box and located and check Normals) Set your inner wall normals facing in, towards each other, and your outer wall normals facing out as seen in Figure 14. Agian to reverse normals on Nurbs Edit Nurbs-> Reverse Surface Direction. On Polygons Edit Polygons -> Normals -> Reverse. After we have our normals oriented correctly fire off a render and now we have something figure 15!. That s looking more like glass, but we need some shadows. Bring up the light and turn on ray traced shadows. Fire off another render (figure 16). Looking good, but there is a problem with the shadow. We can t see half of it! In order to correct this we have to use a MR Light Shader. figure 14 figure 15

In order to correct this we have to use a MR Light Shader. Again bring up the attribute editor for the spotlight, scroll down to the mental ray tab, open it up and find Custom Shaders, then light shader. Click the checkered box next to Light Shader and then select Physical Light (figure 17). You could use spotlight but I like this light shader the best. This shader is controlled by the colors value. Double click the color swatch and set the value appropriate to your scene. After a couple of test renders you ll get it. I left it at the default, you may need to adjust. Here is the render (figure 18). figure 17 figure 18 Turing on caustics is a simple process. The only bad thing is intensity, exponent, and amount is going to depend on the scene you are using. Therefore, play with the settings until it looks good. To start open up Render Settings and turn on caustics leaving everything default (Mental Ray Tab -> Caustics and Global Illumination). Now open up the attribute editor on the light and under Mental Ray, turn on emit photons. These are the settings I m using during a close to final render. Looking really good, but it still has problems with the shadow. The shadow is not rendering light passing through the glass, its just solid and thus incorrect. So what s the fix? Well, it isn t much of one. I still have yet to locate a way in which to render out shadows that reflect the transparency of an object. Honestly don t think there is a simple way in MR. The only way to convey light passing through the glass is to turn on caustics, can you say render times! Oh well, least it s going to be a correct simulation of light through a dielectric material. For the Light : Render Settings: After a long wait, nada (figure 19) No good. One more step. In order to get correct caustic simulations from the dielectric material you have to attach one more MR shader, a photon shader to your glass. I mean MR has to know how to calculate photons hitting a medium like glass right? Anyway ways bring up the Attribute Editor for the glass shader group. Hypergraph->double click glass-> show output connections Locate photon shader, click the checker box, then attach the Dielectric Photon Material. Set the Ior to what you set before 1.34. Same process as attaching the original Dielectric material to the blinn s shading group, just a different location and shader type. Fire off another render and wow, look how pretty.

That s about all there is to making glass in MR; pretty simple stuff and a good way to introduce working with MR Shaders and how they interface within Maya. You can use a duplicate of the glass material, same process, to render the liquid in the glass. The primary difference would be, of course, the color and transparency. In addition make sure to specify the in the Dielectric Material and in the Dielectric Photon Material the Color In and the Color Out. Ray coming in hits the glass that s the color in. Ray exits the liquid so that would dictate the color out. Here is a render with everything the same expect for the items I mentioned prior. Remember glass is very dependent on the scene. Since there is no environment in my simple scene the glass looks a little flat and plastic like. But I tell you true, once you set this up in an environment with stuff and colors to reflect and refract it really pops and sells. Addition: I wanted to discuss the normal direction problem because I think it highlights issues many people run into and don t know the cause. It also allowed me to further the discussion on the Dielectric Material, the way a Ray traces refracts through a medium like glass, thus providing you with some more insight. However know that in some cases you can remedy the rendering errors by checking Ignore Normals in the settings for the Dielectric Material. I advise against it because I never like to leave it up to the renderer to decide what s best. Setting it up correctly to begin with and understanding why is very important advice and remains the best work method too. However, if it works use it!!! 2006 Howard Coulby