userIbl shader from mr 3.10

Discussions about rendering in SOFTIMAGE©
Saturn
Posts: 38
Joined: 11 Apr 2011, 12:27

Re: userIbl shader from mr 3.10

Post by Saturn » 08 May 2012, 21:32

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...
:-\
Doing the spdl and copy the dll across have been done. But for some reason I could see the node once installed.
Something is probably missing somewhere.
but I could copy the spdl over here and let someone else to dig it. I don't have much time to figure out what is wrong.

Code: Select all

# SPDL Generated by Softimage Shader Wizard
SPDL
Version = "2.0.0.0";
Reference = "{6B72FF8A-333D-43D3-995A-0A43C2A2CF86}";
PropertySet "mib_ptex_lookup_pset"
{
	Parameter "out" output
	{
		GUID = "{CECA2270-177A-4032-A932-9C06E2E6250E}";
		Type = color;
	}
	Parameter "filename" input
	{
		GUID = "{0EF48CFE-8E59-429D-A27A-32CDEB461F15}";
		Type = string;
		Value = "";
	}
	Parameter "width" input
	{
		GUID = "{02C6DEB0-F4C2-46C9-967E-596D70D7AD62}";
		Type = scalar;
		Value = 1.0;
	}
	Parameter "blur" input
	{
		GUID = "{C6505413-F73F-4DAE-B427-8C0ECFB3D5B0}";
		Type = scalar;
		Value = 0.0;
	}
	Parameter "filtertype" input
	{
		GUID = "{7918BDD2-4C72-438A-9852-48210F80DDF5}";
		Type = integer;
		Value = 4;
		Value Maximum = 7;
	}
	Parameter "interpolate_level" input
	{
		GUID = "{56AB051F-E3C9-45C6-91A2-437877EED09B}";
		Type = boolean;
		Value = off;
	}
	Parameter "filter_sharpness" input
	{
		GUID = "{8D2A032E-2FF0-4825-9825-93D47B7ECBF0}";
		Type = scalar;
		Value = 1.0;
	}
}

MetaShader "mib_ptex_lookup_meta"
{
	Name = "My New Shader";
	Type = texture;
	Renderer "mental ray"
	{
		Name = "mib_ptex_lookup";
		FileName = "ptex";
		Options
		{
			"version" = 1;
		}
	}
}

Defaults
{
	filename
	{
		Name = "filename";
	}
	width
	{
		Name = "width";
	}
	blur
	{
		Name = "blur";
	}
	filtertype
	{
		Name = "filtertype";
	}
	interpolate_level
	{
		Name = "interpolate_level";
	}
	filter_sharpness
	{
		Name = "filter_sharpness";
	}
}

Layout "Default"
{
	filename;
	width;
	blur;
	filtertype;
	interpolate_level;
	filter_sharpness;
}

Plugin = Shader
{
	FileName = "ptex";
}

User avatar
Hirazi Blue
Administrator
Posts: 4918
Joined: 04 Jun 2009, 12:15

Re: userIbl shader from mr 3.10

Post by Hirazi Blue » 08 May 2012, 22:43

