{"id":3875,"date":"2010-09-07T01:44:40","date_gmt":"2010-09-07T01:44:40","guid":{"rendered":"http:\/\/www.mrbluesummers.com\/?p=3875"},"modified":"2010-12-04T18:50:17","modified_gmt":"2010-12-04T18:50:17","slug":"mental-ray-arch-design-overview","status":"publish","type":"post","link":"http:\/\/www.mrbluesummers.com\/3875\/3d-tutorials\/mental-ray-arch-design-overview","title":{"rendered":"mental ray Arch & Design Overview"},"content":{"rendered":"
This is a duplicate of the Arch & Design Overview document by Autodesk and not written by Mr. Bluesummers.<\/strong><\/p>\n This topic serves as an introduction to the Arch & Design material for mental ray.<\/p>\n A range of material effects available with the Arch & Design material.<\/p>\n<\/div>\n The mental ray Arch & Design material is a monolithic material shader designed to support most materials used in architectural and product-design renderings. It supports most hard-surface materials such as metal, wood and glass. It is especially tuned for fast glossy reflections and refractions (replacing the DGS material) and high-quality glass (replacing the dielectric material).<\/p>\n The major features are:<\/p>\n The Arch & Design material attempts to be physically accurate, hence its output has a high dynamic range. How visually pleasing the material looks depends on how colors inside the renderer are mapped to colors displayed on the screen.<\/p>\n When rendering with the Arch & Design material it is highly recommended that you operate through a tone mapper\/exposure control such as the mr Photographic Exposure Control in conjunction with gamma correction, or at the very least use gamma correction.<\/p>\n Describing all the details of gamma correction is beyond the scope of this topic; this is just a brief overview.<\/p>\n The color space of a normal, off-the-shelf computer screen is not linear. The color with RGB value 200 200 200 is not twice as bright as a color with RGB value 100 100 100, as one might expect.<\/p>\n This is not a bug because, due to the fact that our eyes see light in a nonlinear way, the former color is actually perceived to be about twice as bright as the latter. This makes the color space of a normal computer screen roughly perceptually uniform. This is a good thing, and is actually the main reason 24-bit color (with only 8 bits or 256 discrete levels for each of the red, green and blue components) looks as good as it does to our eyes.<\/p>\n The problem is that physically correct computer graphics operates in a true linear color space where a value represents actual light energy. If one simply maps the range of colors output to the renderer naively to the 0\u2013255 range of each RGB color component it is incorrect.<\/p>\n The solution is to introduce a mapping of some sort. One of these methods is called gamma correction.<\/p>\n Most computer screens have a gamma of about 2.2 (known as the sRGB color space), but 3ds Max defaults to a gamma of 1.8, which makes everything look too dark (especially midtones), and light does not \u201cadd up\u201d correctly.<\/p>\n Using a gamma of 2.2 is the theoretically correct value, making the physically linear light inside the renderer appear in a correct linear manner on screen.<\/p>\n However, because the response of photographic film isn\u2019t linear either, users find that this theoretically correct value looks too bright and washed out. A common compromise is to render to the default gamma of 1.8, making things look more photographic; that is, as if the image had been shot on photographic film and then developed. However, when exporting and importing images (for example, as texture maps) with external image-editing programs, for best results set all gamma values on Preferences > Gamma and LUT Preferences to 2.2.<\/p>\n Another method for mapping the physical energies inside the renderer to visually pleasing pixel values is known as tone mapping. You can accomplish this either by rendering to a floating-point file format and using external software, or with a plug-in that allows the renderer to do it on the fly. In 3ds Max such plug-ins are known as exposure controls and are accessed from the Environment dialog.<\/p>\n The Arch & Design material is designed to be used in a realistic lighting environment; one that incorporates full direct and indirect illumination.<\/p>\n mental ray provides two basic methods for generating indirect light: Final Gathering and Global Illumination. For best results, be sure to use at least one of these methods.<\/p>\n At the very least, enable Final Gathering, or use Final Gathering combined with Global Illumination (photons) for quality results. Performance tips for using Final Gather and Global Illumination can be found here.<\/p>\n If you use an environment for your reflections, make sure the same environment (or a blurred copy of it) is used to light the scene through Final Gathering. In 3ds Max this means you should include a Skylight in your scene set to Use Scene Environment, or use Daylight system with Skylight set to mr Sky.<\/p>\n Traditional computer-graphics light sources live in a cartoon universe where the intensity of the light doesn\u2019t change with the distance. The real world doesn\u2019t agree with that simplification. Light decays when leaving a light source due to the fact that light rays diverge from their source and the intensity of the light changes over distance. This decay of a point light source is 1\/d2; in other words, light intensity is proportional to the inverse of the square of the distance to the source.<\/p>\n One of the reasons for this traditional oversimplification is the fact that in the early days of computer graphics, tone mapping was not used and problems of colors blowing out to white in the most undesirable ways was rampant. (Raw clipping in sRGB color space is displeasing to the eye, especially if one color channel clips earlier than the others. Tone mapping generally solves this by \u201csoft clipping\u201d in a more suitable color space than sRGB.)<\/p>\n However, as long as only Final Gathering (FG) is used as indirect illumination method, such traditional simplifications still work. Even light sources with no decay still create reasonable renderings. This is because FG is concerned only with the transport of light from one surface to the next, not with the transport of light from the light source to the surface.<\/p>\n It\u2019s when working with Global Illumination (GI) (that is, with photons) the troubles arise.<\/p>\n When GI is enabled, light sources shoot photons. For the Arch & Design material (or any other mental ray material) to be able to work properly, it is imperative that the energy of these photons to match the direct light cast by that same light. And since photons model light in a physical manner, decay is built in.<\/p>\n Hence, when using GI:<\/p>\n Light sources must emit photons at the correct energy. In 3ds Max this is most easily solved by using the photometric lights. All of these lights are guaranteed to have their photon energy in sync with their direct light. It is built in and automatic and one does not need to worry about it.<\/p>\n From a usage perspective, the shading model consists of three components:<\/p>\n The Arch & Design material shading model<\/p>\n<\/div>\n Direct and indirect light from the scene cause diffuse reflections as well as translucency effects. Direct light sources also create specular highlights.<\/p>\n Ray tracing is used to create reflective and refractive effects, and advanced importance-driven multi-sampling is used to create glossy reflections and refraction.<\/p>\n The rendering speed of the glossy reflections\/refraction can further be enhanced by interpolation as well as \u201cemulated\u201d reflections with the help of Final Gathering.<\/p>\n One of the most important features of the material is that it is automatically energy conserving. This means that it makes sure that diffuse + reflection + refraction <= 1. In other words, no energy is magically created and the incoming light energy is properly distributed to the diffuse, reflection and refraction components in a way that maintains the first law of thermodynamics.<\/p>\n In practice, this means, for example, that when adding reflectivity, the energy must be taken from somewhere, and hence the diffuse level and the transparency will be automatically reduced accordingly. Similarly, adding transparency happens at the cost of the diffuse level.<\/p>\n The rules are as follows:<\/p>\n From left to right: Reflectivity=0.0, 0.4, 0.8, and 1.0<\/p>\n<\/div>\n From left to right: Transparency=0.0, 0.4, 0.8, and 1.0<\/p>\n<\/div>\n Conservation of energy also means that the level of highlights is linked to the glossiness of a surface. A high Reflection Glossiness value causes a narrow, intense highlight, while a lower value causes a wider, less intense highlight. This is because the energy is now spread out and dissipated over a larger area.<\/p>\n In the real world, the reflectivity of a surface is often view-angle dependent. A fancy term for this is bidirectional reflectance distribution function (BRDF); that is, a way to define how much a material reflects when seen from various angles.<\/p>\n The reflectivity of the wood floor depends on the view angle.<\/p>\n<\/div>\n Many materials exhibit this behavior. The most obvious examples are glass, water, and other dielectric materials with Fresnel effects (where the angular dependency is guided strictly by the index of refraction), but other layered materials such as lacquered wood and plastic display similar characteristics.<\/p>\n The Arch & Design material allows this effect to be defined by the index of refraction, and also allows an explicit setting for the two reflectivity values for:<\/p>\n The final surface reflectivity is in reality caused by the sum of three components:<\/p>\n Diffuse, reflections, and highlights<\/p>\n<\/div>\n In the real world, highlights are just glossy reflections of the light sources. In computer graphics it\u2019s more efficient to treat these separately. However, to maintain physical accuracy the material automatically keeps highlight intensity, glossiness, anisotropy, etc. in sync with the intensity, glossiness and anisotropy of reflections. Thus, there are no separate controls for these as both are driven by the reflectivity settings.<\/p>\n The material supports full glossy anisotropic transparency and includes a translucent component, described in detail here.<\/p>\n Translucency<\/p>\n<\/div>\n The transparency\/translucency property can treat objects as either solid or thin-walled.<\/p>\n If all objects were treated as solids at all times, every window pane in an architectural model would have to be modeled as two faces: an entry surface that refracts the light slightly in one direction, and immediately following it an exit surface, where light is refracted back into the original direction.<\/p>\n Not only does this entail additional modeling work, it is a waste of rendering power to simulate refraction that has very little net effect on the image. Hence the material allows modeling the entire window pane as a single flat plane, foregoing any actual refraction of light.<\/p>\n Solid vs. thin-walled transparency and translucency<\/p>\n<\/div>\n In the preceding illustration the helicopter canopy, the window pane, the translucent curtain, and the right-hand sphere all use thin-walled transparency or translucency, whereas the glass goblet, the plastic horse, and the left-hand sphere all use solid transparency or translucency.<\/p>\n Beyond the \u201cphysical\u201d transparency, which models an actual property of the material, the material provides a completely separate, non-physical \u201ccutout opacity\u201d channel to allow \u201cbillboard\u201d objects such as trees, or to cut out objects such as a chainlink fence with an opacity mask.<\/p>\n Ambient Occlusion (AO) is a method spearheaded by the film industry for emulating the look of true global illumination by using shaders that calculate the extent to which an area is occluded, or prevented from receiving incoming light.<\/p>\n Used alone, an AO shader, such as the separate mental ray Ambient\/Reflective Occlusion shader, creates a grayscale output that is dark in areas light cannot reach and bright in areas where it can:<\/p>\n The following image illustrates the main results of AO: dark crevices and areas where light is blocked by other surfaces, and bright areas that are exposed to the environment.<\/p>\n An example of AO applied to a scene<\/p>\n<\/div>\n One important aspect of AO is that the user can how far it looks for occluding geometry.<\/p>\n<\/a><\/p>\n
What Is the Arch & Design Material?<\/h2>\n
\n
Physics and the Display<\/h2>\n
A Note on Gamma<\/h3>\n
Tone Mapping<\/h3>\n
Use Final Gathering and Global Illumination<\/h2>\n
Use Physically Correct Lights<\/h2>\n
\nThe direct light must decay in a physically correct way to match the decay of the photons.
\nTherefore it is important to make sure the light shader and the photon emission shader of the lights work well together.<\/p>\nFeatures<\/h2>\n
The Shading Model<\/h3>\n
\n
<\/a><\/p>\n
Conservation of Energy<\/h3>\n
\n
<\/a><\/p>\n
<\/a><\/p>\n
BRDF: How Reflectivity Depends on Angle<\/h3>\n
<\/a><\/p>\n
\n
Reflectivity Features<\/h3>\n
\n
<\/a><\/p>\n
Transparency Features<\/h3>\n
<\/a><\/p>\n
Solid versus Thin-Walled<\/h3>\n
<\/a><\/p>\n
Cutout Opacity<\/h3>\n
Special Effects<\/h2>\n
Built-in Ambient Occlusion<\/h3>\n
<\/a><\/p>\n