Tutorial: Creating Photo-Realistic Renders with HDR using 3ds max & Mental Ray

April 23rd, 2008

3d photo real render of an Ambrato Wall Sconce - HDR 3ds max TutorialHDR photo real render of a copper pendant light made with 3d studio max - HDR TutorialHDR photo real render using 3d studio max of glass marble company logo - HDR Tutorial3d photo real render of an Agilis Wall Sconce - HDR 3ds max Tutorial

The technique I use to create photo real product image renders is called Image Based Lighting (IBL). There are no lights in the scene, all of the illumination is provided through the HDR texture map. The images above are some recent 3d models I have rendered using Image Based Lighting with an HDR map I created. I have this HDR image probe available for a free download as you go through the tutorial.

First thing you want to do is start with a fresh scene and merge in the object that you want to render. I’m going to use a wall sconce that I modeled recently. If you don’t have any 3d models off hand, just create a few spheres or a teapot and apply a shiny or glossy shader to them. Try to keep a realistic scale to them, for instance, give them a 3-6″ diameter. This goes for any model that you merge in -make sure it has a realistic scale. If you don’t already, everything you model should be to scale. It helps textures, lighting, and cameras play nice together -not to mention adding realism.

Photo realistic 3d render tutorial screenshot01

Next create a huge sphere around this object. Create panel | Geometry| Standard Primitives | Sphere

HDR 3d photo realistic render tutorial screenshot

Now you want turn the sphere inside-out so the polygons are facing inwards. This is called flipping the normals. Modify | Normal

If it appears that the sphere’s polygons haven’t flipped, it’s probably because your objects default to not backfacing culls. The fix is simple, just right click on the object and under ‘display properties’, check ‘backface cull’. If the ‘display properties’ section of the dialog is greyed out, click the ‘by layer’ box just to the left of the ‘display properties’ options.

HDR-3d-photo-realistic-render-tutorial-screenshot

Now we need to load up an HDR image to be used as the environment for the object we are rendering. This is going to be applied to the sphere that was just created around the merged or (or created) model. Open the material editor and load up a ‘mental ray’ shader from the Material/Map Browser. The ‘mental ray’ shader has a bunch of roll-outs: Surface, Shadow, Photon, Photon Volume, Bump, Displacement, etc. We are just concerned with ‘Surface’. Click the ‘Surface’ slot where it says ‘none’ and select ‘Bitmap’ from the Material/Map Browser.

HDR-3d-photo-realistic-render-tutorial-screenshotHDR-3d-photo-realistic-render-tutorial-screenshot