@Mathaeus & @Saturn
Thanks, I already was afraid it would turn out more complicated than just the dll-switch.
Would obviously still be very interested in hearing from anyone
who is able to get this to work somehow...
:(
...

User avatar
Mathaeus
Posts: 1731
Joined: 08 Jun 2009, 21:11
Location: Zagreb, Croatia

Re: userIbl shader from mr 3.10

Post by Mathaeus » 09 May 2012, 00:57

Hirazi Blue wrote:@Mathaeus & @Saturn
Thanks, I already was afraid it would turn out more complicated than just the dll-switch.
Would obviously still be very interested in hearing from anyone
who is able to get this to work somehow...
:(
from my understanding, requirements are :
1: 'per face' UV mapping
2: 'per face' assignment of texture that match the order in ptex file, because each piece spreads from 0 to 1 of UV space
3: image loader

theoretically, 3 has some chance, maybe it's possible to type the path manually, SI won't display texture of unknown format, but there is a chance MR will 'understand'

for 1 and especially 2, I have no idea.
The renderer "turtle" used by this scene, is not currently available. The "turtle" renderer will be used instead.

User avatar
Maximus
Posts: 992
Joined: 09 Jun 2009, 15:45

Re: userIbl shader from mr 3.10

Post by Maximus » 09 May 2012, 01:56

I didnt manage to get this shader working, it seems mostly some error in the shader declaration, Softimage gives me error that couldnt find shader library, have no idea how to fix this.
Reading on the forums i saw that even in maya is kinda tricky to activate, you have to play with the system environment variables.

User avatar
Daniel Brassard
Posts: 830
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario

Re: userIbl shader from mr 3.10

Post by Daniel Brassard » 10 May 2012, 04:02

I've been trying to download the Maya trial all night, the AD downloader is just messed up.

I got that same message, but I don't have the shader mib_ptex_lookup. If I could get the dll shader, I'd be able to test it, the spdl and mi file is ready for testing!

Anybody compiled the newest PTEX API for 32 bit Window?
$ifndef "Softimage"
set "Softimage" "true"
$endif

User avatar
Maximus
Posts: 992
Joined: 09 Jun 2009, 15:45

Re: userIbl shader from mr 3.10

Post by Maximus » 10 May 2012, 04:12

those are the 2 dlls for ptex and useribl.

x64bit only, i dont have 32bit.
You do not have the required permissions to view the files attached to this post.

User avatar
Daniel Brassard
Posts: 830
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario

Re: userIbl shader from mr 3.10

Post by Daniel Brassard » 10 May 2012, 04:14

Thanks Maximus, I'll try my end see what comes up and let you know.
$ifndef "Softimage"
set "Softimage" "true"
$endif

User avatar
Daniel Brassard
Posts: 830
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario

Re: userIbl shader from mr 3.10

Post by Daniel Brassard » 10 May 2012, 06:40

Maximus,

How do you determine that PTEX is working. I installed the ptex.dll, ptex.mi and mib_ptex_lookup.spdl using the plugin manager. Then tested the scene with the bunny test from the PTEX website and got no errors. Does it mean I have it working.

See attached result!
You do not have the required permissions to view the files attached to this post.
Last edited by Daniel Brassard on 10 May 2012, 14:12, edited 1 time in total.
$ifndef "Softimage"
set "Softimage" "true"
$endif

Saturn
Posts: 38
Joined: 11 Apr 2011, 12:27

Re: userIbl shader from mr 3.10

Post by Saturn » 10 May 2012, 10:08

I can't see any texture on your bunny.
So I guess it doesn't work

User avatar
Daniel Brassard
Posts: 830
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario

Re: userIbl shader from mr 3.10

Post by Daniel Brassard » 10 May 2012, 14:09

The next step is to turn on ccmesh_ptex in mental ray for Softimage.

This is how the Maya people do it:
Since AD hasn't integrated this process, I thought I would give you all a heads up on how to use PTex textures in Maya 2013:

Set PTex registry value for mental ray for Maya:

Create/edit file maya.rayrc in the user Maya directory 2013/prefs/ (or 2013-x64/prefs/ or /Maya2013/mentalray/) and add the new registry setting below.

Example (Maya2013 64bit on Windows Vista/7):
Edit the file:
C:\Program Files\Autodesk\Maya2013-x64\prefs\maya.rayrc

add the following line:
registry "{_MI_REG_CCMESH_PTEX}" value "on" end registry
Now to find out how it is done in Softimage so that the texture can be rendered.

From the MR Manual:
In order to enable Ptex per-face assignment the ccmesh surfaces need to carry additional data when computed. This can be enabled globally using a registry key, or per object with a new optional bary attribute.
The Maya people do it globally using the registry key, but is it the best way to do it if only one ore two object in your scene have a ptex texture?

more info in the manual at:
http://docs.autodesk.com/MENTALRAY/2013 ... ml#mi:bary

Global or per object ..... what to do.... :-?
$ifndef "Softimage"
set "Softimage" "true"
$endif

User avatar
Hirazi Blue
Administrator
Posts: 4918
Joined: 04 Jun 2009, 12:15

Re: userIbl shader from mr 3.10

Post by Hirazi Blue » 10 May 2012, 16:48

As a first "proof of concept" trying to get it to work on a global level would seem the logical next step. :-?
Getting it to work "per object" might be nice "little" follow-up project
(probably involving a lot more work)...
...

User avatar
Daniel Brassard
Posts: 830
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario

Re: userIbl shader from mr 3.10

Post by Daniel Brassard » 10 May 2012, 17:19

My thought exactly Hirazi Blue . Test globally as a proof of concept first. If it works then we can figure the process to do it locally later.

Can we do the same registry change as in Maya? Do you know if this is faisible with Soft? (I am not in front of Soft right now so I can't confirm)

edit: Yes, it can be done. The mental ray initialization file .ray3rc is under %SI\Application\rsrc\

Now to test tonight. If everything work well, we will have confirmation that PTEX rendering is faisible in Softimage.

Then a quick modification to the spdl and I'll provide detailed instructions to activate ptex rendering.

More tonight! :D
$ifndef "Softimage"
set "Softimage" "true"
$endif

User avatar
Maximus
Posts: 992
Joined: 09 Jun 2009, 15:45

Re: userIbl shader from mr 3.10

Post by Maximus » 10 May 2012, 19:55

Daniel Brassard wrote:Maximus,

How do you determine that PTEX is working. I installed the ptex.dll, ptex.mi and mib_ptex_lookup.spdl using the plugin manager. Then tested the scene with the bunny test from the PTEX website and got no errors. Does it mean I have it working.

See attached result!
can you share please the ptex.mi and mib_ptex_lookup.spdl?
i'll double check

Kzin
Posts: 432
Joined: 09 Jun 2009, 11:36

Re: userIbl shader from mr 3.10

Post by Kzin » 10 May 2012, 21:42

Saturn wrote: - 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
first, thanks for your effort, its good to see some people that are not that lazy then the ad dev's.


but now to the bad thing, the transparency problem.
the shader is useless for all scenes containing some sort of glas or other transparent surfaces.
i tryed to render a car model and i am not able to get any kind of good transparent effect. i tryed various overrides with transp visible, invisible, same for refractions and also for shadows but without success.

so since 2011 we have ibl but only thru a geoshader so its not possible to render over network.
2 years later we have a lightshader for this, again not implemented by ad, but transp is not working. in these two cases we have a implementation that is useless by default (and no offense to you saturn or to max, its going into ad's direction).

i dont know what i should say, i am tyred of thinking about these things, but wait, we have a great hq viewport in 2013, so thanks autodesk and also thanks to all the betatesters, great work, again...

User avatar
ActionArt
Posts: 853
Joined: 25 Nov 2010, 18:23
Location: Canada

Re: userIbl shader from mr 3.10

Post by ActionArt » 10 May 2012, 21:51

Saturn wrote:You must use the "light relative scale" string option with a value of 0.318 (1/pi)
Anyone know where this can be set?

Kzin
Posts: 432
Joined: 09 Jun 2009, 11:36

Re: userIbl shader from mr 3.10

Post by Kzin » 10 May 2012, 21:55

ActionArt wrote:
Saturn wrote:You must use the "light relative scale" string option with a value of 0.318 (1/pi)
Anyone know where this can be set?
set the diffuse weight of the mia_mat to 0,318.