Mia_wrapper


#61

hey Osaires

so any news on mia_wrapper…
is there any update… with your framebuffer stuff…??
i m asking just be cause i m curios…

dont work to much hehe…

cherio

ghosh


#62

hello all,
sorry my english is very bad…

this shader works great, but I have a little problem.

I want to code a phonomenon in 3ds max. It all works fine, but when the files are stored on the disk, they contain no information. Followed you find the code of my phonomenon (not finished):


 
 declare phenomenon
 
 	material "mia_Buffer" (
 
 		scalar  "diffuse_weight",	  #default 1.0, #: min 0.0 max 1.0
 		color   "diffuse",			 #default 0.5 0.5 0.5,
 		scalar  "diffuse_roughness",   #default 0.0, #: min 0.0 max 1.0
 
 		scalar  "reflectivity",		#default 0.6, #: min 0.0 max 1.0
 		color   "refl_color",		  #default 1.0 1.0 1.0,
 		scalar  "refl_gloss",		  #default 1.0, #: min 0.0 max 1.0
 		integer "refl_gloss_samples",  #default 8,   #: min 0 softmax 128
 		boolean "refl_interpolate",	#default off,
 		boolean "refl_hl_only",		#default off,
 		boolean "refl_is_metal",	   #default off,
 
 		scalar  "transparency",		#default 0.0, #: min 0.0 max 1.0
 		color   "refr_color",		  #default 1.0 1.0 1.0,
 		scalar  "refr_gloss",		  #default 1.0, #: min 0.0 max 1.0
 		scalar  "refr_ior",			#default 1.4, #: min 0.1 softmax 2.0
 		integer "refr_gloss_samples",  #default 8,   #: min 0 softmax 128
 		boolean "refr_interpolate",	#default off,
 		boolean "refr_translucency",   #default off,
 		color   "refr_trans_color",	#default 0.7 0.6 0.5,
 		scalar  "refr_trans_weight",   #default 0.5, #: min 0.0 max 1.0
 
 		scalar  "anisotropy",		  #default 1.0, #: min 0.1 softmax 10
 		scalar  "anisotropy_rotation", #default 0.0, #: softmin 0 softmax 1
 		integer "anisotropy_channel",  #default -1,  #: min -1  softmax 64
 
 		boolean "brdf_fresnel",		 #default off,
 		scalar  "brdf_0_degree_refl",   #default 0.2, #: min 0.0 max 1.0
 		scalar  "brdf_90_degree_refl",  #default 1.0, #: min 0.0 max 1.0
 		scalar  "brdf_curve",		   #default 5.0, #: min 0.1 softmax 20
 		boolean "brdf_conserve_energy", #default on,
 
 		# Interpolation settings
 
 		integer "intr_grid_density",   #default 2,	#: min 0 max 5
 		integer "intr_refl_samples",   #default 2,	#: min 0 softmax 5
 		boolean "intr_refl_ddist_on",  #default off,
 		scalar  "intr_refl_ddist",	 #default 0.0,
 		integer "intr_refr_samples",   #default 2,	#: min 0 softmax 5
 		boolean "single_env_sample",   #default off,
 
 		# Reflection/Refraction optimizations & falloffs
 
 		boolean  "refl_falloff_on",	   #default off,
 		scalar   "refl_falloff_dist",	 #default 0.0,
 		boolean  "refl_falloff_color_on", #default off,
 		color	"refl_falloff_color",	#default 0 0 0,
 		integer  "refl_depth",			#default 5,	#: min 0 softmax 10
 		scalar   "refl_cutoff",		   #default 0.01, #: min 0.0 max 1.0
 
 		boolean  "refr_falloff_on",	   #default off,
 		scalar   "refr_falloff_dist",	 #default 0.0,
 		boolean  "refr_falloff_color_on", #default off,
 		color	"refr_falloff_color",	#default 0 0 0,
 		integer  "refr_depth",			#default 5,	#: min 0 softmax 10
 		scalar   "refr_cutoff",		   #default 0.01, #: min 0.0 max 1.0
 
 		# Factors
 
 		scalar   "indirect_multiplier",   #default 1.0,  #: min 0 softmax 1.0
 		scalar   "fg_quality",			#default 1.0,  #: min 0 softmax 10.0
 		scalar   "fg_quality_w",		  #default 1.0,  #: min 0 softmax 1.0
 
 		# Built in AO
 
 		boolean  "ao_on",		  #default off,
 		integer  "ao_samples",	 #default 16,		  #: min 0 softmax 128
 		scalar   "ao_distance",	#default 10.0,
 		color	"ao_dark",		#default 0.2 0.2 0.2,
 		color	"ao_ambient",	 #default 0.0 0.0 0.0,
 		boolean  "ao_do_details",  #default on,
 
 		# Options
 
 		boolean  "thin_walled",			#default off,
 		boolean  "no_visible_area_hl",	 #default on,
 		boolean  "skip_inside_refl",	   #default on,
 		boolean  "do_refractive_caustics", #default off,
 		boolean  "backface_cull",		  #default off,
 		boolean  "propagate_alpha",		#default off,
 
 		# Other effects
 
 		scalar   "hl_vs_refl_balance",	 #default 1.0,   #: min 0.0 softmax 1.0
 		scalar   "cutout_opacity",		 #default 1.0,   #: min 0.0 max 1.0
 		color	"additional_color",	   #default 0 0 0 0,
 		shader   "bump",
 		boolean  "no_diffuse_bump",		#default off,
 
 		integer	 "mode",
 		array light "lights",
 
 		integer		"fb_1",			#:default 20
 		integer		"fb_2",			#:default 21
 		integer		"fb_3",			#:default 22
 		integer		"fb_4",			#:default 23
 		integer		"fb_5",			#:default 24
 		integer		"fb_6",			#:default 25
 		integer		"fb_7",			#:default 26
 		integer		"fb_8"			#:default 27
 		)
 
 
 
 
 
 shader "arch_mtl" "mia_material" (
 		"diffuse_weight"		 = interface  "diffuse_weight",
 		"diffuse"				   = interface  "diffuse",
 		"diffuse_roughness"	= interface  "diffuse_roughness",
 
 		"reflectivity"		   = interface  "reflectivity",
 		"refl_color"			 = interface  "refl_color",
 		"refl_gloss"			 = interface  "refl_gloss",
 		"refl_gloss_samples"	 = interface  "refl_gloss_samples",
 		"refl_interpolate"	   = interface  "refl_interpolate",
 		"refl_hl_only"		   = interface  "refl_hl_only",
 		"refl_is_metal"		  = interface  "refl_is_metal",
 
 		"transparency"		   = interface  "transparency",
 		"refr_color"			 = interface  "refr_color",
 		"refr_gloss"			 = interface  "refr_gloss",
 		"refr_ior"			   = interface  "refr_ior",
 		"refr_gloss_samples"	 = interface  "refr_gloss_samples",
 		"refr_interpolate"	   = interface  "refr_interpolate",
 		"refr_translucency"	  = interface  "refr_translucency",
 		"refr_trans_color"	   = interface  "refr_trans_color",
 		"refr_trans_weight"	  = interface  "refr_trans_weight",
 
 		"anisotropy"			 = interface  "anisotropy",
 		"anisotropy_rotation"	= interface  "anisotropy_rotation",
 		"anisotropy_channel"	 = interface  "anisotropy_channel",
 
 		"brdf_fresnel"		   = interface  "brdf_fresnel",
 		"brdf_0_degree_refl"	 = interface  "brdf_0_degree_refl",
 		"brdf_90_degree_refl"	= interface  "brdf_90_degree_refl",
 		"brdf_curve"			 = interface  "brdf_curve",
 		"brdf_conserve_energy"   = interface  "brdf_conserve_energy",
 
 		# Interpolation settings
 
 		"intr_grid_density"	 = interface   "intr_grid_density",
 		"intr_refl_samples"	 = interface   "intr_refl_samples",
 		"intr_refl_ddist_on"	= interface   "intr_refl_ddist_on",
 		"intr_refl_ddist"	   = interface   "intr_refl_ddist",
 		"intr_refr_samples"	 = interface   "intr_refr_samples",
 		"single_env_sample"	 = interface   "single_env_sample",
 
 		# Reflection/Refraction optimizations & falloffs
 
 		"refl_falloff_on"	   = interface   "refl_falloff_on",
 		"refl_falloff_dist"	 = interface   "refl_falloff_dist",
 		"refl_falloff_color_on" = interface   "refl_falloff_color_on",
 		"refl_falloff_color"	= interface   "refl_falloff_color",
 		"refl_depth"			= interface   "refl_depth",
 		"refl_cutoff"		   = interface   "refl_cutoff",
 
 		"refr_falloff_on"	   = interface   "refr_falloff_on",
 		"refr_falloff_dist"	 = interface   "refr_falloff_dist",
 		"refr_falloff_color_on" = interface   "refr_falloff_color_on",
 		"refr_falloff_color"	= interface   "refr_falloff_color",
 		"refr_depth"			= interface   "refr_depth",
 		"refr_cutoff"		   = interface   "refr_cutoff",
 
 		# Factors
 
 		"indirect_multiplier"  = interface   "indirect_multiplier",
 		"fg_quality"		   = interface   "fg_quality",
 		"fg_quality_w"		 = interface   "fg_quality_w",
 
 		# Built in AO
 
 		"ao_on"			   = interface	"ao_on",
 		"ao_samples"		  = interface	"ao_samples",
 		"ao_distance"		 = interface	"ao_distance",
 		"ao_dark"			 = interface	"ao_dark",
 		"ao_ambient"		  = interface	"ao_ambient",
 		"ao_do_details"	   = interface	"ao_do_details",
 
 		# Options
 
 		"thin_walled"			= interface  "thin_walled",
 		"no_visible_area_hl"	 = interface  "no_visible_area_hl",
 		"skip_inside_refl"	   = interface  "skip_inside_refl",
 		"do_refractive_caustics" = interface  "do_refractive_caustics",
 		"backface_cull"		  = interface  "backface_cull",
 		"propagate_alpha"		= interface  "propagate_alpha",
 
 		# Other effects
 
 		"hl_vs_refl_balance"	  = interface  "hl_vs_refl_balance",
 		"cutout_opacity"		  = interface  "cutout_opacity",
 		"additional_color"		= interface  "additional_color",
 		"bump"					= interface  "bump",
 		"no_diffuse_bump"		 = interface  "no_diffuse_bump",
 
 		"mode"					= interface  "mode",
 		"lights"				  = interface  "lights"
 
 	)
 
 
 		 shader "wrapper_mtl" "mia_wrapper" (
 				 "mtl" 	= "arch_mtl",
 				 "fb_1"	= interface	"fb_1",
 				 "fb_2"    = interface	"fb_2",
 				 "fb_3"	= interface	"fb_3",
 				 "fb_4"	= interface	"fb_4",
 				 "fb_5"	= interface	"fb_5",
 				 "fb_6"	= interface	"fb_6",
 				 "fb_7"	= interface	"fb_7",
 				 "fb_8"	= interface	"fb_8"
 				 )
 
 
 
 
 material "my_wrapper"
 	   = "arch_mtl"
 			= "wrapper_mtl"
 
 
 
 end material
 
 
 	  root material "my_wrapper"
 
 
 				 gui "gui_mia_buffer" {
 					   control "Global" "Global" (
 					   "uiName" "mia_Buffer",
 					   "category" "Material"
 					   )
 				}
 
 
 	apply material
 
 end declare
 
 

