Adverti horiz upsell
Create your own HDR environment map in Maya/mental
Create your own HDR environment map in Maya/mental
Hirni, updated 2010-01-30 01:09:10 UTC 100,374 views  Rating:
(6 ratings)
Page 1 of 1


Requirements and Downloads

You  need the latlong_lens mental ray lens shader ( .

Example scene on how to use the shader, including the rendered HDR image (

In order to view and edit HDR images HDRShop comes in handy .


This tutorial shows how to create a HDR environment map for image based lighting  from a Maya scene. This is a software only approach so no equipment is needed. Additionally, the latlong_lens shader can also be used to create environment maps for games, panoramic views etc.

Camera and Render Settings

Shader Installation

Follow the install instructions of the latlong_lens shader and it should show up in the Hypershade:Create->mental ray Lenses tab.
This lens shader enables one to render out a full 360°/180° view of a scene in latitude/longitude format.


First, we need our own camera with a latlong_shader attached to it:

Goto Create->Cameras->Camera to create one (latlong_camera would be a good name).
Open the Attribute Editor of  that camera and add a latlong_lens node in Attribute Editor:latlong_camera-> mental ray->Lens Shader.
(The required shader is in the Create Render Node->mental ray->Lenses tab).

Because we want to use the output for image based lighting, we need to flip the output. We can do that in HDRShop or simply check Flip Horizontal
in the latlong_node. (The reason for this is because the image gets projected on a sphere that is viewed from the inside.) If you want to use the output for a panoramic view, leave this option unchecked.

Render Settings

In Order to get a HDR image, switch in the Render Global Settings to mental ray, set Common->Image Format to HDR(hdr) and Common->Camera to the latlong_camera. Latitude/longitude images usually have a width/height ratio of  2:1, so set Common->Resolution->Width/Height to something like 512/256 or 1024/512.
In the mental ray->Frame Buffer Attributes, switch Data Type to RGB (Float) 3x32bit to get the frame buffer attributes right.

Building a HDR Scene

This part is a bit tricky since we need to create a scene that represents the high dynamic range of the real world. Another problem is that lights will not show up directly since they are not rendered geometry.
But one can "model" light by creating geometry with a material on it that has a very high value of incandescence. Of course, the size of the modeled light sources has an impact on the overall intensity.

I wont describe how to build a scene in detail, simply create a floor, sky, objects and objects intended as lights.

For a primary light for example, create a rectangle and assign a lambert shader with a  Incandescence color of  (rgb 15,15,15) to it.
If you turn final gather on, this rectangle will also illuminate the scene. It is not necessary to use final gather/GI in a scene, only the shaders need to
be aware how they illuminate. If the scene is too dark, normal lights can be used light the scene as well..

If you already have a well lit finished scene, my little bit of try and error showed that it is sufficient to model the primary lights with simple geometry and assign high values of incandescence. Other light influences such as bright walls can be simulated by pulling up the Color attribute of the assigned shader to values like (rgb 2,2,2).

A good idea is to look up color values in real life HDR environment maps you can get from
Load them into HDRShop, move the mouse over the image and look for the color values of the current pixel  in the status bar.

To give you an idea of what kind of colors and intensity values are applicable, here is a small list as rgb colors I pulled from some HDR images:

Primary Lights

  • Window with direct sun : 130.0 125.0 126.0
  • Bright sky: 4.6 6.8 9.7
  • Indoor lamp : 6.4 4.1 2.4

Secondary Illumination

  • Bright wall: 1.5 1.5 1.3
  • Wood table: 0.54 0.34 0.25
  • Grass: 0.12 0.2 0.1
As you can see, secondary illuminations from ground, floor etc. are usually in the range of normally used colors.
An example scene ( is provided to show how it works.


Move the latlong_lens camera to the position your want to take the environment from. This should not be too close to objects in the scene, otherwise the perspective error is too high. The camera can be moved and rotated freely, but if you leave the rotation untouched, the rendered HDR image will be in the correct rotation if you use it in the Image Based Rendering option of Maya/mental ray.

To render the image, set a name in Render Global Settings:Common->File Name Prefix  and render it via Render-> Batch Render.
It is important to render in batch since the Render Preview  can not output .hdr images.

Here is what you get from the example scene at different exposures:

original exposure

-2.0 stops

-4.0 stops

-6.0 stops

Image based lighting

Now you can use the rendered HDR environment map as any other. Here are some test renderings with the map from the example scene using the Render Global Settings:mental ray->Image Based Lighting option.
Only the environment map illuminates the scene, the setting is PreviewFinalGather:





Ok, thats it. It is quite tricky to find the right shader values to get pleasing images, but a little fumbling around can probably get some nice results.

If you have comments, found errors or rendered some nice HDR environment maps you want to share, please do not hesitate to contact me.

Ralf Habel

This tutorial shows how to create a HDR environment map for image based lighting from a Maya scene. This is a software only approach so no equipment is needed. Additionally, the latlong_lens shader can also be used to create environment maps for games, panoramic views etc.



  • soooraj90

    soooraj90 said about 7 years ago:

    mast hai
  • benno verschueren

    benno verschueren said about 7 years ago:

    Hi! I tried the latlong_lense_shader, but if i render the example_file via the batch_render i just get a "normal" view of the rendering. I'm using maya2009/x64 Greets
  • Hirni

    Hirni said about 7 years ago:

    Alternatively to the latlong_lens shader, one can use the spherical map shader in this shader collection:
  • irwit

    irwit said about 7 years ago:

    Can someone post an example of how my maya.rayrc should look. The instructions aren't great as to how to get this shader working in maya. thanks Will.
  • plasticarm

    plasticarm said about 7 years ago:

    Another way you can make the spherical map is to use the Mental Ray transfer maps function. This makes it easier to remap one surface shape to another.
  • Pierzak

    Pierzak said almost 7 years ago:

    It didnt work for me with maya 2010
  • motinsf

    motinsf said about 6 years ago:

    Hello. How can I get longitude format=180°/180° instead of 360°/180°? Is there a MR lenz shader of it? Thanks.
  • Damien Mahoney

    Damien Mahoney said over 4 years ago:

    Thanks Ralf, This is awesome. So many uses. Having the source makes it usable.

Please sign up or sign in to post a comment.