I just realized that you probably don’t have an HDR environment image off-hand. No worries, I have an HDR image probe that I created myself that you can download (I’ll post up a tutorial on creating the image probe in the future). I also have this in high-res, unfortunately my bandwidth won’t allow for that to be posted :(

HDR Image Probe Download

When you load up the HDR bitmap, be sure to tell 3ds max to handle it as a 32-bit file.

HDR Tutorial 3d photo real render screenshot HDR-3d-photo-realistic-render-tutorial-screenshot

Apply this environment material to the large environment sphere in your scene. Throw a UVW map on it and set the mapping to ‘Spherical’, and be sure that ‘Real-World Map Size’ is unchecked.

Before we start getting some visual feedback from the renderer, I’m going to mount my sconce to a wall. If your object would naturally sit on the ground in real life, then create a floor rather than the wall. Make it just big enough to fill up your camera view (oh yea, its time to create a camera view). Your viewport should look something like this:

HDR-3d-photo-realistic-render-tutorial-screenshot

Now apply a material to this floor or wall. I really like using Mental Ray’s Arch+Design materials. They behave very well with mental ray and offer tons of flexibilty based on real-world values. Whatever you use, make sure that it will emit and receive photons properly.

I am going to add a simple texture to my wall to give it a little realism. I did a quick search on google images for “wall finish” and turned up some nice results. Since the scene we are dealing with here is just a single close-up shot, this texture doesn’t need to be tile-able. Just grab a nice large, straight-on picture someone took of their wall. I usually filter the google image search results by ‘Extra Large Images’ and kick it down until I find what I need.

One thing I forgot to mention is to add a light to the scene, and turn it off.  If there are no lights in the scene, then 3ds max adds ambient lighting to your render which will make everything look plasticy.

Now lets do some damage. Fire up the render dialog (F10 is a shortcut). To set Mental Ray as the renderer, open up the Render Scene dialog and click the ‘Common’ tab. Scroll down to the ‘Assign Renderer’ roll-out and click the ‘…’ button.

Since we are just trying to get visual feedback, there are a few things we can do to whip out some real quick renders just to get a feel for whats going on without fumbling around for 8 hours. For these initial runs, I usually set my Samples per Pixel to ‘Minimum: 1/64 | Maximum: 1/4′. Its fast with just enough detail to know what you’re dealing with. (This is under the ‘Renderer’ tab under ‘Samples per Pixel’ roll-out). To speed things up some more I even set my output size to 300 x 300px (or whatever your aspect ratio is). Again, just enough to see whats going on. Now go to the Indirect Illumination tab and under the ‘Final Gather’ roll-out check ‘Enable Final Gather’ and set the Basic settings to the following: Initial FG Point Density: 0.1 | Rays per FG Point: 25 | Interpolate Over Num. FG Points: 15 | Diffuse Bounces:0 | Weight: 1.0. Remeber, these settings are only to whip out some quick and dirty renders for fast visual feedback.

One last step when dealing with HDR imagery; be sure to set the renderer’s frame buffer type to ‘32-bits per channel’ or Floating Point. This will enable us to output our renders as true 32-bit HDR files that can have their exposure adjusted in capable post-production apps like Photoshop or HDR Shop. Technically these 32-bit HDR renders could also be used as functioning HDR environmental textures.

HDR-3d-photo-realistic-render-tutorial-screenshot

Ok, so this is looking good on the first shot. Rendering time 0:00:03. -only a small bit of your life was used up there.

HDR-3d-render-tutorial-output-preview

If its not looking right, or you just want to explore your options, here are a few tweaking methods that I use:

1.) Tone-mapping. The stock tone-mapper that comes with 3ds max is Logarithmic Exposure Control. This is in the ‘Environment and Effects dialog box (Rendering | Environment…). If your gamma correction is not enabled, you will probably need to make this active to see anything. Gamma is an issue that I’m not going to get into here. I’ll save that little gem for later. A little side note; I can never get the ‘Render Preview’ in the ‘Exposure Control’ roll-out to show anything, does anyone have any insight on this? I like to use mia_exposure_simple for tone-mapping because it offers a bit more flexibility, but the Log exposure should work fine for you.

2.) Output energy of the HDR texture. (Bitmap parameters | Output roll-out | Output Amount). This will basically adjust how bright your environment is. Default is 1.0, so adjusting it above or below 1.0 change how the HDR map behaves.

Output energy of the HDR texture: .25Output energy of the HDR texture: 2.5

The first render has an output amount in the HDR bitmap of .25. The second render has it set at 2.5. No exposure control was adjusted.

3.) Rotate the environment. Simple as that- rotating the sphere or UVW map will reposition the bright parts of the image affecting the brightness, shadows, and highlights of your model.

HDR environment map original placementHDR map rotated 45 Degrees

Both of these renders have the same output amount in the HDR bitmap. The only thing that changed was that the environment was rotated around.

To get the final result of the images at the top of the tutorial, I used a combination of the tweaking methods I described above. I set the output of the HDR texture to 0.32 and bumped up the brightness on my tone-mapper (mia_exposure_simple). Doing this brought out more lumination from the alabaster material than the light from the HDR map allowed. I also used photon global illumination to add a bit more glow.

Good luck rendering! I’d love to see some of the results created from anyone who used this tutorial, please send them! As always, feel free to ask any questions as well.