I hope, that somebody can help me with this problem.

attached you find 3 files. One with normal workflow (buffer.max), that runs normal. One with the phenomenon (buffer_phen.max) and the third with the mi.

regards

jb_

Edit: Damn, my fault…sorry! This is the correct code for the phenomenon:






declare phenomenon

	material "mia_Buffer" (

		scalar  "diffuse_weight",	  #default 1.0, #: min 0.0 max 1.0
		color   "diffuse",			 #default 0.5 0.5 0.5,
		scalar  "diffuse_roughness",   #default 0.0, #: min 0.0 max 1.0

		scalar  "reflectivity",		#default 0.6, #: min 0.0 max 1.0
		color   "refl_color",		  #default 1.0 1.0 1.0,
		scalar  "refl_gloss",		  #default 1.0, #: min 0.0 max 1.0
		integer "refl_gloss_samples",  #default 8,   #: min 0 softmax 128
		boolean "refl_interpolate",	#default off,
		boolean "refl_hl_only",		#default off,
		boolean "refl_is_metal",	   #default off,

		scalar  "transparency",		#default 0.0, #: min 0.0 max 1.0
		color   "refr_color",		  #default 1.0 1.0 1.0,
		scalar  "refr_gloss",		  #default 1.0, #: min 0.0 max 1.0
		scalar  "refr_ior",			#default 1.4, #: min 0.1 softmax 2.0
		integer "refr_gloss_samples",  #default 8,   #: min 0 softmax 128
		boolean "refr_interpolate",	#default off,
		boolean "refr_translucency",   #default off,
		color   "refr_trans_color",	#default 0.7 0.6 0.5,
		scalar  "refr_trans_weight",   #default 0.5, #: min 0.0 max 1.0

		scalar  "anisotropy",		  #default 1.0, #: min 0.1 softmax 10
		scalar  "anisotropy_rotation", #default 0.0, #: softmin 0 softmax 1
		integer "anisotropy_channel",  #default -1,  #: min -1  softmax 64

		boolean "brdf_fresnel",		 #default off,
		scalar  "brdf_0_degree_refl",   #default 0.2, #: min 0.0 max 1.0
		scalar  "brdf_90_degree_refl",  #default 1.0, #: min 0.0 max 1.0
		scalar  "brdf_curve",		   #default 5.0, #: min 0.1 softmax 20
		boolean "brdf_conserve_energy", #default on,

		# Interpolation settings

		integer "intr_grid_density",   #default 2,	#: min 0 max 5
		integer "intr_refl_samples",   #default 2,	#: min 0 softmax 5
		boolean "intr_refl_ddist_on",  #default off,
		scalar  "intr_refl_ddist",	 #default 0.0,
		integer "intr_refr_samples",   #default 2,	#: min 0 softmax 5
		boolean "single_env_sample",   #default off,

		# Reflection/Refraction optimizations & falloffs

		boolean  "refl_falloff_on",	   #default off,
		scalar   "refl_falloff_dist",	 #default 0.0,
		boolean  "refl_falloff_color_on", #default off,
		color	"refl_falloff_color",	#default 0 0 0,
		integer  "refl_depth",			#default 5,	#: min 0 softmax 10
		scalar   "refl_cutoff",		   #default 0.01, #: min 0.0 max 1.0

		boolean  "refr_falloff_on",	   #default off,
		scalar   "refr_falloff_dist",	 #default 0.0,
		boolean  "refr_falloff_color_on", #default off,
		color	"refr_falloff_color",	#default 0 0 0,
		integer  "refr_depth",			#default 5,	#: min 0 softmax 10
		scalar   "refr_cutoff",		   #default 0.01, #: min 0.0 max 1.0

		# Factors

		scalar   "indirect_multiplier",   #default 1.0,  #: min 0 softmax 1.0
		scalar   "fg_quality",			#default 1.0,  #: min 0 softmax 10.0
		scalar   "fg_quality_w",		  #default 1.0,  #: min 0 softmax 1.0

		# Built in AO

		boolean  "ao_on",		  #default off,
		integer  "ao_samples",	 #default 16,		  #: min 0 softmax 128
		scalar   "ao_distance",	#default 10.0,
		color	"ao_dark",		#default 0.2 0.2 0.2,
		color	"ao_ambient",	 #default 0.0 0.0 0.0,
		boolean  "ao_do_details",  #default on,

		# Options

		boolean  "thin_walled",			#default off,
		boolean  "no_visible_area_hl",	 #default on,
		boolean  "skip_inside_refl",	   #default on,
		boolean  "do_refractive_caustics", #default off,
		boolean  "backface_cull",		  #default off,
		boolean  "propagate_alpha",		#default off,

		# Other effects

		scalar   "hl_vs_refl_balance",	 #default 1.0,   #: min 0.0 softmax 1.0
		scalar   "cutout_opacity",		 #default 1.0,   #: min 0.0 max 1.0
		color	"additional_color",	   #default 0 0 0 0,
		shader   "bump",
		boolean  "no_diffuse_bump",		#default off,

		integer	 "mode",
		array light "lights",



		integer		"fb_1",			#:default 20
		integer		"fb_2",			#:default 21
		integer		"fb_3",			#:default 22
		integer		"fb_4",			#:default 23
		integer		"fb_5",			#:default 24
		integer		"fb_6",			#:default 25
		integer		"fb_7",			#:default 26
		integer		"fb_8"			#:default 27


			  )





