Shopping Cart (0)

LatLong lens shader compiled for mental ray for Maya 2011+ on Mac OS X

Note: If you want an easy way to create stereoscopic latlong renderings you should check out the Domemaster3D shader. It has an easy to use installer and works with Maya/3DS Max/Softimage. It also has a set of Maya/Softimage shelf tools that make it a lot easier to add a latlong camera to your scenes.

I compiled the Lat Long lens mental ray lens shader for Maya 2011+ on Mac OS X to support Intel 32-bit and 64-bit processors. This shader is useful for rendering equirectangular projection images and 360°x 180° panoramas. If you render your scene to a floating point .EXR  high dynamic range image with the Lat Long lens shader, you can use the resulting image in a simple scene with the Maya IBL node as a source of final gather illumination and as the reflected environment map. Also included with the lens shader is a sample Maya scene.

Download the latlong_lens lens shader for Maya 2011 on Mac OS X. This shader also works with Maya 2012, 2013, and 2014.

I also compiled a version of the latlong_lens shader for Windows 64-bit. You can read more about the windows version here.

Ralf Habel created the original Lat Long lens shader.

Connect the LatLong lens shader node to the camera's node in the hypershade.

Connect the LatLong lens shader node to the camera’s node in the hypershade.

Lat Long Lens shader for Maya 2011 screenshot

Lat Long Lens shader for Maya 2011 screenshot

I created another Maya test scene with a textured cube in Maya 2012 and the latlong lens shader. Here is a link to the scene files

The test scene consists of which has checker mapped cube with a latlong lens shader camera in the center. You can used this scene to test rendering spherical panoramic images.

latlong lens shader

After I rendered the camera with the lens shader attached, I made a new scene and assigned the spherical file texture to a surface shader material on a new polygon sphere. The scene is called .

Viewing a spherical panoramic image mapped to a sphere in Maya 2012.

Viewing a spherical panoramic image mapped to a sphere in Maya 2012.

Viewing the Rendered Equirectangular Latlong Image

Viewing the Rendered Equirectangular Latlong Image

Fixing the Grey Blurry Line Lens Shader Artifact

Mental Ray Blurry Line Artifact

If you use lens shaders with Maya you will eventually come across an artifact that is known by Mental Ray lens shader users as “The Infamous Grey Blurry Line of Fisheye Lens Shaders”. The artifact is a texture filtering issue that is caused by an interaction between mental ray lens shaders and “classic” Maya texture nodes. There are several solutions to the artifact issue.

The best solution is to use a native mental ray based shading network like a mia material along with native mentalrayTexture nodes.

You can also hide the artifact in renderings that use “classic” Maya file texture nodes by changing the cameraShape node’s focal length to 500 mm. This seems to push the texture filtering issue out of the renderable view and fixes the artifact. Note: Since the lens shader will override the field of view used by the camera you will still get a rendering with the correct FOV view settings.

The lens shader artifact solutions are listed on these pages:

TheFulldomeBlog – the Infamous Grey Blurry Line
Domemaster3D Tips and Tricks Creating_domeAFL_Optimized_Surface_Materials
Domemaster3D Tips and Tricks Native Maya Surface Materials Blurry Streak Fix

The mental ray based Domemaster3D shader has a Maya shelf item that creates preset color, and color+bump based mia_material_x_passes shading network with the required mental ray node connections.

  1. Good work compiling this!

    Question: I recieve this error –
    call to undeclared function “latlong_lens”

    Probably user error. Thanks for any info.

  2. Hi Neil.

    If you can provide a few details about your version of Maya and Mac OS X I will try my best to get your problems worked out.


  3. Hi there, please, I don’t know more where to find. Can you make a tutorial or indicates me where to find how to compile a shader to Mac OS X x64?
    I really need the bumpCombiner_v2 compiled for mac, but I just found it for maya 2008 and it’s 32bits, and doesnt works with 2011. Can you compile it or give me a start? Thanks! =)

  4. The problem that nhagre experienced was from running Maya 2011 (64-bit) on Mac OS X 10.5 Leopard. When he upgraded to Mac OS X 10.6 Snow Leopard the issue went away.

  5. Hi.

    Usually I render to a resolution that is a 2:1 ratio because the equirectangular format is a 360×180 degree image (twice the horizontal resolution compared to the vertical resolution. A good starting resolution to use would be something like 2048×1024 or 5000×2500 for an immersive panorama.

  6. Does the LatLong lens shader work with Maya 2013 on a Mac? I tried to download it and the Mac Install instructions explain to put certain files in a path location that doesn’t exist.


    I cannot find the mentalray folder. Did they change everything for 2013?

  7. Hi Adam.

    On Maya 2013 on Mac OS X the latlong_lens.dylib file goes in the folder:


    And the latlong_lens.mi file goes in the include folder:


    Copy the icons to the Maya icons directory located at:


    Also, as a note you don’t need to edit the maya.rayrc file anymore as Maya will find all of the mental ray shaders if they are in the correct folders.

Comments are closed.