userIbl shader from mr 3.10
Posted: 07 May 2012, 10:52
If you have a copy of maya 2013 you can copy the useribl.dll and use it in XSI 2013 with this spdl :
Quick n' dirty usage:
connect the user_ibl_env to an area light
Area light:
-turn on visible
-select shape as user
user_ibl_env:
-set samples (this is a literal value) I can get away with 4-8 using Unified Sampling and a basic daylight HDR, you may need more for a complex HDR
Now connect the user_ibl_env to the Environment slot of the camera. (you can still use the rayswitches and envblur with this shader.)
*important*
The samples (high AND low) of the area light must match the samples of the user_ibl_env shader or you may truncate the importance sampling. It's easiest to just connect the high and low samples to the user_ibl_env samples attribute so they stay the same.
**important**
You must use the "light relative scale" string option with a value of 0.318 (1/pi) to correctly light materials, this shader is designed for BSDF so old materials ( including mia ) will blow out some if this isn't set.
Additionally: When lighting with this, use a filter on your Final Gathering and greatly reduce the accuracy. Only secondary bounces are calculated by FG when using the user_ibl_env. You can get away with values that are low, in my case 32 rays provides plenty. works best with unified sampling.
-Avoid using specular effects with the user_ibl. Use reflection instead. This is the default in the mia_material. Avoid defeating that. A large visible area light (like the user_ibl_env) will cause noise in the specular channel that is hard to resolve. Specular is meant as a fake to show small light sources and sample the light. This is not the case with the user_ibl.
- Shadow mode transparent seams to not work in XSI ( it works in maya ) I guess the version of MR are slightly different and something must be broken
Code: Select all
# SPDL Generated by Softimage Shader Wizard
SPDL
Version = "2.0.0.0";
Reference = "{AB8CA092-F173-4A88-9036-81231C12D750}";
PropertySet "user_ibl_env_pset"
{
Parameter "out" output
{
GUID = "{C26CABC2-88D3-49B2-8F1D-7C0277338A4E}";
Type = color;
}
Parameter "texture" input
{
GUID = "{3E545EBC-929E-46CE-A1EB-99603CDF7CDC}";
type = texture;
texturable = on;
}
Parameter "samples" input
{
GUID = "{11F69BAE-4733-4291-8364-5A29BF6E618B}";
Type = integer;
Texturable = on;
}
Parameter "color" input
{
GUID = "{28824847-35A2-46A5-8F99-F12F369741F7}";
Type = color;
Texturable = on;
Value = 1.0 1.0 1.0 1.0;
}
Parameter "intensity" input
{
GUID = "{47AE5E07-9A56-4E8E-AC18-79C6A26E35EC}";
Type = scalar;
Texturable = on;
Value = 1.0;
}
Parameter "shadow_mode" input
{
GUID = "{C631B2E1-C2A5-4047-9A26-00BC5E9CABAC}";
Type = integer;
Texturable = on;
Value = 1;
Value minimum = 0;
Value Maximum = 2;
}
Parameter "rotate" input
{
GUID = "{FE4BEBF5-6807-4973-8AA0-9ECE7A48F6E6}";
Type = scalar;
Value = 0.0;
}
Parameter "as_reflection" input
{
GUID = "{2B459FD8-F007-41EF-9376-67F841E141E4}";
Type = boolean;
Value = off;
}
Parameter "primary" input
{
GUID = "{E681809A-5ABF-4C17-AD6D-7A346AEAE09E}";
Type = boolean;
Value = off;
}
}
MetaShader "user_ibl_env_meta"
{
Name = "user_ibl_env";
Type = light, light photon, environment;
Renderer "mental ray"
{
Name = "user_ibl_env";
FileName = "useribl";
Options
{
"version" = 3;
}
}
}
Defaults
{
texture
{
Name = "Image";
Description = "image color input";
Commands = "{F5C75F11-2F05-11d3-AA95-00AA0068D2C0}";
UIType = "ImageBrowserItem.ImageBrowserItem.1";
}
samples
{
Name = "Samples";
Commands = "{F5C75F11-2F05-11D3-AA95-00AA0068D2C0}";
}
color
{
Name = "Color";
UIType = "rgba";
Commands = "{F5C75F11-2F05-11D3-AA95-00AA0068D2C0}";
}
intensity
{
Name = "Intensity";
Commands = "{F5C75F11-2F05-11D3-AA95-00AA0068D2C0}";
}
shadow_mode
{
Name = "Shadow Mode";
Commands = "{F5C75F11-2F05-11D3-AA95-00AA0068D2C0}";
UItype = "combo";
items
{
"No Shadow" = 0,
"Opaque" = 1,
"Transparent" = 2,
}
}
as_reflection
{
Name = "Mirror Ball";
}
primary
{
Name = "Visible to Camera ( environment )";
}
}
Layout "Default"
{
texture;
samples;
color;
intensity;
shadow_mode;
rotate;
as_reflection;
primary;
}
Plugin = Shader
{
FileName = "useribl";
}
connect the user_ibl_env to an area light
Area light:
-turn on visible
-select shape as user
user_ibl_env:
-set samples (this is a literal value) I can get away with 4-8 using Unified Sampling and a basic daylight HDR, you may need more for a complex HDR
Now connect the user_ibl_env to the Environment slot of the camera. (you can still use the rayswitches and envblur with this shader.)
*important*
The samples (high AND low) of the area light must match the samples of the user_ibl_env shader or you may truncate the importance sampling. It's easiest to just connect the high and low samples to the user_ibl_env samples attribute so they stay the same.
**important**
You must use the "light relative scale" string option with a value of 0.318 (1/pi) to correctly light materials, this shader is designed for BSDF so old materials ( including mia ) will blow out some if this isn't set.
Additionally: When lighting with this, use a filter on your Final Gathering and greatly reduce the accuracy. Only secondary bounces are calculated by FG when using the user_ibl_env. You can get away with values that are low, in my case 32 rays provides plenty. works best with unified sampling.
-Avoid using specular effects with the user_ibl. Use reflection instead. This is the default in the mia_material. Avoid defeating that. A large visible area light (like the user_ibl_env) will cause noise in the specular channel that is hard to resolve. Specular is meant as a fake to show small light sources and sample the light. This is not the case with the user_ibl.
- Shadow mode transparent seams to not work in XSI ( it works in maya ) I guess the version of MR are slightly different and something must be broken