shader "arch_mtl" "mia_material" (
		"diffuse_weight"		 = interface  "diffuse_weight",
		"diffuse"				= interface  "diffuse",
		"diffuse_roughness"	  = interface  "diffuse_roughness",

		"reflectivity"		   = interface  "reflectivity",
		"refl_color"			 = interface  "refl_color",
		"refl_gloss"			 = interface  "refl_gloss",
		"refl_gloss_samples"	 = interface  "refl_gloss_samples",
		"refl_interpolate"	   = interface  "refl_interpolate",
		"refl_hl_only"		   = interface  "refl_hl_only",
		"refl_is_metal"		  = interface  "refl_is_metal",

		"transparency"		   = interface  "transparency",
		"refr_color"			 = interface  "refr_color",
		"refr_gloss"			 = interface  "refr_gloss",
		"refr_ior"			   = interface  "refr_ior",
		"refr_gloss_samples"	 = interface  "refr_gloss_samples",
		"refr_interpolate"	   = interface  "refr_interpolate",
		"refr_translucency"	  = interface  "refr_translucency",
		"refr_trans_color"	   = interface  "refr_trans_color",
		"refr_trans_weight"	  = interface  "refr_trans_weight",

		"anisotropy"			 = interface  "anisotropy",
		"anisotropy_rotation"	= interface  "anisotropy_rotation",
		"anisotropy_channel"	 = interface  "anisotropy_channel",

		"brdf_fresnel"		   = interface  "brdf_fresnel",
		"brdf_0_degree_refl"	 = interface  "brdf_0_degree_refl",
		"brdf_90_degree_refl"	= interface  "brdf_90_degree_refl",
		"brdf_curve"			 = interface  "brdf_curve",
		"brdf_conserve_energy"   = interface  "brdf_conserve_energy",

		# Interpolation settings

		"intr_grid_density"	 = interface   "intr_grid_density",
		"intr_refl_samples"	 = interface   "intr_refl_samples",
		"intr_refl_ddist_on"	= interface   "intr_refl_ddist_on",
		"intr_refl_ddist"	   = interface   "intr_refl_ddist",
		"intr_refr_samples"	 = interface   "intr_refr_samples",
		"single_env_sample"	 = interface   "single_env_sample",

		# Reflection/Refraction optimizations & falloffs

		"refl_falloff_on"	   = interface   "refl_falloff_on",
		"refl_falloff_dist"	 = interface   "refl_falloff_dist",
		"refl_falloff_color_on" = interface   "refl_falloff_color_on",
		"refl_falloff_color"	= interface   "refl_falloff_color",
		"refl_depth"			= interface   "refl_depth",
		"refl_cutoff"		   = interface   "refl_cutoff",

		"refr_falloff_on"	   = interface   "refr_falloff_on",
		"refr_falloff_dist"	 = interface   "refr_falloff_dist",
		"refr_falloff_color_on" = interface   "refr_falloff_color_on",
		"refr_falloff_color"	= interface   "refr_falloff_color",
		"refr_depth"			= interface   "refr_depth",
		"refr_cutoff"		   = interface   "refr_cutoff",

		# Factors

		"indirect_multiplier"  = interface   "indirect_multiplier",
		"fg_quality"		   = interface   "fg_quality",
		"fg_quality_w"		 = interface   "fg_quality_w",

		# Built in AO

		"ao_on"			   = interface	"ao_on",
		"ao_samples"		  = interface	"ao_samples",
		"ao_distance"		 = interface	"ao_distance",
		"ao_dark"			 = interface	"ao_dark",
		"ao_ambient"		  = interface	"ao_ambient",
		"ao_do_details"	   = interface	"ao_do_details",

		# Options

		"thin_walled"			= interface  "thin_walled",
		"no_visible_area_hl"	 = interface  "no_visible_area_hl",
		"skip_inside_refl"	   = interface  "skip_inside_refl",
		"do_refractive_caustics" = interface  "do_refractive_caustics",
		"backface_cull"		  = interface  "backface_cull",
		"propagate_alpha"		= interface  "propagate_alpha",

		# Other effects

		"hl_vs_refl_balance"	  = interface  "hl_vs_refl_balance",
		"cutout_opacity"		  = interface  "cutout_opacity",
		"additional_color"		= interface  "additional_color",
		"bump"					= interface  "bump",
		"no_diffuse_bump"		 = interface  "no_diffuse_bump",

		"mode"					= interface  "mode",
		"lights"				  = interface  "lights"

	)




		 shader "wrapper_mtl" "mia_wrapper" (
				 "mtl" 	"arch_mtl",
				 "fb_1"	= interface	"fb_1",
				 "fb_2" 	= interface	"fb_2",
				 "fb_3"	= interface	"fb_3",
				 "fb_4"	= interface	"fb_4",
				 "fb_5"	= interface	"fb_5",
				 "fb_6"	= interface	"fb_6",
				 "fb_7"	= interface	"fb_7",
				 "fb_8"	= interface	"fb_8"
				 )




