Friday, 15 January 2010

Tuesday, 12 January 2010

3ds max: mental ray_Normal FG process VS Render to texture FG process


Not long ago someone asked me if there was a function in mental ray that could enable a user to compute the final gather solution of the entire scene, from one still camera.

After scratching my head for few minutes, I came up with a solution:

Rendering to texture (0)- This function forces mental ray to compute the FG solution and render each selected object in the entire scene:

1-Open the render setup dialog box and set the fg to its draft default settings.

2-On reuse (FG and GI disk caching) parameters, under final gather map group, set mental ray to incrementally add FG points to map files and set its file name. Note that the, calculate fg/gi and skip final rendering function, is overridden by the, render to texture process, therefore unchecked for this particular exercise.





3-In the scene, select all objects (only) and press 0. The render to texture dialog box should appear. Set its output path. On the objects to bake parameters, under name field, you should see a list of all previously selected objects in the scene.





Scroll down to output name field; click add and select the diffusemap element. Note that, we are only choosing these settings in order to force “render to texture” to render and save the FG solution.

4-On target map slot, choose varies.

5-On map size, choose 512x512, followed by enabling lighting and shadows functions, on selected element unique settings group.

6-On baked material parameters choose the output into source function and Save the Max file (ctrl+s).

7-Set the mental ray’s sampling quality to draft and click render.








8-Choose ok to any of the dialog warnings that may appear. Once the render to texture process is finished, close the Max file without saving.

9- Reopen the Max file; set mental ray to read from the previously saved FG solution and render the scene from a variety of different camera angles at high resolution.

It is worth mentioning that this FG solution may give you slightly different results than the conventional (i.e. normal) FG process. These FG variations are no different to the ones often encountered between Net render and local render, or distributed bucket rendering.

Finally, if the Max file crashes during the FG computation, it is worth re computing the render to texture FG process again(i.e. delete the current FG map and re compute); as FG map file may be corrupt. Also, overwrite any previously saved render to texture files.





Please see below the render results with and without the render to texture FG process:

Alternatively, one could also use the distortion (lume) shader to create a 360 degree FG solution however; the FG solution will be based on the original camera position.
For those not familiar with the above methodology, it is covered in detail in the 2nd edition of our book.


I hope you have found this post useful.

Ta

J



My 3D Portfolio:

New Book: 3D Photorealistic Rendering: Interiors & Exteriors with V-Ray and 3ds Max



More tips and Tricks:

Post-production techniques

Tips & tricks for architectural Visualisation: Part 1

Essential tips & tricks for VRay & mental ray

Photorealistic Rendering

Creating Customised IES lights

Realistic materials

3d: mental ray_The usual suspects: Displacement and Proxy errors



The above image was produced whilst at GMJ Design ltd


Although we had meticulously covered numerous ways of optimizing the 3D scenes and rendering times in our latest book, the following tips will further help you to address other common memory errors.

With displacement and proxies,the memory is only allocated at render time. So even when your small test renders seem ok and the FG files had been cached, your computer may still run out of memory when rendering the final high resolution image.

Overcoming the problem:

1- Ensure that you have opened the mental ray message window dialog box with all its functions checked, in order to follow the rendering process and detect any problems, whilst paying attention to the buckets being rendered on frame buffer.

2-Proxy errors are often only detectable by looking at the last rendered buckets computed on the frame buffer before the crash, and the last messages from mental ray messages window dialog box.

Normally it should read as follows: “...mip binaryproxy= Loading ...bytes geometry.”

Followed by this message “... progr= scene cache flushed asynchronously ...MB for module job, now: ...MB” and the final mental error message dialog box: “The render was cancelled due to insufficient memory...”.









These errors can be rectified by first changing the ray tracing acceleration to BSP2 type.




Next, ensure that you reduce the amount of copied proxies in your scene. By that, copy instance all similar plants, grass or/and trees in the scene(or other types of geometry) . If there are too many sets of different plants and trees in the scene, then it would be worth attaching them as normal copied meshes first, and later convert them into proxies.


This exercise is to reduce the amount of copied proxies in the scene. The ideal situation would be to have mental ray load up proxies only once (i.e. multiple instanced proxies or one big proxy with different sets of plants, trees etc, originally attached together as one mesh).

Finally, reduce the density of the relevant geometry and increase the page file as previously shown. The process of creating and working with proxies is covered in detail in the 2nd edition of my book with Roger.



