Cheers!
USERIBL_IBL_ENV and USERIBL_IBL_RECT
The user ibl shaders are attached to area lights as "user" type. (In Maya UI, this is labeled as Custom shape type.) This means that the shader controls the sampling rather than any specific shape. [Note that user (Custom) type of area light is required for user_ibl_env, but for user_ibl_rect, please use rectangle type.]
The user ibl env shader attaches to both the environment and to an area light placed anywhere in the scene. It doesn't matter, because its just going to use the texture as a spherical environment texture. Its a lat-long, typically people use a texture that is 2:1 resolution width to height. Width represents 360 degrees, height, 180.
The as_reflection input specifies whether the IBL image was shot as a reflection like a camera shooting a mirror ball, or if not, straight out into the environment, like a camera swiveling about the origin capturing the data. [Drawing a diagram, which I will do soon, should help. A ray that goes from your eye/camera straight out to the environment, is different than a ray that hits a mirror and reflects backwards. Often people take a shot of a mirror ball and convert it to a 2:1 lat-long, and this would need the as_reflection on.]
The samples setting controls the maximum number of samples used from the light. This is affected by an importance mechanism in two ways. One is that more important parts of the texture are used more often in the sampling. And the number of samples may be decreased, if the light path goes down in depth, for example, we are processing a material shader for a material hit after several reflections and refractions.
These are direct area lights, so typically you should specify as visible, if you want to see them. The visible user ibl env, creates your environment, and therefore is not used for FG (indirect) because it is now a direct light representing the environment. Ie, the number of samples it uses is called for every material in the scene. For high res, high dynamic range env images, this should perform much better for lighting than straight up FG. To get the same with basic FG would take thousands of FG rays.
For user ibl rect, just attach to an area light again, [edited later], but not as user, rather as rectangle type. In Maya for example, the UI for the area light should match the rectangle region that will display. This is typically used for large textured light cards, that may be taking the place of lots of rendered objects. For example rendering these objects into the texture you will use.
Check list for usage.
1. Samples. Ensure that the number of light samples on the actual light is greater than or equal to the number of samples in the user ibl shader.
2. Area Light Type Setting
a) User type area light shape. For user_ibl_env, ensure that the type of area light shape is user. In Maya UI, the dropdown under Use Light Shape says Custom which translates to User type. Also in Maya UI, make sure to turn on light visibility, before choosing Custom(user) type, as it is greying that choice out.
b) Rectangle type area light shape. For user_ibl_rect, ensure that the type of area light shape is rectangle.
3. Camera Environment. The same user_ibl_env used for the area light should be attached to the camera. It should be attached to the camera environment shader slot. In Maya UI, this is in the mental ray tab part of the camera AE UI.
4. Check your texture is attached and a file is specified.
5. Light scaling. If using traditional materials, rather than bsdfs, etc., use the string option "light relative scale" with a scalar value of 0.318, which is roughly 1/pi
--------------------------------------------------
The user ibl uses light importance sampling for the light using this light shader. And is intended to optimize area lights with high dynamic range and significant variation. The user ibl will sample the texture, and use the most important samples first. It has to do a bit of preprocessing for this to work effectively, but for any textured light this overhead is usually well worth it, as far as overall speed/quality tradeoff. Note the samples settings described in my post above. Those are the samples taken during rendering, not pre-processing.
Note however, that when we say multiple importance sampling, we mean importance from the light mixed with importance derived from the bsdf for a surface at a particular point being shaded. That is not what is done between the lights and the materials currently in this release (3.10). A given material shader could implement such a scheme, but it is best done when a bsdf is described for a given material.
Last edited by bart; May 9th, 2012 at 19:08.