material "my_wrapper"
	   = "wrapper_mtl"




end material


	  root material "my_wrapper"





	apply material

end declare


Next time, i add defaults an gui-controls…


#63

you say that defualt is 0, meaning off? so is 1 on? ive been trying to get this to work with ctrl buffers for the past 6 hrs now and all im getting is black renders


#64

anyone used mia_wrapper with success i 3dsmax2008?

P


#65

You must wait of the max update, with the new mr version. At the moment the buffer- system is broken.


#66

Hello,
I use wrapper with Maya 8.5 and ctrl_buffer in production, and i have a big probleme.
My pass buffers have aliasing.
Look the picture.
The format is openEXR.
With buffer_store, it is clean but with the wiapper, the result is aliasing.

Help please.


#67

IT seem this shaders is not working on maya 2008 x64…i have the latest patch P04 and i am using puppets p_megaTK_pass (shaders_p 3.2 beta5) as my buffer_writer…

has someone tested it with 2008 on 64bit yet? Or can someone recompile it with the latest MR_SDK that shipped with 2008(maybe P04)?

would be realy cool!

thx guys…
OLi


#68

bigbossfr: The picture is kind of unclear, but try multipling your buffer pass with you aplha.

Ultrasonic: hmm, yeah maby is should be recompiled for 2008, but the new mia_x material already have the wrapper built inn to it so maby try using that isted?


#69

It doesn’t work. It is because i have car_paint_phen, and i don’t know how to get a pass with it.


#70

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.