Page 1 of 6

userIbl shader from mr 3.10

Posted: 07 May 2012, 10:52
by Saturn
If you have a copy of maya 2013 you can copy the useribl.dll and use it in XSI 2013 with this spdl :

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";
}
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

Re: userIbl shader from mr 3.10

Posted: 07 May 2012, 11:53
by Maximus
You made my day.
Works perfect, finally some decent IBL solution! I'm loving this, gonna post some images in few!
Big Thank you!

:-bd

p.s. now that i think of, i dont wanna be harsh but...this was pretty quick to spot and implement..How hard it could have been for Autodesk to implement just a damn .dll and a spdl. Oh man..

Re: userIbl shader from mr 3.10

Posted: 07 May 2012, 16:05
by Maximus
quick render with this ibl.

Image

really great shader!

Re: userIbl shader from mr 3.10

Posted: 07 May 2012, 16:38
by Saturn
where the light is coming from ? throught the windows ?

Re: userIbl shader from mr 3.10

Posted: 07 May 2012, 16:42
by Saturn
Maximus wrote: p.s. now that i think of, i dont wanna be harsh but...this was pretty quick to spot and implement..How hard it could have been for Autodesk to implement just a damn .dll and a spdl. Oh man..
Yes it was ! I am not even sure that XSI's team where actually aware of this functionality.

Re: userIbl shader from mr 3.10

Posted: 07 May 2012, 17:45
by Maximus
there are 3 windows, 2 on the right and one on the left, i used the kitchen.hdr common hdri. and used the user_ibl_env on the 3 lights.
Final gather with low rays and 1 bounce

Re: userIbl shader from mr 3.10

Posted: 07 May 2012, 18:06
by gfxman
what is the difference between this shader, and a normal environment shader ?

Re: userIbl shader from mr 3.10

Posted: 07 May 2012, 18:52
by Saturn
the main difference is that it use an another mecanism than Final gathering to resolve the lighting coming from a HDRI.
It use a more modern technique based on importance sampling.

With this technique you can resolve much accurate shadow than FG while getting away with a lot less sample. ( faster render )

This functionnality is avaible since mr 3.7 but autodesk never dared to add it in XSI.

Re: userIbl shader from mr 3.10

Posted: 07 May 2012, 18:54
by gfxman
Thx, it's a mistery is not integrated in softimage 2013 :D
I can use it with sibilgui....

Re: userIbl shader from mr 3.10

Posted: 07 May 2012, 18:56
by Saturn
gfxman wrote:Thx, it's a mistery is not integrated in softimage 2013 :D
I can use it with sibilgui....
you don't need siblgui anymore ! Just plug your map and your are done !

Re: userIbl shader from mr 3.10

Posted: 07 May 2012, 21:35
by mattmos
Nice work!

Can you get the dll by installing maya 2013 in trial mode?

And does the shader give consistent results for animated scenes?

Cheers!

Re: userIbl shader from mr 3.10

Posted: 07 May 2012, 22:09
by Maximus
mattmos wrote:Nice work!

Can you get the dll by installing maya 2013 in trial mode?

And does the shader give consistent results for animated scenes?

Cheers!
Yes its what i did, downloaded trial, installed, copied .dll > uninstall

Regarding animation i dont know cause i dont animate that much but being bruteforce importance sampling i guess you wouldnt have that much problems, might wait for someone who tested it further. So far i'm havin really great results with no blotches on GI wich is a dream coming true.

Re: userIbl shader from mr 3.10

Posted: 07 May 2012, 23:38
by Saturn
it is fine for animation. Worse case scenario you will have noise/grain if you undersample it.
To be use with unified sampling.

Re: userIbl shader from mr 3.10

Posted: 08 May 2012, 10:04
by Hirazi Blue
Slightly OT:
So now I am wondering if the new mr 3.10 Ptex stuff could be "unlocked"
as "easily" as this as well (using Maya/Max dlls, I mean) or not...
:-\

Re: userIbl shader from mr 3.10

Posted: 08 May 2012, 14:00
by Mathaeus
Hirazi Blue wrote:Slightly OT:
So now I am wondering if the new mr 3.10 Ptex stuff could be "unlocked"
as "easily" as this as well (using Maya/Max dlls, I mean) or not...
:-\
afaik, 3d app should support it too, it's not only about renderer. Only Maya has 'native' support, for now. In Max, 3rd party image loaders, or small utility plugins, are usual. Once they are installed together with 3rd party renderer or something like, it's possible to use them for other purposes - including potential conflicts. That is, Vray for Max, most likely, installs additional piece of code, just to enable pTex.

Didn't sow anything like that for SI, yet.

Re: userIbl shader from mr 3.10

Posted: 08 May 2012, 15:44
by ActionArt
Very interesting. It's just so infuriating that something that literally take minutes to implement hasn't been part of SI for years since it's release. Hopefully the new team takes note and does something about this.

Is there anywhere to get the dll without messing around with the Maya trial?