Unconfigured Ad Widget

تقليص

إعـــــــلان

تقليص
لا يوجد إعلان حتى الآن.

"Making of Water Glasses" by Rick Timmons

تقليص
X
 
  • تصفية - فلترة
  • الوقت
  • عرض
إلغاء تحديد الكل
مشاركات جديدة

  • "Making of Water Glasses" by Rick Timmons


    The Dielectric Material Shader and Glass Physics Phenomena
    For readers "too used" to using raytrace glass this tutorial will seem quite alien in the beginning, and the methodology of modeling the objects utilizing these two materials will definitely appear even more alien. Both the Dielectric Material Shader and the Glass
    (Physics_Phen) are closely related to each other, though technically the glass ((physics_phen) also known as mental ray glass) is not a shader. These materials were created especially for those situations in which objects of differing IORs are brought to within close enough proximity to each other that the caustics from one will affect the other. You will find several settings unique to these materials that allow you to adjust for the passage of light through differing IORs.
    The goal of this tutorial will be to show you how to first create a simple drinking glass modeled specifically for these transparent shaders, and then show you how to create and adjust the settings for each.

    This tutorial was prepared and illustrated using 3D Studio Max 9, using other Max versions, particularly versions 6 and older, will yield differing results than what is illustrated in this tutorial. It may be necessary for some readers to tweak their settings to obtain satisfactory results. You will need the file GPP_DMS zip file below, once downloaded, uncompress into your Max scenes directory.
    Before starting, let's take a look at a common water glass with raytrace materials applied to it.


    The geometries for a raytrace glass and liquid are simple and straightforward. Two objects, one representing the glass itself and a second representing the liquid contained within that glass are modeled separately. The glass will have a raytrace material with a typical IOR of 1.5 applied to it, while the object representing the liquid will have a raytrace material with a typical IOR of 1.333 applied to it. As stated, simple and straightforward. Now, take a look at the splines used to create the objects for use with either the dielectric material shader (DMS) or the glass ((physics_phen) GPP).


    The use of transparent shaders requires special consideration during modeling. In the illustration, we see three distinct splines each representing that area where two differing IORs meet. Unlike raytrace that uses two solid objects for it's glass and liquid components, the geometry for transparent shaders is based upon where these differing IORs meet, for example, where the IOR or water meets the IOR of glass.

    It is helpful if you look at the splines (and the objects we'll be creating from them) as being the interface of two differing IORs rather than the outside borders of physical objects.

    Part One: Creation of the Water Glass
    1. You will now need to open the file Shader_Profiles.max. In the perspective view, we see the three splines illustrated above. Click the longest spline (yellow) labeled AirGlassLine that we will be lathing into our drinking glass. With the spline selected, click Modifiers (on the menu bar)>Patch/Spline Editing>Lathe. In the Modify Panel of the Command Panels, set segments to 36 and enable Weld Core.

    It is a good practice to label each object created, especially considering the number of objects that can often be used in a scene.
    Let's label this one AirGlassObject, then on the Modify Panel, right click Lathe in the modifier stack, select Collapse All and click yes.

    2. Our object is rather ragged looking, so let's take care of this before moving on. In the Modify Panel, under the Selection rollout, select Polygon and use your Select Object tool to select all of the polygons of AirGlassObject. Once selected, slide the Modify Panel down to the Surface Properties group and click on Auto Smooth. The default value of 45 is fine for our needs. Slide back up the Modify Panel to the Selection rollout and click on Polygon to close off the selection process. Your final result should look like this:


    3. If not already selected, select the AirGlassObject, right click to call up the quad menu, then click Hide Selected to remove it from view. Next, you will need to repeat Step 2 for each of the remaining splines, AirLiquidLine and GlassLiquidLine, and rename them AirLiquidObject and GlassLiquidObject respectively. Use Auto Smooth if needed.

    4. The above illustration shows our three objects separated from each other. You can save the file for future reference if you like, however, the main tutorial file "Project_Start.max" already has everything set up for you.
    Part Two: The Dielectric Material Shader
    Let's start by opening Project_Start.max, and hitting F9 for a Quick Render. See below:


    This scene is composed of a simple, cornered box, a target camera, an mr Area Omni with raytrace shadows enabled, and three drinking glasses. The center glass has had raytrace materials applied to both it's glass and liquid components, this will act as a comparison object to the other two. The left drinking glass will be used for the GPP material and the one on the right will be used for the DMS. At this point, only mental ray has been enabled, we will wait until we have our materials/shaders assigned before enabling caustics.

    1. Before working with DMS and GPP, let's hide the center objects that make up our raytrace drinking glass. With the selection tool, scroll out a selection that selects only the center glass and liquid, right click the selection then on the quad menu select Hide Selection.

    These objects are hidden so we don't have our test renders slowed by them. Now, select the DMS_GlassAirObject from the right glass (bright yellow), this is the largest of the objects that comprise the right drinking glass. Hit the M key to call up the material Editor, and select the first sample box on the second row. Click the Material Type button currently reading "Standard", then from the Material/Map Browser list double click mental ray. See below:



    The "mental ray Material" is not in itself a material, instead, it's a platform by which a material/shader is created through the use of shaders, Sound complex? It's not as difficult to understand once you understand what each of the components represents. For example, the two components we'll have an interest in shall be Surface in Basic Shaders and Photon in Caustics and GI. In the simplest of explanations, the surface shader is the equivalent to the Diffuse value we find in a standard material, while the photon shader's settings dictate how photons will react to that surface, i.e.. GI and caustics.
    With the DMS_GlassAirObject selected, and the mental ray materials panel open, select the None button to the right of Surface to call up the Material/Map Browser. Double click on Dielectric Material (3dsmax) and note what's just happened to our sample slot. See below:

    The "mental ray Material" is not in itself a material, instead, it's a platform by which a material/shader is created through the use of shaders, Sound complex? It's not as difficult to understand once you understand what each of the components represents. For example, the two components we'll have an interest in shall be Surface in Basic Shaders and Photon in Caustics and GI. In the simplest of explanations, the surface shader is the equivalent to the Diffuse value we find in a standard material, while the photon shader's settings dictate how photons will react to that surface, i.e.. GI and caustics.
    With the DMS_GlassAirObject selected, and the mental ray materials panel open, select the None button to the right of Surface to call up the Material/Map Browser. Double click on Dielectric Material (3dsmax) and note what's just happened to our sample slot. See below:


    To the novice this would seem like a black ring, but is, in fact, our transparent material. Click the Background button to place a checkered pattern in the material slot. Name the material DMS_GlassAirObject. By default, this shader is already set up for a glass object, thus, we need not make any adjustments to it. Click the Assign Material to Selection button, then click the Go to Parent button. Name the material DMS_GlassAirObject. We now have what we want the surface to appear like assigned to our object, yet, because we're designing this object to look like glass, there is one more aspect of this material we need to take care of, and that's the reaction of photons with that surface. With the Dielectric Material Shader, this is a simple matter of copying the Surface settings to our Photon settings. See below:


    Click and drag the Surface button to the Photon button, and select Instance from the Copy Panel. Click OK to close the panel. What we have just done is to copy our Surface settings to our Photon settings, since we need for both of these settings to be identical to each other.
    2. Let's see how our material looks with a Quick Render (F9).


    At this point, it looks similar to raytrace glass, but once we apply the DMS to the remaining two objects subtle differences between the two materials will become more apparent.
    3. With our first material created and applied, the remaining two are fairly easy to create. In the Material Editor, click on the DMS_GlassAirObject material to select it, then drag a copy of it to the second slot to the right. Hit H to call up the Select Objects panel and select DMS_AirLiquidObject, the smallest of the three objects. Click the Surface button to return us to the Dielectric Material (3dsmax) panel. Because our chosen object is the interface between air and liquid, we will need to make a change in the Index of Refraction from 1.5 to 1.333. Rename the material DMS_AirLiquidObject, click the Go to Parent button, and rename the material here DMS_AirLiquidObject. Assign the material to the selection. Because we Instance copied our Surface settings to the Photon settings in our first material then copied that material to the second slot it's not necessary that we drag a copy from the Surface button to the Photon button.





    4. The third material we'll create will need special attention in its creation, as this one is an actual interface between two physical objects of differing IORs. Before moving on with this material there is something important that should be noted. You'll remember, and have probably wondered why we didn't take the element of air into account while creating the two previous materials for the DMS_GlassAirObject and DMS_AirLiquidObject. In Max, and for that matter, in any other 3D program that I know of, the element of air isn't physically modeled, that is, made into a physical object, after all, how could you apply a material to a non entity? Thus, air is considered an implicit object with an effective IOR of 1.
    Our third object, DMS_GlassLiquidObject, is the point where the element of water (a physical object with an IOR of 1.333) meets the element of glass (a physical object with an IOR of 1.5). Hit H to call up the Select Objects list, and choose DMS_GlassLiquidObject. In the Material Editor, select the second material we just created for the DMS_AirLiquidObject and slide a copy of it over to the third material slot. Click the Surface button to take you to the Dielectric Material (3dsmax) Parameters. This object represents that interface where the object of water meets the object of glass, that is, we'll have light traveling through these two objects with their differing IORs. The first setting we'll adjust shall be the Index of Refraction (out) that we'll enter a value of 1.5 for. This is the IOR of the glass material. Name the material DMS_GlassLiquidObject, click Return to Parent and rename the material DMS_GlassLiquidObject here as well.
    Assign the material. Let's try a quick render (F9).


    Our render shows a large dark area where the DMS_GlassLiquidObject is located. Our current settings aren't allowing the light to pass through the interface, i.e., from the liquid side to the glass side.
    To correct this, return to the DMS_GlassLiquidObject material in the Material Editor, click Surface and set the Outside Light Persistence to pure white. Click on the Outside Light Persistence color swatch and slide the Whiteness slider all the way down. White will work fine for this project, though other values of grey and even colors can be used to suit the needs of your scene. Try Quick Render (F9) again.


    There is one more adjustment I'd like to familiarize you with before we move to the GPP portion of this tutorial. The Persistence Distance is closely dependent on the Light Persistence setting, and controls the distance at which the level of light passing through the objects is reduced to the level specified by Light Persistence.

    Step 3: Glass (Physics_Phen)

    1. Hit H to call up your Select Objects list, and on this list double click GPP_GlassAirObject. Open Material Editor (M), and slide the sample slots up one row to expose the unused third row. Click to select the first sample slot, then click the Material Type button (reading Standard) to open the Material/Map Browser. Double click Glass (physics_phen). Look familiar?


    Glass (physics_phen) is technically a mental ray material. Its photon and surface properties, however, are governed by the Dielectric Material Shader we learned about earlier. Like the first DMS material we applied to DMS_GlassAirObject, the default settings for GPP need no adjustments as it's already set for glass. Name the material GPP_GlassAirObject then click Assign to Selection button. Now, like before, click the newly created material and slide a copy of it to the second slot of the third row. Hit H to call up the Select Objects panel, and then double click GPP_AirLiquidObject. With this second GPP material, we need only change the Index of Refraction to 1.333. Name the material GPP_AirLiquidObject and assign it to the selection.
    Again, click the second material and slide a copy of it to the third slot. Hit H and select GPP_GlassLiquidObject from the Select Objects list. Earlier in the tutorial when we worked with DMS_GlassLiquidObject, we had to make special considerations for the material assigned to it. With GPP this must also be done, because this interface is where two physical forms (water and glass) are adjacent to each other. Enter a value of 1.5 into the Index of Refraction (out). Next change the shade value of Outside Light Persistence to pure white. Name the new material GPP_GlassLiquidObject and assign it. Try a Quick Render (F9).



    Our two drinking glasses are now turned to glass. It's time to return our Raytrace glasses to the scene, enable caustics and try a Quick Render to see what we've created.
    Step 4: Enabling mr Caustics
    1. Before enabling caustics, let's first tell mental ray which of our objects shall be generating caustics. Click anywhere in the Camera viewport where there's no object, and from the Quad Menu select Unhide All. This returns to our scene the two hidden raytrace objects.
    Next, hit H to call up the Select Objects list and from this list selects the following items: Camera01, Camera01.Target and Enclosure.
    Click Invert, then select. Right click on any of the three glasses, and from the Quad Menu, select Object Properties > mental ray tab, and in the Indirect Illumination section enable Generate Caustics. Click OK. Hit F10 to bring up the Render Scene dialog panel. Click the Indirect Illumination tab, and depending on the version of Max/mental ray you're using, slide down the panel to the Caustics and Global Illumination (GI) rollout. For now, enable Caustics only, leaving all other settings to their default values and hit F9.


    At default settings our render is quite sloppy. Let's take care of both the photon size and clarity problems before moving onward. In the Caustics group, enable Maximum Sampling Radius and set a value of 6 inches. Next, slide down the panel to the section Light Properties and increase the Average Caustic Photons per Light from 10000 to 35000. Your next Quick Render should yield a result similar to this:



    This would be a good point to start making further adjustments to improve the quality of the render. The last matter we need to tend to concerns the trace depth of our project, this is especially notable by the lack of caustic light in the shadow field of the raytrace glass.
    On the Render Scene panel (F10), click the Indirect Illumination tab and slide down to the area Caustics and Global Illumination (GI) to the Trace Depth Section. Set the Maximum Depth to 10, Maximum Reflections to 2 and Maximum Refractions to 8. And try your Quick Render (F9) again.


    Which one is better? I'll leave that to you to decide. Imagine the possibilities with HDRI and/or a better background. You'll be surprised at what you can learn by experimenting with the settings to these materials. And here's a parting shot of the GPP and DMS in a real world scene. Good luck to all in your work.

يعمل...
X