Mental Ray 3.9 & Production Shaders


#1

Hi guys
The new mib_map Shaders ( undocumented), Added to mental Ray 3.9.

mib_map_get_color
mib_map_get_integer
mib_map_get_integer_array
mib_map_get_scalar
mib_map_get_scalar_array
mib_map_get_transform
mib_map_get_vector

Just edit mentalrayCustomNodeClass.mel to expose the production Shaders as well as the new mib_map shaders


 // Internal MentalRay Nodes. Not meant to be used with Maya.
     int $enableMIPShaders = (`optionVar -query "MIP_SHD_EXPOSE"`== 1);
     int $enableMAPShaders = (`optionVar -query "MAP_SHD_EXPOSE"`==1);

to

// Internal MentalRay Nodes. Not meant to be used with Maya.
     int $enableMIPShaders = (`optionVar -query "MIP_SHD_EXPOSE"`== 0);
     int $enableMAPShaders = (`optionVar -query "MAP_SHD_EXPOSE"`== 0);

Or just type the command in the script editor
For Production Shader


 optionVar -iv "MIP_SHD_EXPOSE" 1; 

For the new mib_map shaders

optionVar -iv "MAP_SHD_EXPOSE" 1;

/Rachid


#2

Cool find achoury.
I can see by the names that these map shaders return/call values of different kinds. But what is their purpose exactly and how would one use them in a shader network?


#3

Hey Rachid, lets hope they don’t do both. :wink:

David


#4

Lol , I’m guessing return and call don’t mean the same thing.
I don’t have 2012 yet to try these out for myself, so I’m just curious to know,
in what situations would these shaders be useful.


#5

Honestly I’ve no idea…it’s seem like conversion utilities to extract some data from another extension file.

yeah if they do both it’s like doing (-1+1) hope too :wink:
do you have any idea what “map” stand for?
/rachid
Edit: : map stand for maps
The map_shaders are located in the base.mi


#6

They are for use with mr point cloud maps


#7

The are userdata shaders, not part of the production shader package.

There’s a lot more to these than you might think. . .lemme see what I can glue together.


#8

Typical, Autodesk included the userdata.dll but not the .mi

Might see what I can do about that. It will be included with Standalone most likely.

These shaders are part of a larger package of user data shaders that allow you to attach and call different data on object/instances/lights, etc.

Sidenote: MAP data can now be used for native particles in mental ray 3.9


#9

Hi
thanks bitter for looking here
The mi file is included in base.mi

#-------------------------------------------- Maps
declare shader
		scalar "mib_map_get_scalar" (
		string		"field_name"
		)
		version 1
	apply texture
end declare

declare shader
		integer "mib_map_get_integer" (
		string		"field_name"
		)
		version 1
	apply texture
end declare

declare shader
		vector "mib_map_get_vector" (
		string		"field_name"
		)
		version 1
	apply texture
end declare

declare shader
		color "mib_map_get_color" (
		string		"field_name"
		)
		version 1
	apply texture
end declare

declare shader
		transform "mib_map_get_transform" (
		string "field_name"
		)
		version 1
	apply texture
end declare

declare shader
		color "mib_map_get_scalar_array" (
		string "field_name"
		)
		version 1
	apply texture
end declare

declare shader
		color "mib_map_get_integer_array" (
		string "field_name"
		)
		version 1
	apply texture
end declare
 

Yo can create the userdata.mi file in the include folder and cut/paste the code from the base.mi .

can you elaborate more on this with just a simple example on how to us it?
regards
/Rachid


#10

That’s for the MAP shaders, but there is a userdata.dll/.so that has more shaders for more general (and useful) purposes. I haven’t found the userdata.mi information for those.

Under “What’s New” in the online mental ray docs they have a very brief mention.

(They also list this as mental ray 3.9.1.37 but that’s not what is in Maya. I really wanted that BSDF NaN to make it into Maya, argh!!)

What’s New


#11

Fromm mental ray Version 3.9.1.37

The map data container allows to store point-like information in mental ray. It provides support for automatic caching of data and swapping to disk files, to be able to manage arbitrarily large amounts of data.

The position of a point, the primary and mandatory property, can be specified in 1-dimensional up to 6-dimensional space, typical applications may use the 2D or 3D space. Any number of additional data item can be attached to a point or particle, each identified by type and name. This makes the map data container a perfect candidate for passing information between renderings, like between frames of an animation, or even from and to other rendering solutions. In addition, mental ray is optimizing common access and lookup methods with the help of acceleration techniques that are optimized for sparse and non-uniform distributions of the data, like arbitrary clouds of points.

So how we can use it ?


#12

No it’s [userdata] part of mental ray 3.9.0 so it’s there (you’ll see the .dll/.so in your mental ray folder now) But Autodesk dropped the .mi file from the Maya package. The link for MAP data you list is version 3.8 and was in Maya 2011.

The new “get_whatever” shaders are part of a separate set of shaders. Some of which are shipped with Maya but lack the .mi file.

I was just lamenting that I really wanted 3.9.1.37 for a separate fix :argh: I’m surprised they posted the 3.9.1.37 and not the 3.9.1.36 release notes.


#13

Ok
I think you have totally misunderstood what I want :
The problem is not if the userdata.dll is in this version or other version. and yes we can see the file userdata.dll in the lib folder, and I guess the corresponding mi file is droped in the base file.
What I want is How to use the new map shaders? Just how to use it .
Thnaks
/Rachid


#14