3-Displacement errors are easier to detect and tackle. The mental ray message should indicate the “rogue” object/s’ name and mention “...retesellation...”: “...ms from ground (geomObject(mesh00)...”.

followed by “...aborting, not possible to avoid retesellating...”; “...scene cache flushed asynchronously...”.

And the final mental ray error dialog box reading: “The render was cancelled due to insufficient memory...”.







To solve this problem, simply open the renderer tab, on shadows and displacement parameters, under displacement (global settings), change the Max. Subdiv value to 1k or lower. This should be sufficient. Note that, values lower than 256 may result in a very faceted displacement (i.e. not accurate), so it is worth gradually decreasing/test rendering the values without compromising the quality too much.




Note: In addition to the above mentioned,in very extreme and difficult cases of memory loss, one can additionally enable the "use fast rasterizer (rapid motion blur) function, from the "rendering algorithms" parameters.
This rendering method will bypass most mental ray memory issues.

It is worth noting that although very powerful, this rendering algorithm disables some of render elements. To override this, simply render the file output to an EXR file extension type, provided one has the material IDs/Object IDs,etc, originally enabled in 3Ds Max.

If facing difficulties extracting these EXR passes in Photoshop,After Effects,etc;simply switch your 3Ds Max back to standard mental ray rendering algorithm when computing your AO pass, and enable your rendered elements again; with cached FG at a very low res to render the final output in higher res.

I hope you found this post useful.


Ta

Jamie



My 3D Portfolio:



More tips and Tricks:

Post-production techniques

Tips & tricks for architectural Visualisation: Part 1

Essential tips & tricks for VRay & mental ray

Photorealistic Rendering

Creating Customised IES lights

Realistic materials

Creating a velvet/suede material 

FoxRenderfarm

www.arroway-textures.com 

Renderpeople

Gobotree

.

3ds max: mental ray_Converting a vray Max scene to mental ray





In production/Architecture/3D visualisation companies, it is very common for users to inherit/acquire 3D scenes with incompatible rendering engines and shaders/bitmaps.
The majority of these 3D scenes come in VRay (i.e. Archmodels; Turbosquid; etc). Due to the amount of geometry/3D scenes that one may require converting, it is often commendable to use script/s to speed up this otherwise tedious and time consuming process.
The following steps will help you fast track the above process:


Also, check my New Book: 3D Photorealistic Rendering: Interiors & Exteriors with V-Ray and 3ds Max


1-One needs to have a version of vray (i.e. even a Demo version would be ok) compatible with your version of Max, already installed. It is highly advisable to work in a separate Max scene to the main one, to prevent merging any possible bugs; missing bitmaps; etc.
Once the conversion/s is/are completed and "stress tested” for errors, then it is safe to merge it/them into one's main scene.


2 –Open your Vray Max scene and run the script as described in The Book.





3-Now that the scene had been converted to mental ray; you need to load the mental ray renderer. Some of the original Vray material slots may become empty during the conversion. Open the "material/map browser" dialog to view all materials in the scene. Select a slot in the material editor. Back on the "material/map browser" dialog, double click on any of the newly converted mr materials to load it in the material editor. Repeat the action with all relevant materials from the "material/map browser" dialog.






4-When converting the scene from Vray to mental ray, the script tries to maintain the integrity of each material (i.e. glossy levels, bitmaps, values, etc) however, certain materials may still require some attention:

Prior to moving bitmaps and/or changing mental ray presets, one should make a copy of the relevant slot/s for reference purposes(i.e. drag and drop it onto another slot).
This is mainly in case one requires copying and pasting settings/bitmaps from the reference copy onto the new preset.




Vray reads opacity as white and mental ray reads it as black. As result one may require inverting colours in order for mental ray to read them accurately.
To do this, simply check/enable the "invert" function, on the bitmap "output" parameters".
The opacity bitmaps require moving to the "cutout" toggle, under the "special purpose map" parameters.




Since there are mental ray preset shaders for most real world materials, you may wish to apply these physically accurate template shaders to some of these newly converted materials.
Some of the most popular templates used are: Metal materials (i.e. chrome, brushed metal etc); Glass (i.e. glass thin geometry; glass solid geometry for thick glass and glass physical for goblets, champagne flutes etc); glossy plastic; water; masonry and promaterial shaders.

Some of these new templates may have the diffuse colour values very low; simply increase it to 1.0.
Also the colour "diffuse" toggle may be disabled by default; simply scroll down to the general maps parameters and check the "diffuse" color toggle to enable it.







Also, increase the "fast glossy interpolation" value preset as explained in our book.
To clear all unused Vray materials in the scene, simply click the "utilities" menu from the material editor.
On the dropdown list, choose the condense material editor slots function.
To be on the safe side,some users also choose the "reset material editor slots" utility thereafter.
Finally, in the material editor, one can reload the shaders being used in the scene as described earlier; test render the scene for any possible errors and merge it/them into your main scene.



I hope you have found this post interesting.

Ta

Jamie



My 3D Portfolio:

New Book: 3D Photorealistic Rendering: Interiors & Exteriors with V-Ray and 3ds Max



More tips and Tricks:

Post-production techniques

Tips & tricks for architectural Visualisation: Part 1

Essential tips & tricks for VRay & mental ray

Photorealistic Rendering

Creating Customised IES lights

Realistic materials

Creating a velvet/suede material 

FoxRenderfarm

www.arroway-textures.com 

Renderpeople

Gobotree


.

3ds max: Decoding mental ray BSP tree




After few requests for an insight into the BSP parameters; I have managed to find time to put some thoughts together.

Please note: this subject, although in our latest book, does not give such detail as seen here, due to the final page count and the targeted audience.




The Theory

BSP tree stands for Binary Space Partition tree.

It is worth noting that although the BSP parameters are under the ray tracing group, it only affects the geometry, as oppose to reflections, etc.

This ray trace acceleration method essentially helps mental ray to cast rays in a speedy matter by creating an imaginary bounding box around the entire scene, with subdivisions.
These subdivided patches/cells inside the bounding box are technically designated as voxels.
Mental ray usually splits all voxels of the scene in three axes (i.e. X; Y; Z); in almost equal number of triangles, until depth is reached.
The "Size" and "Depth" parameters help mental ray to determine the total number of triangles(i.e.leafs)to be processed for ray casting/testing.
The higher the depth values, the fewer the voxels will be.
Fewer voxels equals faster rendering times, as mental ray will use fewer voxels to test the rays against.


When shooting a ray there are 2 phases

a) Moving down the BSP tree depth whilst checking/hitting all axis of each voxel.