If you are an architectural visualization designer and would like to download these sconce models to use in your project, I have them up for sale on Turbo Squid

Tutorials | Comments | Trackback

20 Responses to “Tutorial: Creating Photo-Realistic Renders with HDR using 3ds max & Mental Ray”

  1. 1Dusan Maljkovic
    May 15th, 2008 @ 3:48 am

    Hi there mate. i have a question i would like to ask you.. i am learning 3ds max but i cant get it right with some things. i want to create realistic sandy ground or grassy ground, all the same , but i cant really make it. i saw your work and i think that you could be the one who could show me how? maybe you have some good tutorial or something? if you have some spare time for me pls email me on dusanmaljkovic@hotmail.com. Thank you!

  2. 2admin
    May 15th, 2008 @ 9:53 am

    Hi Dusan,

    Well, for the grass I have heard that using the Hair and Fur system in 3ds max works well for grass.

    (Modify panel > Make a selection. > Modifier List > World-Space Modifiers > Hair And Fur )

    -I have never tried it though so I can’t be much help after that.

    Jeff Patton has a good tutorial with grass using displacement:

    The sand is another one I have never tried and can’t really think of anything off the top of my head that would produce realistic results… Let me know if you find anything though, I’m curious about it now. However, I can tell you that whatever method you use for both of these, be sure to use the IBL setup I show in the tutorial, because you will be able to concentrate on the textures of your grass and sand without having to worry if the lights / environment are setup correctly.

  3. 33ds max tutorials
    May 29th, 2008 @ 5:49 pm

    [...] maxIf you have a copy of 3ds max, this tutorial will get you rendering photo-real images in no time.http://www.redcultur.com/silkypixel/2008/04/23/tutorial-creating-photo-realistic-renders-with-hdr-us…3ds Max Tutorials, Maya Tutorials, Lightwave 3D Tutorials, Cinema …3ds max Tutorials, Maya [...]

  4. 4BEEF
    July 12th, 2008 @ 12:59 am

    how do you get mental ray in 3DS max????

  5. 5admin
    July 16th, 2008 @ 4:50 pm

    In the ‘render scene’ dialog, go to the Common tab. At the very bottom there is a rollout that says ‘Assign Renderer’.

    Expand that, click the ‘…’ and select ‘mental ray Renderer’.

  6. 6SAYI PRADEEP
    August 8th, 2008 @ 9:13 am

    I completed the 3d max…am searching job in 3d field…i want to know how to give all the lighting effects with which buton we need to use…by short cut…

  7. 7Rich
    August 10th, 2008 @ 9:05 am

    i put the light into the scane, and turned it off, but my viewport is black, the image renders using the log esttings but not with GI or caustics? how can i fix that?

  8. 8Arie
    August 12th, 2008 @ 9:05 am

    Hi, i’m arie, a vocational high school’s student that interest to create photo realistic picture with 3ds max. I’m interested after saw your blue glass ball picture at you website, so i learn mental ray further more to create material than assign to sphere object but i still can’t, please merry to me to tell me how create material like blue glass with bitmap in it’s surface. Please email me to arie_180691@yahoo.co.uk

  9. 9admin
    August 12th, 2008 @ 1:38 pm

    @SAYI PRADEEP: Yea… well, to edit all your lights from one spot go to, ‘Tools | Light Lister…’ from the top menu. I don’t know the shortcut for that. To edit the scene lighting go to, ‘Rendering | Render…’ from the top menu. The shortcut is F10.

    @Rich: Do you have Final Gather turned on?

    @Arie: Exactly what are you having trouble with?

  10. 10steve h
    August 13th, 2008 @ 3:30 pm

    hi there!! thanks very much for this excellent tutorial..I have been having a bit of trouble with the “plastic-y” look in mental ray and couldn’t find how to hdri..thanks again
    ps i’m about to try getting some 3d vis work but not too sure if i’m good enough!!Any idea where I could send images for a decent opinion?! Or if you could,please mail me ;) captaincreativity@yahoo.co.uk

  11. 11Arie
    August 17th, 2008 @ 10:39 pm

    exactly i just want to know, how to create material for this blue glass marble, are that need some light ? omni, vray, or else.
    What renderer that you use ? mental ray, vray, default renderer or else. Thanks very much before.., hope you understand

  12. 12admin
    August 19th, 2008 @ 9:05 am

    The material for the marble is an Arch & Design material and was rendered with Mental Ray. I started with the Arch & Design ‘glass’ preset and tweaked it from there.

    The lighting comes from an HDR map applied to a sphere that is wrapped around the marble and ground geometry(see tutorial). -be sure to have Final Gather turned on or the HDR map won’t illuminate the scene.

    The secret to the material is in the ‘Advanced Rendering Options’. The color of the marble will be determined under ‘Refraction | Color at Max Distance’. Make it the same color as ‘Refraction |Color’ under the Main material properties.

    Also, to make the Arch & Design glass material look more like the ‘Glass (physics_phen)’ material, be sure to uncheck ‘Skip reflections on the inside…’ under ‘Advanced Reflectivity Options’. Glass (physics_phen) is a great material, but I like the flexibility that the Arch & Design mats give. -like easily adding a bump map…

    …which is how I made the imprint on the marble; just throw a black & white bitmap of a logo or text in the Bump slot. I have that set to 0.1 for a subtle look. Also, be sure to blur the bitmap a bit, because having hard lines will make the glass start throwing off artifacts.

    I can do a short tutorial on this in the future.

  13. 13DaveG
    January 15th, 2009 @ 8:50 pm

    Hi Andrew,

    Thanks for your great tut + the complimentary light probe. I have used these in my scene and produced some really good results due to your help. My one question concerns the sphere that we map “porch.hdr” to: is there any way that I can render the image (using the .hdr image) but *not* render the sphere itself? In other words I want to use the lighting info but not actually see the .hdr image itself. I would rather have a different background behind my objects (or even just a constant colour) but I don’t know how to do this.

    For example in your tut you render the image at a 3/4 view which shows the light + the plane (wall) behind it. Say you wanted to render a side view in which you look along the wall at the light - I’m guessing you would see the sphere and the image mapped onto it in the background. How would you avoid this? create additional geometry (a perpendicular wall) or can you somehow turn the rendering of the sphere off?

    TIA for any input.

    Regards,

    ->dg

  14. 14admin
    January 18th, 2009 @ 2:09 pm

    Dave,

    One way is to do what you described; create additional geometry to hide the HDR environment sphere. However, I’d rather avoid this because with every wall created you’re blocking those wonderful HDR reflections.

    So the way I get rid of the HDR sphere showing in the background is in post.

    You’ll need to render two images: One you should already have -with the HDR sphere in the background. The next one is going to be used to create an alpha channel in your favorite post prog (Photoshop, Combustion, etc).

    To create this alpha render, hide the HDR sphere so the only thing being rendered is your object. You can turn off raytracing for this so it renders super fast. The only thing you want from this is to define the edges of your object -nothing fancy.

    After it’s rendered (you may only see a black image), save it as a targa (.tga) as this format holds an alpha channel. (I forget if it asks if you want to save it as 16-bit or 32-bit, but you want to save it as a 32-bit image.) If you want to see this alpha channel in the 3ds max render window, click the black/white icon on the top of this window (near the red, blue, green channel icons).

    Ok so now you should have two files: rendered object.tif (.bmp, .jpg, etc) and alpha.tga. Open them both in Photoshop. On your alpha.tga image, select the ‘channels’ panel (next to ‘layers’). There should be a channel after red, green, blue, called ‘alpha’. You want to load up this selection, so hold the ‘ctrl’ button and click the alpha channel.

    Now get your rendered object.tif up on your screen. That and the alpha image should be side by side. Put your cursor over the selected alpha image (dont click yet!). Hit ‘M’ to get into selection mode. Hold ’shift’.

    Now click the alpha selection and drag it over the rendered object.tif while still holding shift. This is going to bring the object’s edges from the .tga and snap them perfectly onto the .tif.

    So the objects edges should now be selected around the object on your .tif image with the HDR sphere showing in the background. To knock-out this background, hit the ‘add layer mask’ button at the bottom of the layers panel. Your object should be sitting on top of the transparency grid.

    Now just drop in a background image behind the object layer and viola! This background image will vary greatly depending on what you’re trying to accomplish with your scene.

  15. 15Nick
    January 19th, 2009 @ 2:09 pm

    Nice tutorial. I am having one problem… when I assign the HDR image to the surface map in the mental ray shader, it does not allow me to assign it to the photon map area as your screenshot shows. “Bitmap” is not an option. As a result, I get no photons generated, and no image. Any idea what’s up with that? 3DS Max 2009.

  16. 16Hamsterizer
    February 20th, 2009 @ 11:51 am

    Great tutorial! I’ve got some great results following it.

    One question - how can I easily control the brightness of the individual textures - for example in your picture if I just wanted to increase the brightness of the metal holder, but leave everything else unchanged? Would this be the reflection setting?

  17. 17Andreas
    March 31st, 2009 @ 10:56 am

    Very nice tutorial. You should get an award for this. I just want to get a photorealistic image and always wonder, why I can’t get it like yours. Hopefully Surface shader is the reason, why it doesn’t work out for me. Best wishes

  18. 18raymund
    April 2nd, 2009 @ 9:18 pm

    Good day. i followed carefully your instructions in setting up the scene. I checked back and forth not to miss any of the settings you mentioned in your tutorial. How come my render results are still “plasticy” and the perspective viewport is all black. Well I understand that by turning off the light will really blackout the scene. But how come in your samples here they don’t? and how did you make your light spread on the wall like that if you’re saying that the only thing that lights up the scene is an HDRI map and final gather? Again, i followed carefully your settings but everything seems to not coming out as you were describing. Could please help me out here? I’m sorry if i sound firm, but i’ve been through a lot of tutorials saying that they are gonna give out a “photo-realistic” results, but in the end, after following their tutorial, we, the ones trying to learn, doesn’t achieve results like the ones who teach them. Thank you for your patience and support.

  19. 19admin
    April 2nd, 2009 @ 11:47 pm

    raymund:

    No need to be sorry, lately I’ve been trying to learn WPF/C# programming and get so frustrated when the tutorials don’t seem to work.

    Regarding the plasticy look, do you have a regular point light (or similar) in your scene but turned off? For whatever reason if there are no lights in the scene (on or off) Max will put a weird ambient light on everything. That’s the only thing I can think of without seeing your image.

    Yes, the spill coming out of the sconces is a point light. When I said that there are no lights lighting the scene, I meant there are no lights illuminating the walls and sconce itself -its all coming from the radiance of the HDR image via Final Gather. If I got rid of the HDR sphere, you would only see the light spill and nothing else.

    Send me your .max scene and I’ll take a look at it. I’ll let you know what’s going on. My email is ioncultur * gmail.com

  20. 20admin
    April 2nd, 2009 @ 11:58 pm

    Hamsterizer:

    For making metallic objects brighter, I usually bump up the BRDF value to 0.9. (this is only relevant if you’re using Mental Ray ‘Arch&Design’ materials)

    Another thing to do is adjusting the output value in the ‘output’ rollout for whatever shader is in the diffuse slot.

    If it is just a single color and not a bitmap, use a Noise shader and just set both colors the same. So you wont get the noise effect, however, you will get an output rollout at the bottom that you can bump up past 1.0.

Leave a Reply

  1.  
  2.  
  3.  
  4. XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
You can keep track of new comments to this post with the comments feed.

Categories

Misc.

FireStats icon Powered by FireStats