Userdata is what ive whait for long time! Im try to figure out how to work with them, but now i`m out of free time.

So whait for simple explanation:)


#15

Woah that’s pretty awesome. I’m still a bit confused with with everyone saying different things about it :slight_smile:
Would love to see some examples if any of you dudes have some spare time to do some tests with these shaders.


#16

Is it this?

http://docs.autodesk.com/MENTALRAY/2012/ENU/mental%20ray%203.9%20Help/files/shaders/userdata/userdata.html

This is pretty cool but as you say, this shaders are not avaible. (I’d just check the .mi files and don’t find anything about mib_data things…).

If someone can find the .mi file… :banghead:


#17

@Narann

You’re correct, these are part of the same package. But no .mi file unless it was included with something else. In which case we can drop it in the folder and use them.

Standalone isn’t out yet. But once it’s released you can use that .mi file inside Maya.


#18

Thanks for the info, finally the mi file!

$ifndef "userdata_mi_included"
set "userdata_mi_included" "true"

min version "3.7.53"
max version "3.9.99"

#____________________________mib_data_bool

declare data
	"mib_data_bool"
	(
		string	  "name",
		boolean	 "value"
	)
end declare

#____________________________mib_data_int

declare data
	"mib_data_int"
	(
		string	  "name",
		integer	 "value"
	)
end declare

#____________________________mib_data_scalar

declare data
	"mib_data_scalar"
	(
		string	  "name",
		scalar	  "value"
	)
end declare

#____________________________mib_data_vector

declare data
	"mib_data_vector"
	(
		string	  "name",
		vector	  "value"
	)
end declare

#____________________________mib_data_color

declare data
	"mib_data_color"
	(
		string	  "name",
		color	   "value"
	)
end declare

#____________________________mib_data_string

declare data
	"mib_data_string"
	(
		string	  "name",
		string	  "value"
	)
end declare

#____________________________mib_data_texture

declare data
	"mib_data_texture"
	(
		string		  "name",
		color texture   "value"
	)
end declare

#____________________________mib_data_shader

declare data
	"mib_data_shader"
	(
		string	  "name",
		shader	  "value"
	)
end declare

#____________________________mib_data_bool_array

declare data
	"mib_data_bool_array"
	(
		array string	"names",
		array boolean   "values"
	)
end declare

#____________________________mib_data_int_array

declare data
	"mib_data_int_array"
	(
		array string	"names",
		array integer   "values"
	)
end declare

#____________________________mib_data_scalar_array

declare data
	"mib_data_scalar_array"
	(
		array string	"names",
		array scalar	"values"
	)
end declare

#____________________________mib_data_vector_array

declare data
	"mib_data_vector_array"
	(
		array string	"names",
		array vector	"values"
	)
end declare

#____________________________mib_data_color_array

declare data
	"mib_data_color_array"
	(
		array string	"names",
		array color	 "values"
	)
end declare

#____________________________mib_data_string_array

declare data
	"mib_data_string_array"
	(
		array string	"names",
		array string	"values"
	)
end declare

#____________________________mib_data_texture_array

declare data
	"mib_data_texture_array"
	(
		array string		"names",
		array color texture "values"
	)
end declare

#____________________________mib_data_shader_array

declare data
	"mib_data_shader_array"
	(
		array string	"names",
		array shader	"values"
	)
end declare

#_____________________________________________________User Data Shaders#____________________________#

#____________________________mib_data_get_bool

declare shader
	boolean
	"mib_data_get_bool"
	(
		string	  "name",
		boolean	 "default"
	)
end declare

#____________________________mib_data_get_int

declare shader
	integer
	"mib_data_get_int"
	(
		string	  "name",
		integer	 "default"
	)
end declare

#____________________________mib_data_get_scalar

declare shader
	scalar
	"mib_data_get_scalar"
	(
		string	  "name",
		scalar	  "default"
	)
end declare

#____________________________mib_data_get_vector

declare shader
	vector
	"mib_data_get_vector"
	(
		string	  "name",
		vector	  "default"
	)
end declare

#____________________________mib_data_get_color

declare shader
	color
	"mib_data_get_color"
	(
		string	  "name",
		color	   "default"
	)
end declare

#____________________________mib_data_get_string

declare shader
	string
	"mib_data_get_string"
	(
		string	  "name",
		string	  "default"
	)
end declare

#____________________________mib_data_get_texture

declare shader
	color texture
	"mib_data_get_texture"
	(
		string		  "name",
		color texture   "default"
	)
end declare

#____________________________mib_data_get_shader

declare shader
	shader
	"mib_data_get_shader"
	(
		string	  "name",
		shader	  "default"
	)
end declare

#____________________________mib_data_get_shader_bool

declare shader
	boolean
	"mib_data_get_shader_bool"
	(
		string	  "name",
		boolean	 "default"
	)
end declare

#____________________________mib_data_get_shader_int

declare shader
	integer
	"mib_data_get_shader_int"
	(
		string	  "name",
		integer	 "default"
	)
end declare

#____________________________mib_data_get_shader_scalar

declare shader
	scalar
	"mib_data_get_shader_scalar"
	(
		string	  "name",
		shader	  "default"
	)
end declare

#____________________________mib_data_get_shader_vector

declare shader
	vector
	"mib_data_get_shader_vector"
	(
		string	  "name",
		vector	  "default"
	)
end declare

#____________________________mib_data_get_shader_color

declare shader
	color
	"mib_data_get_shader_color"
	(
		string	  "name",
		shader	  "default"
	)
end declare

$endif #if not "userdata_mi_included" 

/Rachid


#19

I was kinda hoping for node ids but that’ll work. :lightbulb


#20

Wow! Thanks a lot Rachid! I will test that soon!