Shaders: DomeAFL

Dome Angular Fisheye Lens (AFL) Shaders for mental ray for Maya

Daniel F. Ott (Digital Production Arts, M.F.A.), email: dott[at]thedott[dot]net
Clemson University

Special Thanks

Dr. Timothy Davis (who was my thesis advisor)
Matthew C. (for providing hints for texturing and the Mac OSX binaries for Maya 6.5)
Michael M. (for providing the Windows binaries for Maya 6.5)
Josh M. and Justing R. (for bring a minor bug to my attention)
Chris S (for compiling a Windows 64-bit Version)
Tery Harrell (for compiling a OSX 10.6 Intel Version)


Please help support the domeAFL shader coummunity! If you've been able to compile this shader for your version of Maya and platform, please email me the binaries so that I can post them for others to use. Thanks!


2009.09.09 - The Intel Mac 10.6 binaries have been uploaded (see Downloads). (Thanks to Tery Harrell for providing this!)

2006.10.18 - The Maya 6.5 Windows binaries have been uploaded (see Downloads). (Thanks to Michael Marner for providing this!)

2005.08.19 - If you are encountering texturing problems with Maya, make sure the filter map is set to "Mipmap" or "off" for these textures. Another work around is creating the texture using mental ray shader nodes. (Thanks to Matthew Catt for solving this!)

The Shaders

To help artists create dome animations with Maya, I'm releasing two mental ray lens shaders: domeAFL_FOV and domeAFL_WxH (download). These shaders are part of my thesis work for a Master's degree in Digital Production Arts at Clemson University. If you use these shaders, I would love to have stills that I could post here on the website for others to see. 

Figure 1 - Sample Rendering

Figure 1 - A Sample Rendering

Both shaders use the Angular Fisheye Projection and Offaxis Fisheye Projection methods that are described by Paul Bourke to produce the fisheye images. Figure 1 shows a sample rendering of a multi-colored cube. The domeAFL_FOV shader is used when the artist wants to generate the fisheye images by specifying the field-of-view. If the intended dome is of odd dimensions, the domeAFL_WxH shader can be used to calculate the field-of-view from the dome's diameter and height. Figure 2 shows the node interfaces of the shaders in Maya.

domeAFL_FOV User Interface  domeAFL_WxH User Interface

Figure 2 - The node interfaces for the shaders in Maya

In the domeAFL_FOV shader, the FOV_Angle parameter controls the field-of-view, which can be from 0 to 360 degrees.

In the domeAFL_WxH shader, the Diameter and Height parameters control the field-of-view. Chord length calculations are used to determine the dome's field-of-view (see domeAFL_WxH.c). A 2:1 diameter-to-height ratio will produce a 180 degree field-of-view. It is important to note that the Diameter and Height parameters are dimensionless.

In both shaders, the View_Offset parameter is used to change the ideal viewing position, which is at the center of the image by default. The top-right corner of the image has the view offset coordinate of [1,1]. Finally, the Flip_Ray_X (i.e. flip the ray's x component about the y-axis) and Flip_Ray_Y (i.e. flip the ray's y component about the x-axis) are used to change the output orientation, i.e. horizontally and vertically (respectively).


To install the shaders:

  1. compile the sourcecode on the target platform
  2. add the link and mi entries to the maya.rayrc file that point to the shader's library file and declaration file, respectively.
  3. copy the shaders' render_*.xpm icons to the user's /maya/6.0/prefs/icons/ directory
  4. set the MI_CUSTOM_SHADER_PATH environment variable to point to the declaration file OR use the Maya's mental ray Shader Manager to load the declaration file in Maya.


All software is provided free of charge, and as such this site and its auther is not responsible for any damages or lost of time that results from use of this software.

Compiled Binaries:
  64-bit DLL
OSX 10.6 Intel*
  Maya 6.5
  Maya 6.0

* This version has been compiled by a third-party.

Change Log

08.23.2004 - BUG FIX - Resolved a divide by zero and mathematical error. (Special thanks to Josh Minges Justin Rosen for bring this to my attention.)