b) Whilst checking/hitting voxels, it will touch triangles(i.e. leafs) in the process. If perchance there are 1000 triangles(i.e. leafs) in a voxel; each will be tested 40 times (i.e. default depth value).
Subsequently the rendering times will be slow.
If there are only 10 triangles(i.e. leafs), the process will be faster.
With this in mind, the user’s goal should be to reduce the number of average and maximum leafs in the BSP tree.

The total rendering time is a combination of the time it takes to create the voxels, move down the tree depth(i.e. pre processing/translation); and the final time to check/split the triangles (i.e. leafs) during the rendering time.




The default BSP ray trace acceleration method is often used for small/medium Max scenes (i.e. less than one million triangles/polygons).
Users often press the hotkey 7 to determine the number of polygons/faces/triangles in the scene.

The default Size value of 10 sets the minimum number of objects to be found in the scene before a voxel is split (in all three axes (i.e. X; Y; Z).
Smaller values equates to more voxels and slower rendering times.



The default BSP Depth value of 40 sets the maximum number of subdivisions/splits (i.e. tree levels) per triangle(i.e lesf) in the voxel of the BSP tree.
These divisions are technically designated as levels (i.e. tree levels).

Each Depth value is considered to be one level (i.e. level 1= trunk; level 2= branch; level 3= branch; etc).

In general, increasing the depth values reduces the average leaf size(i.e. triangles); which is very beneficial for high resolution renders.
The leafnodes and the bsp size(kb)may also increase in size subsequently.

If using displacement maps this theory may not work, as displacement materials will generate more triangles at render time.
The higher the resolution,the more triangles will be generated. If this is the case, simply switch it to BSP2 type.

Animated scenes are also quite difficult to control the max and average leaf size, as objects appear and disappear in the camera view.
Perhaps it’s best to place the camera in position where it captures all the objects in scene; followed by working out the best(i.e. lowest number) max and average leaf size of the BSP tree.


The BSP Depth values seem to generally have more impact in the rendering times than the Size values.
Increasing the Depth value (to 50 or above) may reduce the final rendering times (i.e. faster).
This is more beneficial for high resolution renders (i.e. 3500 pixles, or higher resolutions).

The default BSP values (i.e.10/40) work best in most scenes with less than one million triangles.
If not satisfied, then one can begin tweaking with its default values.

From my personal experience, the BSP parameters often have more significant results when instructed to use less memory (i.e. increased rendering times), than otherwise.

As mentioned earlier, to instruct mental ray to use less memory simply increase the default (i.e. 10) BSP Size values, and/or decrease the default (i.e. 40) BSP Depth values.


BSP2 method automatically maintains the balance between memory consumption and rendering times...in large complex scenes (i.e. more than one million triangles/polygons).

BSP2 also handles better the motion blur, instanced geometry and dynamic scenes. This is another major advantage over the default BSP method.

Note that when used in smaller scenes, BSP2 may take longer to render.
Users often press the hotkey 7 to determine the number of polygons/faces/triangles in the Max scene.

In scenes with over 1,000,000 triangles/polygons, it's often pointless to tinker with the default BSP values, as one would have random results most of the times.
It is safer,productive and more predictable to use the BSP2 method for scenes with over 1,000,000 triangles/polygons.




To have a visual representation of the BSP process, simply go to the mental ray processing parameters rollout. Under "diagnostics" parameters, enable the “visual” group:

This visual group consists of the following:

1-Sampling rate

2-coordinate space

3-Photon

4-BSP

5-Final Gather

The BSP visual diagnostics is divided by three different colours:

Blue, Green and Red.

Blue areas represent the lower areas of subdivision (i.e. less computation)

Green areas represent the middle areas of subdivision (i.e. intermediate computation)

Red areas represent greater areas of subdivision (i.e. high computation).

Production companies prefer to have a mix of all three colours in their diagnostics; which is an indication that mental ray is efficiently choosing the areas of the geometry to subdivide and otherwise.


To fine-tune the BSP values, simply use a nice/simple texture or colour in "material override" toggle at a small resolution (i.e. 500x500 pixels).
The "material override" function has been covered in detail, in our latest book.

A nice/simple texture/colour enables users to quickly determine if the BSP tree is rendering efficiently the geometry, or not.
It is a very common mistake for users to associate slow renders with BSP tree; even though is mostly attributed to other common factors (i.e. soft shadows; reflective surfaces; poor usage of mr proxies; etc).


Also, open the mental ray messages dialog, to monitor the Max and Average leaf size(i.e. triangles).

The Max and Average leaf Size(i.e. triangles) are the main values to concentrate on when tweaking with the BSP values.


The following images will help demonstrate how to control the Max and Average leaf sizes of the BSP tree:

The total amount of rendering time for the image below was was 36 seconds, with the depth value set at 40.

Note the balance of colours displayed in the visual diagnostics.
As previously mentioned, this would have been the ideal scenario for some production companies.
The red areas are in fact the areas of greater detail in the 3Ds Max scene.
The current BSP values are enabling mental ray to balance efficiently between memory consumption and speed.












The total amount of rendering time for the image below was 42 seconds, with the depth value set at 56.

The average leaf size(i.e. triangles) has decreased significantly, which is great however, the leafnodes and the bsp size (kb) have increased substantially .

High depth values often equals slower pre-processing times, as mental ray will take longer to travel(i.e. casting/hitting rays onto the triangles)through the tree depth.
This also equates to "fatter" leafnodes and bsp size(kb).


As mentioned earlier, some production companies prefer to have a good balance (i.e. low numbers) between the average leaf size, leafnodes and bsp size(kb).
The reason behind it, is that, over a number of frames there will minor losses of memory during the rendering times, which will contribute to better overall rendering times.

The default BSP values(10/40) were much closer to this principle.










The total amount of rendering time for the image below was 35 seconds, with the depth value set at 36.
If one was to follow the production companies principles/ methodologies, then the current depth value would have been the best so far (i.e. depth=36).
The average leaf size (i.e. triangles) value is reduced, along with the leafnodes and the bsp size (kb).
It is worth noting that, although the average leaf size is not as low as 8(i.e. with previous depth value set at 56); it is now lower than 27; coupled with the leafnodes and the bsp size (kb) numbers decreased substantially.

The overall average is very satisfactory now.






Next, we are going to tweak with the BSP Size values

The total amount of rendering time for the image below was 36 seconds, with the size value set at 10




The total amount of rendering time for the image below was 35 seconds, with the size value set at 20





The total amount of rendering time for the image below was 35 seconds, with the size value set at 5




As previously mentioned, size values often have little significance in the total amount of rendering times.




I hope this gives some insight into the BSP parameters.



The Practicalities



More often than not the default BSP value of 10/40 works best, for small/medium scenes (i.e. less than a million triangles).

The general rules are: When running out of memory, reduce depth values, or switch to BSP2 ray tracing method.

When equipped with enough memory to spare, increase depth default values (i.e. 50+).



In the nutshell, less memory usage equals to increased total rendering times, and less render crashing possibilities.


To further help you with practical rules, the following principles have worked for me most of the times:

BSP Depth values for computers with 4GB of memory or higher:

Small scene: 33 or lower

Medium scene: 33 to 50

Large scene: BSP2 or 50/higher



BSP Depth values for computers with less than 4GB of memory(i.e. memory issues):

Small scene: 53 or higher

Medium scene: 33 to 48

Large scene: BSP2 or 33/lower


If using motion blur, instanced geometry and dynamic scenes, then BSP2 is recommended.


The mental ray “geometry caching” function sometimes discards any pre-cached geometry when one closes the 3Ds Max program.
Therefore, it is imperative to cache the geometry again every time the Max file is opened; especially when using the default BSP Depth values.
Check if the “geometry caching” function is greyed out.
Caching the geometry in fact has more significant impact in reducing the rendering times than increasing the default BSP Depth values.

As explained in the book, to cache the geometry, one requires only to first enable the "geometry caching" function; followed by rendering a draft image with/without the pre-saved FG map saved(in fact one can stop the render once the translation process is finished and the render kicks in).

There is only a hand full of specific scenes where changing the default BSP values as mentioned earlier will massively reduce the rendering times however, BSP values will help handle the geometry more efficiently.

From the outset, there is no way of pinpointing the scenes that will benefit most from certain BSP values, without having to go through the lengthy process of fine-tuning the parameters.




To significantly/massively improve the rendering times, one should focus mainly in the techniques highlighted in the our book:

1-Cache final gather map files

2-Cache the geometry

3- Reduce the number of lights casting soft shadows, if many in the scene (i.e. have few key lights casting shadows, and the remaining lights should only illuminate the scene without casting shadows). This technique will reduce the rendering times by half.

4-Reduce the global reflection/refractions parameters if there are too many reflective objects in the scene (i.e. max trace depth= 3; max reflections=1 or 2; max refractions=3). These values should be reduced with caution, as very small values of "depth" and "refractions" may cause artifacts(i.e. black blotches).

5- If using displacement maps, reduce the global max subdivisions from the default 16k to 1k or less. Note that values lower than 256 may not look very accurate, depending on its proximity to the camera.

6-Have the correct sampling quality (i.e. maximum samples per pixel value should not be higher than 16)

7-Enable the strip network render;if not rendering animations(i.e. sequenced frames).This subject is also covered in detail in our latest book.


8-Finally, if using proxies use it with BSP2 and ensure to have instanced copies as oppose to just copies in the scene.
Even you have too many different sets of vegetation and/or geometry. Attach all these different sets into one or two separate meshes first, and later convert them into proxies.

If all instanced proxies in 3Ds Max come from one mesh, mental ray uses memory only once to load the proxy.
If one has two different sets of instanced proxies from two different meshes, mental ray uses the memory twice; and so on and forth.

One should avoid having mental ray use memory more than 2 or 3 times, especially when working on a 4GB of Ram machine or less.
The ideal situation would be to have mental ray use memory to load the proxy once/or twice only.

Note: Finally, in very extreme and difficult cases of memory loss, one can additionally enable the "use fast rasterizer (rapid motion blur) function, from the "rendering algorithms" parameters.
This rendering method will bypass most mental ray memory issues.

It is worth noting that although very powerful, this rendering algorithm disables some of render elements. To override this, simply render the file output to an EXR file extension type, provided one has the material IDs/Object IDs,etc, originally enabled in 3Ds Max.

If facing difficulties extracting these EXR passes in Photoshop,After Effects,etc;simply switch your 3Ds Max back to standard mental ray rendering algorithm when computing your AO pass, and enable your rendered elements again; with cached FG at a very low res to render the final output in higher res.


After all the above tweaking the final image below (i.e.4000x3062 pixels)went from 28.09 minutes to 7.08 minutes.






For more information about tackling memory issues,please check my other posts in this blog:


mental ray_the usual suspects:Displacement and proxy errors



Increasing the paging file to override Memory issues



.I hope you have found this article somehow useful!



My 3D Portfolio:



More tips and Tricks:

Post-production techniques

Tips & tricks for architectural Visualisation: Part 1

Essential tips & tricks for VRay & mental ray

Photorealistic Rendering

Creating Customised IES lights

Realistic materials

Creating a velvet/suede material 

FoxRenderfarm

www.arroway-textures.com 

Renderpeople

Gobotree

3ds max: mental ray_Valuable Tips




Although we had covered numerous important tips & tricks in our latest book, there were still few tips that weren't mentioned, due to the final page count:

1-When network rendering, at times one may encounter missing bitmap errors whilst rendering. To correct this, simply check the "include maps" function, on the options group from the "network job assignment" dialog.However, it may slow the renders slightly.
The rule of thumb is to avoid having missing bitmaps or/and uvw maps in your Max scene.



2-When sending Max files to render over the network, ensure that the file/s are not over 90/150 MB in size, as the backburner may not be able to upload it to render.Professionals often use proxies to prevent files from reaching such sizes.Proxies are covered in detail in our latest book.

3-Backburner retains (saved) all Max files listed on the job queue, in case one may require retrieving them. These files are normally saved in:

C:\Documents and Settings\ ... \Local Settings\Application Data\backburner\ ServerJob

OR

C:\Program Files\Autodesk\Backburner\Network\ServerJob

4-When using the, "connect to manager" tool, one may be required to enable the "automatic search" function, in order to locate the backburner manager. Network rendering is also covered in detail in our latest book.

5-When rendering highly reflective surfaces, the shadows may not be very apparent (this is a natural phenomenon). To make the shadows more apparent, simply reduce the amount of reflectivity or/and reduce the fg/gi multiplier values, under the "indirect illumination" material group options. This Arch & Design function has been covered in detail in our latest book.



6-Often, imported Cad files and survey data are too far away from the point 0 in Max, which may subsequently cause problems creating splines, lights etc. To prevent this, users often move the drawings to point 0 in AutoCAD, prior to importing them into Max.
With survey data points, users first match everything from the original points in Max; once all details are confirmed and rectified (i.e. survey data, context models etc), everything is then moved to/closer to point 0, for lighting, materials etc. Verified views are also covered in detail in our latest book.

7-In Max 2010,after enabling the "read FG points only from existing map files", any new object/s created/added to the scene may still render ok,without the need to re compute the FG files again.
However, the light bounces of the new object/s may not be taken into consideration(i.e. colour bleeding,etc).
One should avoid such situations (i.e. re compute the FG solution if new objects/light had been added in the scene or/and objects have been moved) to avoid unexpected results.

8-One quick way to map the Max browser to your project folder is to click open on the "project folder" tool, on the main tool bar.
Once set, at your command, Max will begin browsing from the pre defined location, by default.



It is worth mentioning that whilst Max is setting the main browser location; it also creates automatically standard Max subfolders (i.e. Archives; autoback etc).




I hope you have found this post useful.

Ta

Jamie



My 3D Portfolio:



More tips and Tricks:

Post-production techniques

Tips & tricks for architectural Visualisation: Part 1

Essential tips & tricks for VRay & mental ray

Photorealistic Rendering

Creating Customised IES lights

Realistic materials

Creating a velvet/suede material 

FoxRenderfarm

www.arroway-textures.com 

Renderpeople

Gobotree

Autodesk: mental ray_Valuable Tips 2

Mental ray_Glass fritting effect


The glass fritting effect is commonly required by numerous clients in the 3D Visualisation sector:

The following exercise will show you an efficient way of emulating it.

First, load up the Arch & design(mi) and choose the Glass (Thin Geometry) template shader from the dropdown list as explained in our latest book.


Note that this particular shader template was chosen because we are emulating a typical office window glass pane (i.e. no refractions).If you wish to change its glass colour appearance, simply change it to greenish on its colour swatch in the refraction group.

The below renders came straight from Max Design 2010.









To apply the glass fritting effect, first choose the blend shader from the material/map browser list and select to keep old material as sub-material on the replace material dialog box.





Now we have the blend shader parameters with two shader slots: the original mr glass material on top and the second standard shader below.






Drag and drop the first top shader onto the second one, to turn both shaders to an Arch & Design (mi).

Choose the copy method from the instance (copy) material dialog box.
Note that the copy method was picked because this shader will be later changed.





Next, we are going to change the second shader’s parameters to a fritted type glass by first clicking on its toggle to enter its parameters.

Change its current name (retype) to fritting; and change its diffuse level color swatch to whitish to emulate the standard glass fritting colour.






Next, we are going to reduce the glass fritting transparency from 1.0 (fully transparent) to 0.95.

Note that, lower values will result in a less transparent surface (i.e. more opaque).

To blur what is seen behind the glass, we are going to decrease the glossiness from 1.0(no blur) to 0.7.

Note that lower glossiness values will result in greater blurriness(i.e increased render times).






Back on the blend main parameters, we are going to choose/create a mask material to establish where each of the two shaders will start and finish. Often a black and white bitmap works best!

Simply click on the mask toggle and pick the relevant material.





Disable the use real-world scale function.





Assign it to the relevant object/s in scene and use the uvw map modifier parameters to adjust it to your requirements.









To reduce reflections on the glass fritting, simply go to the relevant shader and reduce its reflectivity values in the reflection group. If necessary, also tweak with its BRDF parameters.

To blur its reflections, simply reduce its glossiness values in the reflection group. Moreover, one can also change its original fritting colour (i.e. white) to a much darker one, if required!

Finally, the above parameters are covered in detail in our latest book.










Quick overview of Matte/shadow/reflection shader and environment background switcher(mi)



To apply the matte/shadow/reflection shader, simply select it from the material browser list. And assign it to the relevant object.
The camera mapped background function is often used as an instanced material of the environment map toggle (i.e. bitmap, mr physical sky or the environment background switcher).It is worth mentioning that this toggle is designed to accommodate images in a colour range between 0-1(i.e. bitmaps etc) therefore, when using “mr pysical sky” as an instance map in this toggle, one should change the environment physical scale to "unitless"(i.e.90000.0), to compensate for it. Otherwise there will artifacts on the matte/shadow/reflection material.
These errors will be discussed later in this post.







The mask/opacity function allows one to add a black and white/greyscale map to its toggle.

The Bump function allows one to add a bump material to its toggle.

The Bump amount function controls the intensity of the bump display.

The Receive shadows function when on it allows shadows to be cast onto the matte surface

The Ambient /shadow intensity function controls the intensity of the AO appearance on the matte surface (i.e. 0= fully transparent).

The Ambient/shadow colour function controls the prominence of the direct shadows on the matte surface (i.e. white= fully blended; black= not blended/very dark)

The shadow casting lights list function when on it disregards the direct shadows of all other lights not listed on its name field. One can add, replace and delete lights accordingly.
The remaining parameters are self explanatory and very similar to those described in our latest book.




Environment background switcher (mi)


This is a very powerful shader for Photomontages etc however; one may encounter few artifacts when used with the matte/shadow/reflection shader.
To apply it, simply open the material browser by 1st clicking on the main shader toggle and choosing the mental ray shader. Next, choose the Environment background switcher (mi) from the list.











This shader also facilitates the usage of a background image in the environment map toggle whilst the exposure controls are being used but, the exposure physical scale has to be set to unitless In addition to setting its value really high(i.e. 90000.0 or higher).





The background function is often used in conjunction with the environment/background camera map (mi) for environment plates (i.e. mr physical sky,IBL,HDRI, bitmaps, etc)
The Multiplier is often used to increase/decrease the appearance of the image. Note that its appearance has no effect on the FG solution; unlike the environment probe/chrome ball (mi).
The Reverse gamma correction is often used in line with one’s default gamma settings (i.e. 2.2)










The Environment/reflections function is often used for spherical maps, if available. It is commonly used with environment probe/chrome ball (mi).




The environment probe/chrome ball (mi) works best with IBL(image base lighting);JPEG;BMP;TIFF;and HDR spherical images captured from a chrome ball;ETC. This shader uses this spherical map information accurately as a reflection map and as FG. The parameters are self explanatory.

Moreover,its FG functionalities are more visible when the skylight head of the Daylight system is disabled.
In addition, a separate skylight object needs to be created with the “use scene environment” function enabled.



Alternatively, if the user is interested in the reflections mainly, then the original “mr physical sky” map of the environment toggle could be used in conjunction with an image file.
Also, one can use the “use custom background“function from the “mr physical sky” map parameters, for background image display purposes only.

Mental ray provides users with multiple choices.

It’s also worth noting that with newly integrated “Color override/ray type Switcher” shader for Max 2011, one could plug this shader to the 'environment map' toggle, for any imaginable complex effect, especially when using IBL files. For more information about this shader, please take a look at my new article for CG Society.


The Multiplier is often used to increase/decrease the appearance of the image(i.e. 2.2 when used with gamma in Max)and its FG contribution. Note that inappropriate values may cause reflection artifacts and over bright FG solutions.
The Reverse gamma correction is often used in line with one’s default gamma settings (i.e. 2.2)






This shader is normally applied to the environment map toggle and instanced to the appropriate background toggles of other relevant materials in the scene (i.e. matte/shadow/reflection shader etc).

Also, one might require adjusting the daylight object's horizon height, as it might be obstructing the environment image.

Daylight object parameters are discussed in detail in our recent book.





Moreover, if there are no highlights on the environment image, some objects may not reflect glossy highlights.
To override this, simply disable the “visible area lights cause no highlights” function!









In our recent book, Roger and I have not mentioned either of the above shaders however; they are quite powerful.
Below are some of the errors one may encounter whilist using them in real projects:

The Matte/shadow/reflection: Works well with daylight system and exposure controls however, depending on one’s camera angle, the matte surface may render with artifacts.
This often happens when the mr physical sky is solely applied onto the camera mapped background toggle: this function essentially uses the colour of its toggle to multiply the contribution of all "illuminators" and "indirect light" intensity in the scene.
Since the "mr physical sky" has a colour with intensity of thousands, coupled with indirect illumination (FG) being set to 1.0, it would create some overly lit areas (i.e. artifacts).For more detailed information about this subject,please visit Master Zap's blog.




To correct some of these artifacts one would have had to open the object’s properties dialog box and uncheck the receive illumination from final gather function.



Another way to correct this arifact is to reduce the FG multiplier value to about 0.001.
Or change the environment physical scale to unitless (i.e. 900000.0) as previously suggested.
The last option is more practical in real projects than reducing the FG multiplier value.








In other cases if the ambient occlusion is not desired, one should also check the pass through (invisible to FG) function of the relevant object.










The daylight system object casts very dark shadows due to its default intensity. To bypass this, one should either decrease the daylight intensity multiplier or simply create a new mr area spot light, under the standard lights group. Place it in the same position as the daylight system and change it to directional light type (...to emulate the sun).





In the include /exclude dialog box, select the objects to be effected by the shadows only.
Whilst the mr area spot light is still selected, change its shadow density to about 0.25. Also ensure that the hotspot/Beam circle is big enough to cover all relevant areas of the scene.





Back on the matte/shadow/reflection parameters, add the relevant light/s onto the name field. This will automatically disregard the shadows cast by the daylight system or/and other lights in the scene.









In addition, when using the matte/shadow/reflection in conjunction with the environment background switcher (bitmap applied) and Daylight system/exposure controls; the matte/shadow/reflection surface will not be fully transparent, therefore not recognized by the alpha channel. Note that, this artifact only occurs when a bitmap is being used inside the background toggle of the environment background switcher with the daylight system/exposure.





To correct this artifact, simply enable the "process background and environment maps” function, under the exposure control parameters; in addition to having the environment physical scale enabled.




Although the "process background and environment maps” function helped to blend the matte/shadow/reflection material, the overall image had become washed out.




To correct this, simply enable the gamma correction.



Also,set the environment probe/chrome ball(mi)values to match the gamma corretion settings.



Everything should now blend seemingly.

If your workflow is non linear (i.e. not using gamma etc), then instead of using the gamma correction, simply correct the environment/background switcher (mi) image with the output mono curves.
Working with curves is covered in detail in our latest book.










On the example below, the mr physical sky shader was applied to both environment background switcher (mi) and the matte/shadow/reflection shader.





Note: For those not accustomed to using gamma corrections, it is prudent to set it up prior to initiating a project(i.e. same principle applied when setting up the “system units setup"); as it may become almost untenable to apply it half way through the project(i.e. one would require resetting the lights and materials of the entire scene).

I hope you have found this post useful.

Ta

Jamie




My 3D Portfolio:



More tips and Tricks:

Post-production techniques

Tips & tricks for architectural Visualisation: Part 1

Essential tips & tricks for VRay & mental ray

Photorealistic Rendering

Creating Customised IES lights

Realistic materials

.