PDA

View Full Version : Annouce : DeexFastBuffersOutput, output buffer quickly


bigbossfr
11-25-2009, 10:21 PM
Hi,
I share my script to output all buffers QUICKY (the render time isn't multiplied by 6-7) from : mia_material_x or mia_material_x_passes or mi_car_paint_phen_x or mi_car_paint_phen_x_passes or mi_metallic_paint_x or mi_metallic_paint_x_passes or misss_fast_shader_x or misss_fast_shader_x_passes shader, with the p_megaTk shader (it is a trick, big thank to Pavel).

I explain the trick here : http://forums.cgsociety.org/showpost.php?p=6218812&postcount=39

http://img267.imageshack.us/img267/8130/hypershade.jpg
http://img27.imageshack.us/img27/7812/mega1zv.jpg

http://img267.imageshack.us/img267/4853/mega2w.jpg

http://img267.imageshack.us/img267/1678/passm.jpg

http://img263.imageshack.us/img263/9929/20091126001226.jpg (http://img263.imageshack.us/i/20091126001226.jpg/)

The script is here :

http://www.creativecrash.com/maya/downloads/scripts-plugins/rendering/mental-ray/c/deexfastbuffersoutput

If you found bugs or other, please write a message here.

Ps to Pavel : if we can set the name of the specials channels and have more and more specials channels (tha 10), it will be great. Thank !

JasonA
11-26-2009, 02:31 PM
sweet man, thanks! I look forward to giving this a whirl.
:beer:

no-name-party
11-26-2009, 06:11 PM
Can I use this with the normal Maya materials, too?

Jozvex
11-27-2009, 12:23 PM
Great job! Will be very useful, thanks!

:thumbsup:

coccosoids
11-29-2009, 11:58 AM
Do you need p_MegaTk lights for this to work?
I'm guessing no but... I'd like a solid affirmative/negative.
~
Don't habe p_MegaPack shaders installed so I can't test at the moment.

coccosoids
11-29-2009, 12:04 PM
TK lights should be used only for "TK" shaders (p_MegaTK and p_HairTK).
And only for internal 'diffuse' and 'specular' component (for correct shadow pass). So if you have disabled internal diffuse and specular you don't need TK lights.

Thanks Pavel... mighty good to know. ;)

Puppet|
11-29-2009, 12:07 PM
TK lights should be used only for "TK" shaders (p_MegaTK and p_HairTK).
And only for internal 'diffuse' and 'specular' component (for correct shadow pass). So if you have disabled internal diffuse and specular you don't need TK lights.

crispy4004
11-30-2009, 07:40 PM
An Autodesk rep told me this issue was fixed a long time ago at the Maya support blog with 2009 SP1, though he could have very well thought I was referring to another problem.

Just opened up 2010 x64 and tried it with a small scene using around 6 different "write to color buffers". Didn't make a difference to the render time. It's a small scene though. I'd need to do further testing to see if it's fixed.

crispy4004
12-01-2009, 06:11 PM
Hey Deex, any thoughts on creating a Vray "MultiMatte" equivalent for Mental Ray? A script that would create a new "write to color buffer" and pass for each material specifically for a Matte. This is all asuming the render 5x render hike is gone as this won't work with only 10 special channels. It would look like this in the render pass window:


Passes:

[MultiMatte]
. Matte_Clock_Material
. Matte_Handle_Material
. Matte_Mia_Material2


Renderable Passes:
[MultiMatte]


Then when you open up the EXR you'll have all the Matte Passes to choose from.



Also I wanted to mention I love the new setup, and have a couple of ideas of my own that could make it even better. With a couple of custom Buffer Presets in addition to those from the Mia Material this could be absolutely amazing, such as the following:

Non-FG Indirect Pass (http://img517.imageshack.us/img517/5528/render2b.jpg) - Uses a different method to compute Indirect Light. Does not Flicker.
Pass SSS - creates a new SSS material with just the subsurface (no diffuse or specular). Can be used in compositing to add SSS to a material with less headache.
Pure Color Pass - Color input written directly to a buffer and not through Mia Material Diffuse_Raw.
Fresnel Pass - Pass to give more control over Reflection in compositing. Also good for creating a peach fuzz effect.
Point Cloud Pass - Used, in addition to a normal Pass for 2.5 relighting in compositing.
MultiMatte Pass - mentioned above.
Blinn/Phong Specular - Creates a Blinn or Phong for specular Highlights.

Feel free to email me about how to achieve the various Passes.
Crispy4004@gmail.com


Also three more ideas:

-Add a lighting linking check box next to the Passes you want to have a separate pass for each light in the scene.

-Add a "Linear Gamma" checkbox next to passes you want it to effect. It would add a gamma correct node with a value of .445 right before the frame buffer. (In compositing you throw a color corrector with a 2.2 Gamma value at the end of the chain, makes it work with Linear workflow.)

-Finally a "Throw into Bin" drop down menu to select the Bin you want the selected Materials to be added into. Maybe a "Create Extra Bin" checkbox as well for all the extra materials created to achieve all the custom buffer Presets.



I know I proposed a lot, but that is because I see lots of potential. Again, feel free to email me or get back to me here. I really want to do what I can to help out with this.

Ironhalo
12-01-2009, 08:13 PM
nice script, it looks a lot like another one on creativecrash that i wrote a while back.

http://www.creativecrash.com/maya/downloads/scripts-plugins/rendering/mental-ray/c/ctrl_buffer-creator-for-material_x--2

in fact, it looks almost exactly the same except for it being in python, and working for puppets shader pack. same variables, even the same comments. dont you think you should at least 'Please give credit where credit is due'?

jasonhuang1115
12-01-2009, 09:21 PM
very interesting!! If those passes mentioned below could be integrated, that will be sweet!!
They will extremely helpful for the post work.
crispy4004: any hint you can share about the non-FG indirect pass technique? If it is flicker-free as well as having FG's features such as color-bleeding and secondary bounce tuning, that will be great.....

Hey Deex, any thoughts on creating a Vray "MultiMatte" equivalent for Mental Ray? A script that would create a new "write to color buffer" and pass for each material specifically for a Matte. This is all asuming the render 5x render hike is gone as this won't work with only 10 special channels. It would look like this in the render pass window:

Then when you open up the EXR you'll have all the Matte Passes to choose from.

Also I wanted to mention I love the new setup, and have a couple of ideas of my own that could make it even better. With a couple of custom Buffer Presets in addition to those from the Mia Material this could be absolutely amazing, such as the following:

Non-FG Indirect Pass (http://img517.imageshack.us/img517/5528/render2b.jpg) - Uses a different method to compute Indirect Light. Does not Flicker.
Pass SSS - creates a new SSS material with just the subsurface (no diffuse or specular). Can be used in compositing to add SSS to a material with less headache.
Pure Color Pass - Color input written directly to a buffer and not through Mia Material Diffuse_Raw.
Fresnel Pass - Pass to give more control over Reflection in compositing. Also good for creating a peach fuzz effect.
Point Cloud Pass - Used, in addition to a normal Pass for 2.5 relighting in compositing.
MultiMatte Pass - mentioned above.
Blinn/Phong Specular - Creates a Blinn or Phong for specular Highlights.

Feel free to email me about how to achieve the various Passes.
Crispy4004@gmail.com

YourDaftPunk
12-02-2009, 12:11 AM
nice script, it looks a lot like another one on creativecrash that i wrote a while back.

http://www.creativecrash.com/maya/downloads/scripts-plugins/rendering/mental-ray/c/ctrl_buffer-creator-for-material_x--2

in fact, it looks almost exactly the same except for it being in python, and working for puppets shader pack. same variables, even the same comments. dont you think you should at least 'Please give credit where credit is due'?

I'd want credit. :/

bigbossfr
12-02-2009, 08:45 PM
nice script, it looks a lot like another one on creativecrash that i wrote a while back.

http://www.creativecrash.com/maya/downloads/scripts-plugins/rendering/mental-ray/c/ctrl_buffer-creator-for-material_x--2

in fact, it looks almost exactly the same except for it being in python, and working for puppets shader pack. same variables, even the same comments. dont you think you should at least 'Please give credit where credit is due'?

1) I don't want money, i just share my script. I copied the first lines from my deexRenderBoosterTile script. I just forgot to delete "the credit" line. If i want credit, what is the utility to share my script for free ? :/

2) Before, i used my script without UI for my personnal work.
I just shared my workflow is this thread :
http://forums.cgsociety.org/showthread.php?f=87&t=727196&page=3

3) I saw there are people who were interested to use my workflow.

4) I decide to share my script but first, i need to create an UI. So, I remembered a script that had the same UI like i wanted to create.

5) Oh hell, to go faster (yes, because i write my script after back to work, in my free time), i took the example from the another script.
So, What is the utility of rewriting the "same" UI ?

6) My script is free.

7) What is the problem ?

Hey Deex, any thoughts on creating a Vray "MultiMatte" equivalent for Mental Ray? A script that would create a new "write to color buffer" and pass for each material specifically for a Matte. This is all asuming the render 5x render hike is gone as this won't work with only 10 special channels. It would look like this in the render pass window:



Then when you open up the EXR you'll have all the Matte Passes to choose from.
.

My DeexRenderTool does that.
http://www.creativecrash.com/maya/downloads/scripts-plugins/rendering/mental-ray/c/deex-render-tool
Just create a new preset a choose your pass.
You can add extra custom material, etc etc...Save pass preset, etc etc...

Nice idea but, what is : "Non-FG Indirect Pass (http://img517.imageshack.us/img517/5528/render2b.jpg) - Uses a different method to compute Indirect Light. Does not Flicker." ?

When i have time, next step :
- create a button to create the dummy with the p_MegaTK_pass in one click
- add a checkbox for linear workflow (the gamma correct...)

Thank all.
If we can have more Special Channel from Pavel (and set name), it would be great.
Without Pavel, we are nothing :cool:

rBrady
12-02-2009, 10:27 PM
I think he just wants credit. Scripting is a pain in the ass and the only thing you get in return is credit. I compared the code and way too much is similar to not give credit. People take this stuff really serious in this industry, and it only takes a second to write "used some code from so-and-so".

I did an animation loosely based on a Calvin and Hobbes strip. I posted an early playblast and just about got kicked off a forum for not giving Bill Waterson credit for my inspiration. I was shocked at the uproar. I learned my lesson then.

Just give credit.

Ironhalo
12-02-2009, 11:18 PM
if im coming off like a jerk then i apologize, its not my intent. what im saying is, your script is clearly based off of what i wrote. i also wrote mine during my personal time, and for the whole community to use. i have never asked for money for scripts i've written.

i just think its very inappropriate to use someones work and not give them any mention. if i have a piece in my demo reel that was done by someone else, then i make sure i credit them for what they did.

bigbossfr
12-02-2009, 11:28 PM
I updated the script : linear workflow supported (please test, i haven't the time now) and one click dummy.

http://img254.imageshack.us/img254/3774/20091203012322.jpg (http://img254.imageshack.us/i/20091203012322.jpg/)

I write credit for you Ironhalo, i haven't your email. My english is not perfect. I thought that the word "credit" is "money" :blush:, but no, excuse me.

crispy4004
12-03-2009, 12:45 AM
First I want to mention that I was mistaken. The Color Buffer Render time hike bug still exists. :(


My DeexRenderTool does that.
http://www.creativecrash.com/maya/downloads/scripts-plugins/rendering/mental-ray/c/deex-render-tool
Just create a new preset a choose your pass.
You can add extra custom material, etc etc...Save pass preset, etc etc...

Correct me if I'm wrong, but there is no checkmark you tick to create a new Matte Pass for every shader. Sure you can do it manually with the Deex tool or by hand, but I'm talking more along the lines of a script that automaticly does it for you. Currently if you have a 100 materials in a scene, creating a Matte Pass manually for each can be an all day affair.


I am familiar with your tool, though I prefer to set things up manually so I can add in my own custom passes like the ones I mentioned above. I find them too useful in compositing; the default Mia_Material outputs alone just don't cut it. What would be incredible is if the user was able to create their own pass presets from hypershade networks and Load them up from the "Deex Fast Buffer Output" Buffer Result drop down menu.




Nice idea but, what is : "Non-FG Indirect Pass (http://img517.imageshack.us/img517/5528/render2b.jpg) - Uses a different method to compute Indirect Light. Does not Flicker." ?


Look at the car:
http://www.harrybardak.co.uk/TDlove2006.htm
Also here:
http://linghaoli.com/blog/?tag=bent-normal
(you don't have to bake out the maps, but for in-animate objects not internacting with animate ones, it can be very benificial)

It uses AO and AO in bent normal mode to calculate the indirect light. It doesn't have all the features of true Final Gathering, but on the other hand it does not flicker making it far more ideal for animations. Real FG can work for animations, but to remove flicker you have to fake parts with AO and tone down the FG settings, which coincidentally comes at a cost in quality.

It's a simple senerio of picking the lesser of two evils to avoid the flicker:

1. Use poorly sampled Final Gather, with high interpolation (blends samples) and faked darks with AO.
2. Use excellently sampled Faked Final Gather all done through AO algorithms, but loose the color bleeding and secondary bounces.


I prefer option 2 because any benefits to Real FG go away when you have to drop the samples.





If It helps I could build you a scene with all the Custom Passes and Faked FG attached to a shader network.

crispy4004
12-03-2009, 12:46 AM
I updated the script : linear workflow supported (please test, i haven't the time now) and one click dummy.
Nice, I'll check it out.

crispy4004
12-03-2009, 03:16 AM
Works well, only problem I had was if you delete the network, you cannot re-create it with pre-existing Materials. Anyways I took your setup and added many of the passes that make things like Fake FG, Post SSS, and Fresnel control possible.

http://img11.imageshack.us/img11/4985/passnetwork.th.jpg (http://img11.imageshack.us/i/passnetwork.jpg/)

Let me know if you want the file, if these custom passes are things you are interested in implementing. I'm not a programer, so I don't know how hard it would be write a script to build this stuff. I imagine the fake FG will be more difficult to implement though.

jasonhuang1115
12-03-2009, 03:37 AM
I read the concept of 1st option from Zap's note before but haven't tried it for rendering character animation yet. So, basically, even the 1st option can generate flicker-free character animation renders, the color-bleeding and secondary bounces will be obscure because of the low density and high interpolation FG, and so the result will be visually very close to the 2nd option that is basically flicker-free guaranteed. Please correct me if I got it wrong.

- Jason



It's a simple senerio of picking the lesser of two evils to avoid the flicker:

1. Use poorly sampled Final Gather, with high interpolation (blends samples) and faked darks with AO.
2. Use excellently sampled Faked Final Gather all done through AO algorithms, but loose the color bleeding and secondary bounces.


I prefer option 2 because any benefits to Real FG go away when you have to drop the samples.

crispy4004
12-03-2009, 03:53 AM
Exactly.

Only option #1 still does flicker; the AO and low density, high interpolation FG just help to hide it. Also if you go to low with the sampling it can cause artifacts.

...but it is easier to implement because you can apply it gobaly to the scene in the render settings. The AO Fake FG has to be done on a per-shader basis, which is precisely why having a script to do it would be killer. Preferably with a Render Pass output.

bigbossfr
12-03-2009, 12:25 PM
Works well, only problem I had was if you delete the network, you cannot re-create it with pre-existing Materials.

?
I don't understand.
Example : you have 5 specials channels in your scene.
You want to add an another channel. Just click the delete button and "recreate/update button".
You can click on the create/update button directly when you just add news *_x shaders in your scene.

Anyways I took your setup and added many of the passes that make things like Fake FG, Post SSS, and Fresnel control possible.

http://img11.imageshack.us/img11/4985/passnetwork.th.jpg (http://img11.imageshack.us/i/passnetwork.jpg/)

Let me know if you want the file, if these custom passes are things you are interested in implementing. I'm not a programer, so I don't know how hard it would be write a script to build this stuff. I imagine the fake FG will be more difficult to implement though.

Yes, give me the file please =).
Are you sur we must put a gamma correct between the buffer output and the megaTk shader ? Is there the same result like when we put a gamma correct on the color swatch ? (for example a diffuse pass).

crispy4004
12-03-2009, 04:13 PM
I still need to test the setup out and make sure all the connections are working, but I'll try to get you the file to you hopefully later today.

And yes, the gamma correct needs to be attached to the buffer and not the color swatch:
Read Why here (http://www.djx.com.au/blog/2008/10/06/linear-workflow-and-gamma-update/)

About the problem I was having, I'll look into it again and get back to you later.

Puppet|
12-03-2009, 08:05 PM
Sorry, but correct workflow with gamma is:
1. BackGamma for 8 and 16 textures only.
2. In compoziting apply gamma LUT for final image only, but not for every passes.

And no any gamma correction for passes itself.
Float data never will be gamma corrected. Float always should be stored as linear.

bigbossfr
12-03-2009, 10:41 PM
Sorry, but correct workflow with gamma is:
1. BackGamma for 8 and 16 textures only.
2. In compoziting apply gamma LUT for final image only, but not for every passes.

And no any gamma correction for passes itself.
Float data never will be gamma corrected. Float always should be stored as linear.

Yes, it is what I thought. But a question : we must put a gamma just for a filetexture ?
Example : if i don't have filetexture, just a color in my diffuse of my mia_material_x, i must connect a gamma correct node in the diffuse slot with a gamma to 0.445 and the same color that there had, no ?

If is what i said, i will do a system to do that automatically but i must have a list of what "color" a must connect a gamma node, for *_x shader (diffuse color, specular color, flake color ?, etc etc...).

valler
12-05-2009, 12:22 AM
Hello everybody!

I have downloaded the script along with Puppet's shader collection yesterday. I will try it out this weekend hopefully. Thanks in advance to all the creators and contributors.

Are there any problems using this method with "complex" shading networks (eg any two nodes connected to a shader input via a multiply node)?
Simply connecting the result of a channel to MR's write-to-buffer-nodes doesn't work and needs a more complex setup.

I wouldn't integrate any gamma-stuff or at least keep it clearly separate and distinguishable inside the interface. To me (and maybe for others aswell :D ) rendering passes is working in advance for post while linear workflow (and gamma correction for different media or workarounds for not color aware software) falls under color management.

Best regards


Valler

djx
12-05-2009, 03:03 AM
If is what i said, i will do a system to do that automatically but i must have a list of what "color" a must connect a gamma node, for *_x shader (diffuse color, specular color, flake color ?, etc etc...).
Yes, I agree with what you said. And I think if it is a color, then gamma-correct, but if it is some other data, then do not.

For example: diffuse color = yes, but diffuse weight = no.

-- David

crispy4004
12-05-2009, 08:00 AM
Thanks everyone for helping to clarify where to apply the gamma correction for correct Linear workflow. Deex, sorry I haven't been able to get you that file yet. I'm still working out some kinks, don't know if I'll have the time to finish tomorrow but hopefully by the end of the weekend. Here are the two major problems I'm having:


- Physical Sun & Sky is causing problems with my Post SSS pass in compositing (think it has something to do with relying on the .2 gain value), works great with all the other passes though, so long as you do a .2 gain, 2.2 gamma color correction node at the end of the chain. I have an idea on how to fix it, but I'm not sure if it will work.

- The HDRI sphere created by mental ray has no coordinate outputs or placement node. Makes it very difficult to link it to the Env Ball node needed for the fake FG. Also need to do some testing with using an HDRI in general, but I'm pretty sure I can get it working 100%. Also have an idea for a fix.

(Getting both to work would be amazing, but it's looking like for right now it's going to be one or the other.)


I'm building you a Fusion composite as well too showing how the passes I mentioned get added together. Also for some good news, I got my Post SSS Pass to contribute to the straight Maya Render in addition to the fake FG, so you'll get a closer visual preview.

jasonhuang1115
12-05-2009, 01:28 PM
This thread might be of help for you.
http://forums.cgsociety.org/showthread.php?f=87&t=809879&highlight=gamma+correct+list

If is what i said, i will do a system to do that automatically but i must have a list of what "color" a must connect a gamma node, for *_x shader (diffuse color, specular color, flake color ?, etc etc...).

Galakgorr
12-05-2009, 05:31 PM
here's a script i wrote to automatically gamma correct any attribute of a shader that has RGB values...

http://www.toadstorm.com/freebies/mel/hfAutoGamma.mel

select the shaders you want to correct and type hfAutoGamma(0.455) or whatever number you want to correct to, it will correct both file textures and swatches.

i know it's kind of a brute force thing since it's correcting things like reflectedColor which djx says shouldn't be corrected, but i didn't want to write a separate condition for each attribute of specific shaders... maybe i can add that in the next version.

bigbossfr
12-05-2009, 06:48 PM
jasonhuang1115 (http://forums.cgsociety.org/member.php?u=177578) : thank !

Galakgorr (http://forums.cgsociety.org/member.php?u=142557) : Oh man, it is too late, i finished rewriting all the linear fonction, but thank !
I see your post too late but see :
Now the linear fonction put a gamma node before fileNode and add a gamma node in the "ambient", "additional_color", "back_sss_color", "base_color", "diffuse_color", "diffuse", "edge_color", "front_sss_color", "lit_color", "refl_falloff_color", "refr_falloff_color", "refr_trans_color", "flake_color", "dirt_color" slot of all *_x material.
Please say me if i must put gamma in another slot color or after another node (normally, no).

Before :

http://img139.imageshack.us/img139/3277/beforev.jpg (http://img139.imageshack.us/i/beforev.jpg/)

After :

http://img682.imageshack.us/img682/4214/afterx.jpg (http://img682.imageshack.us/i/afterx.jpg/)

Please test but i have tested and all is working great.
I wait for the crispy4004's file to add other fonctions.

Script in same place : http://www.creativecrash.com/maya/downloads/scripts-plugins/rendering/mental-ray/c/deexfastbuffersoutput

Thanks

crispy4004
12-06-2009, 02:39 AM
Yes!!! Sat down for a few hours today and finally got my Post SSS Pass working with Physical Sun & sky Fake FG Pass. Took a lot of trial and error. Physical sun & sky is not very pass rendering friendly, especially with SSS in the mix.

Here is a quick preview:

http://img130.imageshack.us/img130/7136/picturefl.jpg



Also changed it so Physical Sun & Sky outputs at the correct gain value meaning no more messing around with the .2 value in composting. Just the standard 2.2 gamma value for linear workflow.

Soon Deex, soon. Just got a few smaller things to work out and some stuff to document so you're ready to go. Keep up the good work!

crispy4004
12-06-2009, 10:26 PM
Again, almost done:
http://img687.imageshack.us/img687/1033/picture2l.jpg

Just got a little bit more to wrap up before I email you everything.

crispy4004
12-07-2009, 12:56 AM
Alright just emailed you the file. :thumbsup: Hope everything goes smoothly for you.


Hopefully Puppet can help us out by allowing an infinite number of special passes in the future so we can have lots of room for Matte passes + more.

Edit: Email didn't go through because the file was too big. Sending it again through yousendit.com instead.

caro
12-07-2009, 01:57 AM
OK, this is probably lamest question possible but... how do you use the script? I downloaded both, the script and the shaders. Installed the shaders pack (they appear properly in hypershade and seem to be working). I loaded the DeexBufferCreate to script editor, put that on shelf and have no idea how to run it (was expecting to see the same window form screenshot). Did try with mesh selected, with material selected (one of the _x ones), shading group, but noting happens.

Once again, sorry for exrtremely lame question but I really have no idea what to do.

crispy4004
12-07-2009, 02:25 AM
Put the script in the appropriate script folder and type this in the python line:

import DeexBufferCreate;DeexBufferCreate.DeexBufferCreate()

caro
12-07-2009, 04:09 AM
Thanks a lot, got it running! :)
Have trouble actually using it, I mean batch render gives me just the beauty pass but it's probably something obvious I'm missing (just like an hour ago, hehe). Will come back tomorrow with some results, either super happy or asking for more help ;)

Thanks again guys! For help and the script!

crispy4004
12-07-2009, 07:04 AM
1. Create and select the Dummy pCube.
2. Open the attributes and go to the p_MegaTK_pass
3. Name the file and select the Render Directory.
4. Change the Format to OpenEXR through the p_OpenEXR_saver
5. Set compression to Zlib Compression (16 scan lines)
6. Make it 16 bit per Channel (Half float)

You are all done, the multi-channel EXR file should render and everything will be ready for compositing with Linear Workflow so long as you have it enabled with Deex's tool.

bigbossfr
12-07-2009, 06:32 PM
I received the file, i will check.

Thank Christopher.

crispy4004
12-07-2009, 08:08 PM
You're welcome. Just trying to do what I can to help out. I'm very excited about where this can go.

Thank you for all your hard work as well.

bigbossfr
12-07-2009, 08:36 PM
Ok, i cheked your shading setup. Question :

1) For the pure color, you connect directly your texture in a special channel. But why you don't use the diffuse_level buffer ?
If we connect the texture directly, the "final" diffuse doesn't match with the master diffuse (?).

2) Fresnel pass, ok.

3) Fake FG, ok.

4) Blinn specular, ok

5) Occlusion. I think it is better to connect directly a mib_amb_occlusion in a special channel and not use the ao_raw buffer of a mia_material because all *_x material haven't this output.

6) SSS, Ok but like the fake FG, the setup is complex because imagine the user put a physical sky after created the setup...

I think it is better to do this pass (fresnel, occlusion for example) with a render layer.
Good occlusion can be calculated in one time. I think people doesn't want calculate always the occlusion pass when they're setting the "master color pass".

It is my opinion.

So, all people of cgtalk, what do you prefere/think ?

For me "buffers" are here to separate the masterPass (diffuse, spec, reflec...), not to calculate extra channel. Why do you think ? Your workflow ?

crispy4004
12-07-2009, 09:05 PM
1) For the pure color, you connect directly your texture in a special channel. But why you don't use the diffuse_level buffer ?
If we connect the texture directly, the "final" diffuse doesn't match with the master diffuse (?).

I have found in the past that the sometimes the Diffuse_level buffer is not the same as the Color file. Think it has something to do with the reflection value. I'll test it out and get back to you on that. It may not be necessary after all.


5) Occlusion. I think it is better to connect directly a mib_amb_occlusion in a special channel and not use the ao_raw buffer of a mia_material because all *_x material haven't this output.

Agreed. Put the Fake FG output into the additional color slot instead of the Occlusion ambient.


6) SSS, Ok but like the fake FG, the setup is complex because imagine the user put a physical sky after created the setup...

You would have to write the following expression;
If Physical sky is exists and the Fake FG pass is active, the Pass SSS material is multiplied by a value of .2. Remember the Physical sun sky multiplier needs to be a value of .2 as well. Also the camera exposure needs a gain value of 1 instead of 0.2.


I think it is better to do this pass (fresnel, occlusion for example) with a render layer.
Good occlusion can be calculated in one time. I think people doesn't want calculate always the occlusion pass when they're setting the "master color pass".

At the same time, if you have a scene heavy with displacement maps, you don't want to have to recalculate the geometry at render time again for each new render layer. That is why I think it is beneficial to have the option to do it all at once. Also the fresnel is effected by bump maps (Look at it here (http://img406.imageshack.us/img406/4601/passbreakdown3.png)). Doing a Fresnel surface shader override in a new render layer would not take the bump into account.

Maybe you could add another check box:

Renderable []

If unchecked, it temporarily removes the connection to shaders and disables the special buffer. That way if you already calculated it and haven't changed the camera, you don't have to render it again. This could be very useful for the fake FG pass as well.

Sabotage3d
12-07-2009, 10:36 PM
Hello I have tested the script it is working perfect it saves a lot of time. I have a very complex scene I am using the production shaders and other stuff. But I have a small problem sometimes there is no beauty pass in the multichannel exr with p_megatk shader. The problem is that I have to prerender the alpha because the beauty is missing the shading pass has the beauty but there is not alpha is there a solution for this issue thanks. A shadow pass would be nice too. The new linear button in the script is not needed if you use simple exposure or photographic with gamma 2.2 . Thanks for the great script.

crispy4004
12-07-2009, 10:48 PM
. The new linear button in the script is not needed if you use simple exposure or photographic with gamma 2.2 . Thanks for the great script.
It is if you want to use correct linear workflow. The Photographic exposure with a gamma of 2.2 only takes you half way there, and that's only for the preview in Maya.


Anyways, here is an idea to help define which materials the SSS Pass gets applied to:
http://img690.imageshack.us/img690/4305/skinpass.jpg

Have the Attribute be added to all Mental Ray materials when you hit the "Create/Update" Button. Then with the materials you turn it on with, add the Pass SSS to their network the next time you hit "Create/Update".

crispy4004
12-07-2009, 11:16 PM
Here is what I meant with what happens to the Diffuse_Level:
http://img690.imageshack.us/img690/1157/colorf.png

There is probably some mathematical reason the Mia Material does this. My guess is to make the reflections stand out out even more.

The problem is you might not want the muted resulting color for compositing. Especially if you plan on altering the reflectivity gain in post, which would break this balance. That's why it would be nice to get a Pure Color Pass. You could always mimic what MR is doing to the color with the fresnel pass.

caro
12-08-2009, 02:02 AM
crispy4004, thanks so much for explaining this all too us!
I'm extremely busy these days and don't have much time to play with the script at this point but will do as soon as I start thinking of rendering my little project for sure :)

Just one quick question, can you actually output a diffuse pass (from mia_material_x_passes) that has no light information at all? Neither direct not indirect. If so, can you also output a pass that contains just light information on its own (if direct and indirect could be separated that would be just sweet). Some time ago I played with that (without the script though) and never could separate diffuse from light.

Anyway, just wanted to say thanks.

crispy4004
12-08-2009, 05:28 AM
Just one quick question, can you actually output a diffuse pass (from mia_material_x_passes) that has no light information at all? Neither direct not indirect. If so, can you also output a pass that contains just light information on its own (if direct and indirect could be separated that would be just sweet). Some time ago I played with that (without the script though) and never could separate diffuse from light.
Boy am I going to make your day.

Mental Ray Outputs (used with Deex's tool):

:thumbsup: Diffuse_Level = The basic Color.
:thumbsup: Diffuse_Raw = Direct lighting with no Color added from the texture.
:thumbsup: Indirect_Raw = Pure indirect light from Final Gather. No color Added.
Everything you asked for!

Maya's Pass Presets:

:curious: Diffuse = Color with shading included.
:sad: Direct Illumination = a sketchy version of MR's Diffuse_Raw, only very touchy and in many cases broken.
:argh: Indirect = Indirect light with color added.
Everything you didn't ask for.

As you can see, Autodesk's implementation, if it works, doesn't give the compositor much control at all, which begs the question, what's the point to using it? On the other hand Deex's tool gives you the keys that unlock the full potential of Mental Ray with render passes.

crispy4004
12-08-2009, 05:42 AM
You can use the following passes to rebuild a standard Mia_Material in compositing:


Diffuse_Level
Diffuse_Raw
Indirect_Raw
Specular_Result
Reflection_Result
Refraction_Result

At a basic level, that is all you need. It can be taken a few steps further however.

caro
12-08-2009, 03:13 PM
That didn't only make my day but about a month! :) Thanks!
Juts one more question, is there any way to open EXR with many passes in Photoshop? Was google-ing for it a bit but couldn't find anything really which is a bit surprising :/

crispy4004
12-08-2009, 06:56 PM
I have no idea. Honestly though Photoshop is not the best solution for compositing render passes, especially with half float image files ideal for linear workflow. For that matter, neither is After Effects. If you can, try using either Toxik, Nuke, or Fusion.

valler
12-08-2009, 07:04 PM
Here is what I meant with what happens to the Diffuse_Level:
http://img690.imageshack.us/img690/1157/colorf.png

There is probably some mathematical reason the Mia Material does this. My guess is to make the reflections stand out out even more.

The problem is you might not want the muted resulting color for compositing. Especially if you plan on altering the reflectivity gain in post, which would break this balance. That's why it would be nice to get a Pure Color Pass. You could always mimic what MR is doing to the color with the fresnel pass.

Quoted from the MR-Docs:
One of the most important features of the material is that it is automatically energy conserving. This means that it makes sure that diffuse + reflection + refraction <= 1, i.e. that no energy is , i.e. that no energy is magically created and the incoming light energy is properly distributed to the diffuse, reflection and refraction components in a way that maintains the first law of thermodynamics4.

In practice, this means for example that when adding more reflectivity, the energy must be taken from somewhere, and hence the diffuse level and the transparency will be automatically reduced accordingly. Similarly, when adding transparency, this will happen at the cost of the diffuse level.

The rules are as follows: * Transparency takes energy from Diffuse, i.e. at 100 transparency, there will be no diffuse at all. * Reflectivity takes energy from both Diffuse and Transparency, i.e. at 100 reflectivity there will neither be any diffuse nor any transparency. * Translucency is a type of transparency, and refr_trans_w defines the percentage of transparency vs. translucency.

Okay, and now I'm going to give the script a try, finally :D

EDIT: Back from testing.
The script creates the TK shaders and makes the right connections, but attributes that should be (un)ticked are not - i.e. "use constant" is unticked. "simple diffuse" is not.
Is this the normal behavior or am I missing something?
The rest of the setup does what I expected it to do. Didn't render anything yet.

Best regards,


Valler

bigbossfr
12-08-2009, 08:31 PM
Hi all,
I updated the script.

For the 1.3 version :
- fixing little bug
- add custom occlusion
- add facingRatio pass
- add perfectZdeph pass ! Yeah, If you have reflection or refraction in your material, the script will detect it automaticly and add correct Zdeph ! The perfectZdeph_p_z1 is the "masterZdeph" (it will control the near a far plane). Be careful, this pass increments a lot the time. Puppet, it is possible to controle the sample of the zpass ?

http://img190.imageshack.us/img190/5985/20091208222817.jpg (http://img190.imageshack.us/i/20091208222817.jpg/)

The beauty pass :
http://img21.imageshack.us/img21/6142/shading.jpg (http://img21.imageshack.us/i/shading.jpg/)

Occlusion pass :
http://img20.imageshack.us/img20/4786/occlu.jpg (http://img20.imageshack.us/i/occlu.jpg/)
http://img709.imageshack.us/img709/103/20091208221250.jpg (http://img709.imageshack.us/i/20091208221250.jpg/)

Facing pass :
http://img694.imageshack.us/img694/7536/facing.jpg (http://img694.imageshack.us/i/facing.jpg/)

PerfectZdeph pass :
http://img21.imageshack.us/img21/7572/zdeph.jpg (http://img21.imageshack.us/i/zdeph.jpg/)
http://img694.imageshack.us/img694/6025/20091208221553.jpg (http://img694.imageshack.us/i/20091208221553.jpg/)

Thank all.

Supadiri
12-09-2009, 10:42 AM
Really nice, thanks a lot.

Cya!

crispy4004
12-09-2009, 04:56 PM
Looks like a nice update! The perfect Zdepth Pass is a great idea! Unfortunately I'm a bit swamped with work right now so I won't get to test it out till later.

The one thing that concerns me though, the perfect zdepth pass. needs to be rendered as a vector buffer so it does not contain any anti-aliasing data. AA'd Zdepth causes problems with the DOF results when you apply it in post. Not sure if that is possible with the puppet shaders at the moment. For that matter we would also need a coverage pass as well.

Most of the time I just render Zdepth as a new layer at twice the resolution to avoid these complications.

bigbossfr
12-09-2009, 05:38 PM
I will do something to work with renderlayer when i have time...;) (like one pass for one renderlayer, for zdeph for example..).

Puppet, i have a problem with the shiny (reflection and refraction) zdeph.
0 = no shiny
0.1 = big shiny
10 = little shiny

It is possible to have a "linear range", like :
0 = no shiny
0.1 = little shiny
10 = big shiny
?

And if if possible to control the sample of the shiny ?

Thank !

karakistou
12-09-2009, 08:19 PM
Thank you again for the tool, bigboss.

About the linear workflow, I noticed something.

Before I used to put the gamma to 2.2 in an mia_exposure_simple node, and put the 0.455 gamma value in the Framebuffer (Render settings > Quality).
Then I had my preview rendering working nice, and when I wanted to batch, I put the gamma back to 1 in the mia_exposure_simple. Then the gamma from preview and batch rendering where corresponding.

Using this tool with the linear workflow activated, I noticed that the gamma value I set in the mia_exposure_simple is no longer taken by the passes from the p_MegaTK. It's nice because I don't have to change the gamma value before each batch rendering! But... is it normal?

Also, to have identical renders for the preview and the p_MekaTK passes, I noticed that I had to put a gamma value in the mia_exposure_simple of 1.8 (which is not really dramatic since this value can be used to give a more realistic film effect apparently). But the gamma nodes that the script create are using a value of 0.455 ( 1/2.2). So I don't understand why the value of 2.2 is not correct.

Cheers.

Puppet|
12-09-2009, 08:34 PM
Puppet, i have a problem with the shiny (reflection and refraction) zdeph?
Shiny... the code is from DGS_material :) But 0 disable bluring. May be I'll change it.
I'll think about samples for shiny in p_z...

bigbossfr
12-09-2009, 10:02 PM
Quoted from the MR-Docs:


Okay, and now I'm going to give the script a try, finally :D

EDIT: Back from testing.
The script creates the TK shaders and makes the right connections, but attributes that should be (un)ticked are not - i.e. "use constant" is unticked. "simple diffuse" is not.
Is this the normal behavior or am I missing something?
The rest of the setup does what I expected it to do. Didn't render anything yet.

Best regards,


Valler

Say me if you have the same bug with the 1.3 version. If if the bug i have correct on the 1.3, it will work now.

Thank you again for the tool, bigboss.

About the linear workflow, I noticed something.

Before I used to put the gamma to 2.2 in an mia_exposure_simple node, and put the 0.455 gamma value in the Framebuffer (Render settings > Quality).
Then I had my preview rendering working nice, and when I wanted to batch, I put the gamma back to 1 in the mia_exposure_simple. Then the gamma from preview and batch rendering where corresponding.

Using this tool with the linear workflow activated, I noticed that the gamma value I set in the mia_exposure_simple is no longer taken by the passes from the p_MegaTK. It's nice because I don't have to change the gamma value before each batch rendering! But... is it normal?

Also, to have identical renders for the preview and the p_MekaTK passes, I noticed that I had to put a gamma value in the mia_exposure_simple of 1.8 (which is not really dramatic since this value can be used to give a more realistic film effect apparently). But the gamma nodes that the script create are using a value of 0.455 ( 1/2.2). So I don't understand why the value of 2.2 is not correct.

Cheers.

Can you show images to see the problem please ?
Thank

Shiny... the code is from DGS_material :) But 0 disable bluring. May be I'll change it.
I'll think about samples for shiny in p_z...

Yeah :p ! Thank Pavel.

crispy4004
12-10-2009, 12:51 AM
Thank you again for the tool, bigboss.

About the linear workflow, I noticed something.

Before I used to put the gamma to 2.2 in an mia_exposure_simple node, and put the 0.455 gamma value in the Framebuffer (Render settings > Quality).
Then I had my preview rendering working nice, and when I wanted to batch, I put the gamma back to 1 in the mia_exposure_simple. Then the gamma from preview and batch rendering where corresponding.
The Gamma settings from the Mia_exposure_simple are completely independent of your results with the passes. Leave it at 2.2, otherwise you are not really taking advantage of gamma correction in your Maya preview render.

When you open up half-float passes in a compositing package, they are going to look darker than your render in Maya. That is until you do a 2.2 gamma correct node at the end and/or use a 2.2 gamma LUT preview.

karakistou
12-10-2009, 07:35 AM
Fusion don't have it by default, but I think Nuke is using a 2.2 gamma LUT preview, I am right? I usually don't have to correct the gamma when doing compositing in Nuke, but maybe I'm doing things in the wrong way.

Thanks about the information of the mia_exposure_simple. I completely forgot that the passes didn't use it. It makes me remember that one day, I had suprises seing my passes completely differents from my preview because I changed the gain value of my mia_exposure_simple....

By the way, I'm using 32bits float, not half float passes. Could you explain to me about the 1.8 value I put in my mia_exposure_simple, instead of a 2.2 gamma value??

bigboss: I'm gonna send you the images when I have time :)

Thank you again crispy.

crispy4004
12-10-2009, 08:27 AM
Fusion definitely has it too. Just click on the LUT button and change the gamma settings to 2.2. Click the LUT icon to toggle it. So does Toxik, drop an sRGB into the view display pass through. "Shift D" can be used to toggle it.


Also I don't know if it is different with 32bit EXRs. From what I understand, there is absolutely no reason to use 32bit EXRs though. At that point you're storing tons of unnecessary color information not visible to the human eye. 16-bit gives plenty of room to mess with the exposure without visible artifacts.

karakistou
12-10-2009, 08:50 AM
Yeah, I know that they have it, it's just that you have small tweakings to do. In Nuke I don't think so, just import you're 16/32 bits files and it appears with the nice luminosity afaik.

And I guess you're right about 32 bits, usually I use half float but I wanted to go wild while testing this tool.

Thanks again.

PS: for those interested, Nuke automatically chose a LUT depending on the file you read. This pdf can be useful http://www.swdfx.com/PDF/Nuke_Color_Management_Wright.pdf

valler
12-10-2009, 06:32 PM
Say me if you have the same bug with the 1.3 version. If if the bug i have correct on the 1.3, it will work now.
I tried V1.3 and had the same issue until I came behind it. If you don't choose at least one special channel from the list, it won't change the attributes. I wouldn't consider this as a bug, since setting up the network without any passes makes no sense. It's just been my fault :rolleyes:
Heres what I thought the problem was anyway:
http://img99.imageshack.us/img99/7605/captureos.th.jpg (http://img99.imageshack.us/img99/7605/captureos.jpg)
No special channel chosen on the left results in default TK settings on the right.

The script is a real life-saver, haha :D Thanks again!

bigbossfr
12-10-2009, 07:59 PM
I tried V1.3 and had the same issue until I came behind it. If you don't choose at least one special channel from the list, it won't change the attributes. I wouldn't consider this as a bug, since setting up the network without any passes makes no sense. It's just been my fault :rolleyes:
Heres what I thought the problem was anyway:
http://img99.imageshack.us/img99/7605/captureos.th.jpg (http://img99.imageshack.us/img99/7605/captureos.jpg)
No special channel chosen on the left results in default TK settings on the right.

The script is a real life-saver, haha :D Thanks again!

Oh, nice little bug. Ok, there is no sense to do this (create nothing ) but i will correct this. Thank you.

bigbossfr
12-10-2009, 11:38 PM
Update 1.4 :
- add new feature : renderLayer mode. When you activate this mode, you can create a pass (diffuse, spec, custom occlusion...) just on the actual renderLayer (for preview rendering, for add customPass like perfectZdeph..) ! Nice feature =)

http://img46.imageshack.us/img46/8472/200912110125362.jpg (http://img46.imageshack.us/i/200912110125362.jpg/)

Please test :p .

Pavel : a friend show me a little bug with the p_z shader :

http://img21.imageshack.us/img21/7572/zdeph.jpg


Speculars ! We must haven't speculars in the zdeph pass because speculars are white. And white is a value for a zdeph pass.
If you have time to correct this ;).

Thank.

crispy4004
12-12-2009, 04:38 AM
Awesome Deex! Keep it coming. Here is another test render using the Fake FG and Post SSS pass, this time using Toxik to Composite.

The cougar model is my own creation:
http://img690.imageshack.us/img690/1396/65125246.jpg

crispy4004
12-13-2009, 06:36 PM
So I was curious today and took at look at the source code for the Puppet shaders. I think modifying some of the code could quite possibly help us get past the limitations. Again I am not a programer and have no idea how to accomplish something like this, let alone compile it. That said, I don't think the changes would be terribly difficult to make. This is what we could do:

- Take the MegaTK.cpp and add an insane number of special passes, like 500.
- Take the MegaTK_Pass.cpp and add in the 500 or so special passes.
- Modify the the AE mel templates for both accordingly as well.
- Compile the code for the two nodes.

Then in your script make it so the user can push a "+" button to add a new pass. When a new pass is added turn on the corresponding Special Pass on the MegaTK shader and pass nodes. On an important note maybe we could compile the modified version of the Megatk, Megatk_pass, and and call it something else so it won't conflict with puppets system. Eventually we want a way to name these passes anything we want instead of "SpecialC#", but it is far more important we get everything to output correctly right now.


On an unrelated note another idea I have is to add a "Custom_Auxilery" pass. It would just add another one of your nodes that get attached to the MegaTK shader, just with no color inputs attached. The user could attach any shader or texture they want to it and have it render out as a pass.

As always that you for everything you have done. Also thank you a ton Pavel, none of this would be possible without you.

JohnPetrucci
12-14-2009, 04:03 PM
hey Big Boss, is this script supported by maya 2008?

edit: in the description of your script it says it supports maya 2008 so I'll give it a try

arkanoid
12-14-2009, 04:47 PM
Could be so useful, but I can't get this working.. Is there a precise procedure to create the network? I do like this:
1 create the scene normally with S&S and x_materials
2 load the script
3 activate the scecial channels
4 push Create Dummy
5 edit the p_MegaTK_pass
6 push Create/Update buffers

at this point the script create a p_MegaTK attached to my shaders one at the time (one x push) with result linked to c_color and message to the orginalShader. But no connections are made for the special channels I choose in the script UI.
And also when I connect the channels by hand my .exr layers look very strange. Viewport rendering contrarily is fine.
I think I'm missing something important. :argh:

Sabotage3d
12-14-2009, 05:05 PM
I cannot understand why to use the linear button for the linear workflow if you render without it and select sRGB in nuke it will be correct it looks correct too. The only problem is that I had before is that sometimes the beauty pass is empty and there is no alpha.

crispy4004
12-14-2009, 05:37 PM
I cannot understand why to use the linear button for the linear workflow if you render without it and select sRGB in nuke it will be correct it looks correct too. The only problem is that I had before is that sometimes the beauty pass is empty and there is no alpha.
From what I understand by what people have said in this thread, Nuke automatically sets up a LUT (gamma = 2.2, gain = 1) on your render view when you bring in a half float EXR. Again I don't use Nuke, so I could be wrong.

What checking that Linear workflow box does, in less technical terms, is ensure all of your passes, and the result of the added passes have a full exposure range. It means you wont get any light or darks clipping if you adjust the gain value on each pass in compositing. Without checking the box, only certain passes will have that full range. Use it, you want it on.

If you just render out plan 8-bit tiff passes for example without considering any of this, the result wont look as nice and you'll have less wiggle room in compositing to tweak things.

Sabotage3d
12-14-2009, 06:08 PM
I am using 16 bit exrs in nuke I select for the viewport linear and for the source sRGB. Also if you render in maya a frame for preview it looks correct again with linear button and maya preview it looks strange.

crispy4004
12-14-2009, 06:26 PM
Attach a simple exposure node to the Camera with a Gain Value of 1 and Gamma value of 2.2. How your Maya Render looks is really not important though.

bigbossfr
12-14-2009, 06:54 PM
hey Big Boss, is this script supported by maya 2008?

edit: in the description of your script it says it supports maya 2008 so I'll give it a try

Hey,
There is shaders_p v.3.3 beta 11 for Maya 2008SP1 (http://www.puppet.tfdv.com/download/shaders_p_e.shtml), so, it is working.

Could be so useful, but I can't get this working.. Is there a precise procedure to create the network? I do like this:
1 create the scene normally with S&S and x_materials
2 load the script
3 activate the scecial channels
4 push Create Dummy
5 edit the p_MegaTK_pass
6 push Create/Update buffers

at this point the script create a p_MegaTK attached to my shaders one at the time (one x push) with result linked to c_color and message to the orginalShader. But no connections are made for the special channels I choose in the script UI.
And also when I connect the channels by hand my .exr layers look very strange. Viewport rendering contrarily is fine.
I think I'm missing something important. :argh:

1) Create the scene normally with *_x shaders
2) load the script
3) Activate and choose (like diffuse_result, spec_result...) your channels
4) Click on create/update
5) Create dummy, and edit
6) Render

The update button is for news *_x shaders added in the scene, not for update or add news specials channels. If you want add or update news channels, you must delete and recreate.

For linear workflow, there is many thread here.
If you want work in linear, just check the box, add a lens shader on your camera with a 2.2 gamma, and set your primary buffer to 32 bits.
After, when you have finish tweaking your render in the renderview, kill the lens shader and render your final image (in batch).

Open your image in linear in compositing.

ytsejam1976
12-14-2009, 09:07 PM
Hey,

For linear workflow, there is many thread here.
If you want work in linear, just check the box, add a lens shader on your camera with a 2.2 gamma, and set your primary buffer to 32 bits.
After, when you have finish tweaking your render in the renderview, kill the lens shader and render your final image (in batch).

Open your image in linear in compositing.

But this is only for a exposure simple. isn't it?

JohnPetrucci
12-15-2009, 03:41 PM
Hey,
There is shaders_p v.3.3 beta 11 for Maya 2008SP1 (http://www.puppet.tfdv.com/download/shaders_p_e.shtml), so, it is working.



Im running into a problem here.. I have the script loaded and everything.. as soon as I hit
create/Update Buffers, it shows me an error in the command line:

# Error: Unknown object type: mia_material_x_passes

so that's why I asked if this script works in maya 2008.. since it doesnt' come with the new shader mia_material_ x_passes (only for maya 2009 and so on)

am I doing something wrong ?

crispy4004
12-15-2009, 08:09 PM
I hate to say it, but I think you are out of luck. You have other options though:

1. Use Ironhalo's ctrl_buffer-creator-for-material_x (http://www.creativecrash.com/maya/downloads/scripts-plugins/rendering/mental-ray/c/ctrl_buffer-creator-for-material_x--2) script with the ctrl_buffer that does the same thing, just with less passes and features. On the bright side you get 15 passes instead of 10.

2. Use the Puppet shaders. It is a great system but the passes are not quite as flexible as what you get with the Mia_Material outputs.

3. If you are lucky enough to be on a Mac with 2008, you have a killer solution with the Nexus shaders. It has way too many problems on PC to use properly. Not as fully featured as it could be, but it is easily the most artist friendly solution.

In fact, my whole workflow is based on how Luma Pictures handles pass rendering and compositing with their Nexus Plugin, only using Mia_materials, Fake FG, and linear workflow. A lot of what I suggested to Deex, like having a Custom_SSS Pass and a Custom_Blinn specular pass follows their process. Their approach to skin is so much faster and artist friendly than the texturing balance act you have to play with using the miSSS shader by itself. I can't help but feel sorry for 98% of character artists who are not aware of this method.

arkanoid
12-15-2009, 10:47 PM
Thanks Bigboss for the guidelines.
I'm still fighting since it doesn't seam my special channels are there. They simply are all black except for the shading pass. The connections between the shaders and megaTKs actually don't appear. But I'll keep it trying.
About gamma on the shading pass: simply doing the tweaks with gamma 2.2 on the simple_exposure (main buffer gamma 1) doesn't seam to work when I open in Fusion (or Photoshop with PROexr, is the same). The 2.2 LUT makes the image far too bright.
BUT, If I go further I can get a very similar result applying Gain at -2.3 (in the LUT) which don't get much sense to me... :curious:
Ah, my sky background doesn't show up in render too... :shrug:
I can post some images tomorrow if it could help understanding..

@crispy4004 I don't understand the "work with gain 1 on mia_exposure_simple". can you detail?

arkanoid
12-16-2009, 04:06 PM
Great! now the script is working! It was only upgrading p_shaders to 3.3b11... :twisted:
About the gamma I'm not still there. But I'm slowly getting at it..
Not sure if viewport render and batch are differing and for what. Which one is affected by lens shader and wich by framebuffer gamma value?
Just want start using this gem!!! :scream:

bigbossfr
12-16-2009, 07:57 PM
Im running into a problem here.. I have the script loaded and everything.. as soon as I hit
create/Update Buffers, it shows me an error in the command line:

# Error: Unknown object type: mia_material_x_passes

so that's why I asked if this script works in maya 2008.. since it doesnt' come with the new shader mia_material_ x_passes (only for maya 2009 and so on)

am I doing something wrong ?

Thank, i will correct this problem :thumbsup:

crispy4004 (http://forums.cgsociety.org/member.php?u=262234) : i will add spec blinn pass and check SSS pass.
For the fake FG, the problem is the user must have a environement and not create the environement after created the pass.
When you have time, can you post image with real FG and fake FG to compare ?
Thank.

crispy4004
12-16-2009, 08:21 PM
Great! now the script is working! It was only upgrading p_shaders to 3.3b11... :twisted:
About the gamma I'm not still there. But I'm slowly getting at it..
Not sure if viewport render and batch are differing and for what. Which one is affected by lens shader and wich by framebuffer gamma value?
Just want start using this gem!!! :scream:

Your Maya preview render is effected by the lens shader, nothing else is. You can think of any lens shader as post effect applied to the preview. Your passes get saved out without the lens contribution. You want it this way though because it ensures you have the full exposure range in compositing. Just do the gamma correction instead in post.

The only times I ever really care what the Maya render looks like is when i am placing my lights, adjusting bump maps, or fixing the SSS values for my single subsurface pass. Maybe a little adjusting with the reflectivity/specular values as well, though all I need is a ballpark estimate that I can tweak to my liking in compositing. But like I said, most of the time I just hit the render button and open up Toxik or Fusion to do all the dirty work.

crispy4004
12-16-2009, 08:38 PM
crispy4004 (http://forums.cgsociety.org/member.php?u=262234) : i will add spec blinn pass and check SSS pass.
For the fake FG, the problem is the user must have a environement and not create the environement after created the pass.
When you have time, can you post image with real FG and fake FG to compare ?
Thank.
Hmm, I had a feeling this would be an issue. Perhaps there could be a button called something like:

"Create Composite Ready Phyiscal Sun & Sky" - Makes the sky with the multiplier set to .2 and the Lens shader gain set to 1. Only after that is in the scene, make the Fake FG custom pass available for selection and add a .2 multiplier after the Post SSS pass.


I'll get on doing a comparison with the Final Gather.

JohnPetrucci
12-16-2009, 09:13 PM
Thank, i will correct this problem :thumbsup:


I think that for the maya 2008 script, you could edit it and remove in the line 491 (or close.. I don't remember well which) where it lists all the materials, just delete the ones that are not included in maya 2008 e.g mia_material_x_passes, and instead of calling iother materials e.g car_paint_phen_x just leave it like car_paint_phen.
I did a test yesterday after I posted the problem, edited the script and seemed to work somehow.. except that when I did a test, some of the object of that test weren't included in the passes.

it would be a good idea to post what passes you can get from different shaders, like flake pass it's only for car paint, but other ones are not so obvious.


edit: ok I did another test and it works.

is there a way to name automatically the passes? instead of just the normal specialC4?
for example if I created a raw_diffuse, the pass name would be raw_diffuse?

bigbossfr
12-16-2009, 09:29 PM
Update 1.5 :
- fix a bug with Maya version <= to 2008
- add news custom pass : custom blinn pass (for specular) and shadow pass ! (there isn't shadow pass for *_x shaders, no there is;) ).

:thumbsup:

I haven't Maya <= 2008 but normally it is working.
If you have problem, say me.

Thank.

crispy4004
12-16-2009, 10:35 PM
Here is an example of the Final Gather difference. Keep in mind my AO samples are very low and the real FG example will flicker unless the quality is lowered:

http://img38.imageshack.us/img38/7025/finalgather.jpg
The Fake FG is what was I used on the render from the last page. The end results look good enough to me, especially considering there is no FG flickering concerns.

Here is probably the better comparison from Harry Bardak's site (http://www.harrybardak.co.uk/TDlove2006.htm).


Fake Final Gather:
http://img194.imageshack.us/img194/493/aocontributionrender003.jpg
Settings :
AA 0/2 Treshold 0,047 Gauss 3/3
Amb_Occlusion sample : 64
Rendering 0:06:12

Real Final Gather:
http://img691.imageshack.us/img691/5764/fgcontributionrender003.jpg
Settings :
AA 0/2 threshold 0,047 Gauss 3/3
FG 128 accuracy min 1 max 10 Presampling 3
Falloff min 1 max 10.
FG time : 0:02:37 Rendering time : 0:03:58
Total time : 0:06:35


The front tire shows the biggest difference between the two. Again though, those FG settings will flicker, which will be noticeable in animations. That is far more likely to catch the audiences attention than the lack of a few light bounces in my opinion.

arkanoid
12-17-2009, 02:29 PM
Your Maya preview render is effected by the lens shader, nothing else is. You can think of any lens shader as post effect applied to the preview. Your passes get saved out without the lens contribution. You want it this way though because it ensures you have the full exposure range in compositing. Just do the gamma correction instead in post.

The only times I ever really care what the Maya render looks like is when i am placing my lights, adjusting bump maps, or fixing the SSS values for my single subsurface pass. Maybe a little adjusting with the reflectivity/specular values as well, though all I need is a ballpark estimate that I can tweak to my liking in compositing. But like I said, most of the time I just hit the render button and open up Toxik or Fusion to do all the dirty work.

Thanks for kind explanation. I'm hard-testing all this. I'll take your words as a hint to expand my color management knowledge. :arteest:
Thanks to bigbossfr for hard work! Don't stop!
My wish for this script is a unified UI with only relevant p_shaders attributes and a little more flexibility in modifying script settings (without delete/recreate network) in every possible combination. That could be the best reasons for mayan peaople to use MASSIVELY your script. :thumbsup:

arkanoid
12-19-2009, 04:01 PM
I have this problem since I use the script: the Attribute Editor remain empty and I have to switch 2-3 times between tabs before I can see the attributes.
The problem is for attached and floating AE.

http://s4.postimage.org/fv7_9.jpg (http://www.postimage.org/image.php?v=aVfv7_9)

I don't know if its a p_shader related problem..

crispy4004
12-19-2009, 06:10 PM
That is strange. You may need to re-install Maya. I really doubt it is a problem with Deex's tool or Puppet's tool, my guess it is just Maya acting goofy after installing some new plugins. One fix might be removing the Maya.env from the documents -> Maya -> (version) folder and letting Maya create a new one. I had a similar problem with the hyper-shade some time ago and this was the fix.

bigbossfr
12-19-2009, 06:45 PM
I have this problem since I use the script: the Attribute Editor remain empty and I have to switch 2-3 times between tabs before I can see the attributes.
The problem is for attached and floating AE.

http://s4.postimage.org/fv7_9.jpg (http://www.postimage.org/image.php?v=aVfv7_9)

I don't know if its a p_shader related problem..

Hi,
My script create automatic connection between shader. So, i think it is an another problem. My tool is a script, not a plugin. ;)

crispy4004 (http://forums.cgsociety.org/member.php?u=262234) : than for the fake SSS.
The problem is if the user created the environement after create the pass, the Fake SSS pass will be broke because we must have a connection between the shader and the environement.
Create the pass when there is a environement, it is good, but if the user delete the environement and create a another...

crispy4004
12-19-2009, 08:11 PM
I'm thinking up a solution, I'll show you soon.

crispy4004
12-19-2009, 09:03 PM
So here is my suggestion to fix the problem. This is just my mock interface, you may have something different in mind:

http://img192.imageshack.us/img192/3913/deextooluisuggestion.jpg

Composite Ready Physical Sun & Sky - create with multiplier = .2, and gain = 1 on simple exposure.

Safetely Remove - Remove all Physical Sun & Sky elements from the scene. Disable the next two check boxes.

Enable Fake Final Gather Custom_Indirect Pass - Only selectable if Composite Ready Physical Sun & Sky is created. Otherwise grey it out like you did with the special buffers when Render layer Material is active.

Sync Custom_SSS with Sun & Sky Enviornment - Only selectable if Composite Ready Physical Sun & Sky is created. If active, on the next buffer update add a .2 multiplier to the Custom_SSS pass.



Also I couldn't help myself, I through in the Matte pass check mark. I know, it is not possible until we can get more than 10 passes, but I'm just dreaming for the the future.

arkanoid
12-21-2009, 09:31 AM
My script create automatic connection between shader. So, i think it is an another problem. My tool is a script, not a plugin.

You're right but maybe someone encountered this yet. that's because I wrote.

That is strange. You may need to re-install Maya. I really doubt it is a problem with Deex's tool or Puppet's tool, my guess it is just Maya acting goofy after installing some new plugins. One fix might be removing the Maya.env from the documents -> Maya -> (version) folder and letting Maya create a new one. I had a similar problem with the hyper-shade some time ago and this was the fix.

I experience this only with p_shaders (not only p_MegaTK) so it's probably a p_shader problem.
My Maya env is ok, I checked out. I Deleted prefs with no results too.
Could be a p_shaders AE templates issue.
I'll ask in a p_shader thread, thanks.

crispy4004
12-22-2009, 07:10 PM
Anyone willing to test out this other solution to outputting passes?
http://duikerresearch.com/mental-ray/#Miscellaneous

I would do it myself, but I'm away from my computer with Maya for about a week. I want to see first if it works with Maya 2008, 2009, and 2010. It is not compiled for any of them, but I think it is still worth a shot to see if the 8.5 version works with later versions of Maya. Apparently it supports Mental Ray 3.7 and 64-bit OS's as well, so there is chance.

If this solution works and allows for an unlimited amount passes with no render time increase bug, we are in serious luck. Apparently it also has exr support as well, but I have no idea if it allows for exr compression.

mercuito
12-22-2009, 08:19 PM
If you guys are all so desperate for this kinda thing, I could whip you up a quick and easy buffer writer/output shader. They are incredibly easy to make, espeically if you want it to be array based (so there's no limit on the number of passes).

However I think there's a lot of flaws with technique your doing, seems to be a whole lot of work arounds, but I can understand you can only do so much without writing shaders.

But anyway, if you need something like that, let me know. Puppets shaders defiantly weren't made for this, so there's a lot of irrelevant stuff in there you wont need.

crispy4004
12-22-2009, 09:48 PM
That would be absolutely amazing mercuito!

Would it be difficult to toss in the EXR compression tools from puppets shaders and possibly a Mac compiled version as well? Again though, anything would be incredible.

mercuito
12-22-2009, 10:05 PM
Wont be able to help to after the new year, and i'll only do something very simple so as not to compete with my own product haha, but i'll provide the source code, then you guys can do with it what you like. Exr compression, v. easy.

crispy4004
12-23-2009, 12:46 AM
Wont be able to help to after the new year, and i'll only do something very simple so as not to compete with my own product haha, but i'll provide the source code, then you guys can do with it what you like. Exr compression, v. easy.
Completely understandable. A little frame buffer script like this would more or less be a temporary solution to the buffers bug until Autodesk finally realizes how big the mistake they made is. At this point I'm beginning to wonder if Autodesk will ever fix it.

Either way, I don't think anything being done here could compete with your Core Render pass system. After all this is just a jimmy-rigged fix, not a streamlined and fully-fuctional solution like your own. It's really a work of art.

crispy4004
12-26-2009, 07:36 AM
So I potentially found a faster way to render the Indirect light pass with better quality. The only downside is right now it requires you to use a pre-blurred HDRI (you could always bake a Phyisical Sun & sky HDRI) Read About it Here (http://www.harrybardak.co.uk/diff_conv.htm). A video example in XSI here (http://www.immerg.com/iblshxsi.html). The results are apparently as good, if not better than the AO environment sampling I was using, and can be calculated in real time. That's right, real time! I was reading on AWN that Avatar uses the same method, but probably on a more advanced level.

I still need to test it but I just want to mention the idea of the new pass now, the Spherical Harmonics Indirect Pass.


All you would need is a Mib Ambient Occlusion Node with the sampling set to 1 (environment sampling mode) and the spread to 0.01 going into a buffer. That is in practice at least, I'll try it when I get home in a few days.


There is one more downfall however. All the reflections would be of the blurred HDRI. Maybe there is a way to use the Mib_env_blur to get right results and possibly a way for it to only effect the Mib Ambient Occlusion (hopefully without increasing render time). I'll have to toy around with it. If I can find a solution all it would take is a couple small tweaks to older setup I sent you.


Merry Christmas everyone by the way!

crispy4004
12-26-2009, 08:03 AM
Forgot, there is also the possibility of setting this up the occlusion node through an ambient light. I think that worked for me in the past. If the Indirect_Raw picks takes in the ambient light result and not the diffuse, it may not even been necessary to do it through a special pass.

crispy4004
12-29-2009, 07:39 PM
So here is what I was talking about in practice. This is just a straight Mental Ray Render:
http://img51.imageshack.us/img51/1194/newfakefgtest.jpg
(New Indirect calculation method x ambient occlusion)

The difference here is that Mental ray only has to cast a single ray, meaning calculating the indirect light takes almost no extra time to compute! The way I proposed earlier requires a bunch of rays cast to increase the quality, which for complex models and scenes could slow down the render. This is both faster, gives better results, and requires almost no tweaking!

All that is of course without normal ambient occlusion in there, which takes extra rays. It's needed to get the best results.

There are still some downfalls however. First, I blurred the environment through Mi_env_blur instead of bluring in HDR shop. Adds another 10 seconds or so to the render time for every frame on my slow computer. That's not really much of a problem in my opinion, it beats having to bake out the environment every time you change it.

The big problem is I currently have to plug the blurred environment in to the shader SG node, which means any reflections are also blurred. What we need is an Ambient Occlusion shader (in mode 1) that lets you plug in an environment independent of the real environment. I'll try to find another work around, but if anyone here thinks they can create something like that, we'll be in business.

crispy4004
01-02-2010, 04:51 AM
Nevermind, I figured it out. I'll send you it tomorrow Deex. Think you are going to be really happy with this, it should be far easier for you to program in and works with both HDRI and Physical Sun & Sky.

With the faster render times, I thought it would nice get some color bleed in there. Color bleeding adds about 1 min to the render time for me, so it's a little taxing, but I think worth it. It was really easy to do, but unfortunately the AO has to be done through the Mia_Shader. On the bright side, it no longer needs a custom pass, the Post_AO_Indirect will now write all the indirect information.

Again, no FG, no GI, just AO.
http://img515.imageshack.us/img515/8190/colorbleed.jpg
Another thing I forgot to mention, this works lightning fast with IPR. Color bleeding doesn't show up there, but all the indirect lighting does. Going to make lighting scenes soo much easier.

jasonhuang1115
01-02-2010, 03:02 PM
Hi, Chris,

Thank you for bringing up the "Spherical Harmonics" technique. I saw the XSI demo video a while back and haven't spent time to try it in Maya. From what I read, "Spherical Harmonics" has been widely used in game engine as well as in post 2.5D relighting because of its fast feedback and result that is very close to conventional GI-based solution in terms of indirect lighting contribution.

Is it possible to have a sneak peek of your shading network? I was wondering if this technique can be applied on a global basis instead of a per-shader basis?

Also, how the color-bleeding is achieved if FG is not used in this technique? If using this technique can generate indirect lighting pass (without messing up the reflection) faster, flicker-free, and with color-bleeding, it would be awesome!!

Jason

crispy4004
01-02-2010, 06:40 PM
You are right, the spherical harmonics technique has been used in games for some time now. It's also starting to find it's way into movies because you can get pretty damn close results in a fraction of the time. The network is nothing complicated to look at. It's just a Ambient occlusion texture feeding into a mib_ev_blur feeding into the Mia material. That's it. All the tricks get applied inside the nodes.

As far as color bleeding, it's simple. It is a mode in the AO slot of the Mia material that was added in MR 3.6. It's a bit of a brute-force method of calculating the color bleed, not optimized in the way FG/GI handles it, but I'm finding you really don't need as high of samples. For instance the picture above only casts 16 rays. The low sampling may be noticeable in a few parts (inside the mouth), but not nearly as bad as AO with no color bleed.

I tried earlier applying the technique on a global basis through using an ambient light. It's a no go, you get artifacts and incorrect results.

If using this technique can generate indirect lighting pass (without messing up the reflection) faster, flicker-free, and with color-bleeding, it would be awesome!!

Yep, it's doing all that, but expect render times to take a hit with color bleeding. True FG/GI does color bleeding faster, but again that can flicker.

crispy4004
01-02-2010, 08:44 PM
Bummer, i just found out the Mia_Env_blur wasn't working correctly with the AO environment sampling. I need a way to blur the result of the ambient occlusion in mode 1. Either that or we will need an AO shader that lets you plug in an environment and blur it.

Anyone have any ideas?

mercuito
01-02-2010, 09:01 PM
Hold up a minute... Unless I'm missing something, your not using spherical harmonics at all, just occlusion sampling blurred enviroments. SH requires a hdr images that gets prefiltered and converted into a series of 9 rgb coefficients. There's no way to use SH in maya without going the way of a custom shader.

And I'd advise staying clear of occlusion coloud bleed. For every occlusion ray it has to compute the shading at the intersection to get the bleed colour. This is very inefficient and probably not good for memory usage, using on a global scale with a large scene would almost be unthinkable.

mercuito
01-02-2010, 09:07 PM
crispy - just looked at your posts about the xsi example. Sorry to say this isn't SH, you might wanna correct all those claims :)

crispy4004
01-02-2010, 09:27 PM
Yeah, you're right. I've just been trying to do a sample blur, not compute the Spherical Harmonics diffuse convolution, which is really what I should be doing, but it's clearly impossible with Maya's standard shaders.

crispy4004
01-04-2010, 11:20 PM
So I'm considering making a switch to real Final Gather after all.

Been messing around with Smart IBL (http://www.hdrlabs.com/sibl/index.html) a little bit today, and so far I'm really liking the results. I haven't testing it nearly enough, but from what I have done, it's hiding the flicker very well.

Don't know how this solution passed me by.

jasonhuang1115
01-05-2010, 12:50 AM
Chris,

Would you elaborate how using sIBL will reduce flickering? Wouldn't FG be used when using sIBL and hence cause flickering still?

As my experience with sIBL, it essentially separates the diffuse and specular lighting contribution from a pre-convoluted HDRI and a standard-res HDRI, and an even higher-res JPEG as background. One can achieve the same set up using a mip_rayswitch and mia_envblur which is also optimized for MIA shader.

Jason

crispy4004
01-05-2010, 05:39 AM
Well, I'm still testing this stuff myself, but I'll give the explanation a shot:


When using a lower resolution blurred HDRI, there is less variation to sample from. With each frame the new FG point has a greater chance of sampling a similar color value to the last. For example, say you had a forrest HDRI at a 4k resolution with lots of light dark information. If an FG point gets it's eniviornment color contribution from the edge of a dark tree, you'll either get a dark brown or light blue color from the sky. That will varry from frame to frame which equals flicker. But with a lower resolution blurred envionrment, the majority of times it will return the hybrid brown-blue color.
The alternative final gather methods are as follows (not including freezing FG maps, which are great for architectural fly-throughs, but not animation): 1.Crank up the samples to an extreme amount and pray they blend together to get that "brown-blue" mix without many artifacts. This is absolutely in-efficient.
2.Increase the interpolation (how much the sampled colors blend) and decrease the number of samples. It can get rid of a lot of flicker, but at a big sacrifice in quality.
Now of course this is not going to work in every situation, but if your scene relies heavily on lighting from the environment, this seems like a great option. As far as mip_rayswitch, I use it with the sIBL by a preset in the script. Seems to be the best setup option for the scene. As for Mia_env_blur is concerned, I've been using it quite a bit to try to fake FG earlier in the thread, but it is far from efficient and the algorithm give unsatisfactory results compared to say calculating the proper diffuse convolution a la spherical harmonics.

crispy4004
01-05-2010, 07:14 AM
Both SH and sIBL's solutions, while completely different in their methods, use a very similar concept; reducing the environment to a simpler representation for faster, more efficient results. I can see the strengths and weakness of both approaches.

Spherical Harmonics are super-fast, never flicker, and don't care what-so-ever about how much geometry is in the scene. I imagine it would be awesome with things like leaves and hair. But again, it takes some prep work, either using the diffuse convolution method, or the old FakeGI script. Absolutely needs an occlusion pass to look its best.

Smart IBL, while not quite as fast and can still contain some degree of flicker, takes into account secondary bounces, doesn't require AO, and just, well, looks nicer. I imagine GI is a possibility as well. It would normally take more setup than SH, but the awesome scripts automate everything for you.



The biggest downfall of each right now in terms of functionality with Maya is that it requires a little work outside the application. It's not all that much though. I think in the future I'll be using sIBL as my main source of indirect light, and possibly the diffuse convolution method in special cases, and try to match the two in composting if both are required in the same shot.

Jaylee81
01-05-2010, 05:19 PM
Does this work directly with p_HairTK instead of p_MegaTK assigned to hair geometry? I need to separate renders with Shave hair and get control of shadows cast onto my character, and is the setup the same for hair scenes?
Rendering with MR and Maya 2009 isn't working as good as it should, thank you so much for helping fellow artists in need.

crispy4004
01-05-2010, 06:20 PM
No, but you could easily just go through puppets system for hair.

What I plan on doing is using the standard p_shaders "diffuse" and "specular" outputs for hair, and use the diffuse convolution method for indirect lighting attached to a special channel. That way you can avoid Final Gather with hair. Also possibly a p_hair_mapping -> ramp.U (or V) for fake occlusion in another special channel. Aside from that everything else through the Mia_shader, using DeexFastBufferOutput, and indirect lighting with Smart IBL.

Of course though, we are still currently limited by the number of custom passes possible through the puppet shaders. Hopefully Mercuito will be able to help us with that.

Jaylee81
01-06-2010, 11:32 AM
No, but you could easily just go through puppets system for hair.

Ok, then I'll hopefully get p_MegaTK_Pass working right soon. At the moment it's not outputting the separate images as it's supposed to do, I just get one image from batch render. And my hair doesn't cast shadows onto the geometry.


What I plan on doing is using the standard p_shaders "diffuse" and "specular" outputs for hair, and use the diffuse convolution method for indirect lighting attached to a special channel. That way you can avoid Final Gather with hair. Also possibly a p_hair_mapping -> ramp.U (or V) for fake occlusion in another special channel. Aside from that everything else through the Mia_shader, using DeexFastBufferOutput, and indirect lighting with Smart IBL.

Of course though, we are still currently limited by the number of custom passes possible through the puppet shaders. Hopefully Mercio will be able to help us with that.


Good ideas you've got going there, short cuts (fake occl) and ways to speed things up and avoid possible problems (GI flicker) is always welcome. Looking forward to see it when you get time to do it, keep up the good work!

Cheers!

MasonDoran
01-06-2010, 08:34 PM
I noticed a bug with the puppet shaders when Batch rendering with Render layers. Not all of the special passes render out if several render layers with different shader overrides are rendered. This seems to be because the puppet shaders only saves the file after all of the render layers have been rendered. This issue does not occur if you batch render with only 1 render layer.

I havent tested, but i suspect the work around for this is making sure the puppet shader renders last (top of the render layer stack).


The more I get used to this workflow, i am deciding to completely move to building my shaders using the mega shader, simply because its less work at the end of the pipeline, and if its already setup....custom passes are a piece of cake to attach to an existing shader network.

I am already doing all of my compositing in Nuke with openExr....so it just makes sense.

I love that request to be able to customize the names of the different channels ...small but needed feature of the shaders.

crispy4004
01-07-2010, 03:19 AM
The more I get used to this workflow, i am deciding to completely move to building my shaders using the mega shader, simply because its less work at the end of the pipeline, and if its already setup....custom passes are a piece of cake to attach to an existing shader network.
I would use MegaTK as my primary shader, however it handles diffuse and indirect like Maya's pass system does. I prefer the way Mental Ray handles it because it gives the compositor more control by allowing for RAW passes. Not to mention there are some benefits to using the Mia shader for its arch vis properties. Also the 10 auxiliary passes are a bit of a crutch, but that is also true for the Deex tool as it works through the puppet shaders. Makes things like many matte passes currently impossible through both systems.

Now I'm not trying to say saying Puppets shaders are bad, from from it. They are excellent at specific tasks, but their usefulness depends on how you work and what you need them to do for you at the compositing stage.

3DRenderer
01-10-2010, 08:12 AM
Wow this is kinda weird how I just happened to be reading this and at the same just recently (a few months ago) started using sIBL and just now discovering these render pass setups which for me so far, is pretty difficult to grasp. I cant even render any passes out cause when I hit render, it renders my normal mental ray images and no puppet/deex passes.

Anyway, as for sIBL, I HIGHLY recommend going to Christian Blochs website that explains very well in depth about how to use this time effienct-fantastic results method. And his book that has alot of useful info. http://www.hdrlabs.com/sibl/index.html

Im still in the learning process but so far the results are pretty damn nice. Just really dontt know, but really wanna know, on how to make the render passes and overrides the way its suppose to be done.

bigbossfr
01-10-2010, 08:17 AM
Hi all,
Happy new year !
I writting a mia_material (and other _x material in the futur) with all output based on the Pavel shader.
I don't know C++ but with the source of p_shaders (big thank Pavel), i did something.

Currently, i managed to write a surface shader with 54 buffers :buttrock:.

3DRenderer
01-10-2010, 06:47 PM
I know this a very noobish question, but for whatever reason I cannot render anything out using these functions. I dont know why. I have downloaded the example sences and followed it up with the tutorial provided but when you say just hit render and everything should appear in the dir. that was made in C:/ test_name, there is nothing. Just a single frame is rendered in my images dir. Im confused and not sure what I am doing wrong.

Thanks

crispy4004
01-10-2010, 07:17 PM
Awesome news Deex! Great to know you've had success!

Definitely take a look at the Named_famebuffer (http://forums.cgsociety.org/showpost.php?p=6289720&postcount=25) I posted as well. Also, here is a more basic shader (http://www.wiki.render3d.de/doku.php?id=renderwiki:shaderlib:mr:framebuffer) that does a similar function, but lacks the naming passes output.

http://img514.imageshack.us/img514/9979/fetchphpcachecachemedia.jpg

We really should try to implement a system with an array like this. That way we can literally have unlimited passes anything can plug into. Should save you time too, instead of having to re-write all the Mental ray shaders with pass support.


I think the best way to go about doing it is to use the Named_framebuffer to create the buffers, and modify the Megatk_pass to incorporate it through its output system. I don't know C++ either, but all the code is already written for us with the named_framebuffer_put.cpp and megatk_pass.cpp. It's just a matter of putting the pieces together.


The modified MegaTK_pass would look something like this:

Output Settings - keep the same
Mental Ray Standard channels - keep the same
Output passes - Add in a "Output Custom Buffers" check box.


Then the Deex's fast buffer output to be changed to go through the Named_framebuffers instead of Megatk Materals. That is just my take though, what does everyone think?

bigbossfr
01-10-2010, 09:00 PM
Currently, i have a problem : when i have > 44 buffers and a texture on a slot (like noise or other), my Maya crash. :banghead:
My problem is here with the source code !
http://forum.mentalimages.com/showthread.php?p=25875#post25875
If you compile the shader and connect a texture in the render slot : crash. It is because there is 54 buffers.
If you delete in the code all line where there is > 44 buffer, and connect a texture in the render slot, it doesn't crash. :curious:

crispy4004 :
My "strategy" is :
- create i shader with 54 buffers (it is all the ouputs of all *_x shaders)
http://img511.imageshack.us/img511/9117/20100110224102.jpg (http://img511.imageshack.us/i/20100110224102.jpg/) http://img511.imageshack.us/img511/20100110224102.jpg/1/w440.png (http://g.imageshack.us/img511/20100110224102.jpg/1/)

- Create a Phenomena for each *_x shader with my shader (and gamma and other).

- create the geometryPass (like p_MegaTk_pass) with output for *_x shader :
http://img94.imageshack.us/img94/917/20100110230205.jpg (http://img94.imageshack.us/i/20100110230205.jpg/) http://img94.imageshack.us/img94/20100110230205.jpg/1/w441.png (http://g.imageshack.us/img94/20100110230205.jpg/1/)

and custom pass.

Currently, my big problem is i can create more than 44 buffers on my shader.
If anyone have the solution...

mercuito
01-10-2010, 10:14 PM
Hmmm, I wouldnt do it this way, you'll be much better off making an array struct attribute, then you can have a dynamically expanding number of passes. If I get any spare time I'll try help you out.

bigbossfr
01-10-2010, 10:51 PM
Have a dynamically expanding number of passes, yes, but in the end, i would have :
- a custom mia_material
- a custom mi_car_paint_phen_x
- a custom mi_car_paint_phen_x
- a custom mi_metallic_paint_x
- a custom misss_fast_shader_x

When you add all the output of all this material (diffuse, spec, flake, frontSSS, etc etc..) you will have 54 output result.
So i want just create a surface shader with 54 buffers (buffer 1 = diffuse, 2 = spec,..., 30 = flake, etc etc).
After, i will create my 5 customs materials (mia_material, car_paint, etc etc) with this big surface shader as a phenomena.

What do you think ?

Dynamically expanding number of passes yes, but after the 54 buffers no ?

crispy4004
01-10-2010, 11:53 PM
So if I understand correctly, the first 54 buffers are reserved for Material outputs.

I'm a little confused on a few things. Is a script going to attach say the Mia Material to the surface shader with the buffers? Or is the plan to create your own materials with the frame buffer put built in, like MegaTK?


I have a theory why Maya is crashing after 44 buffers. I don't think Maya can can handle displaying that many inputs. The reason I believe this is when you create an Array, it gets cut off after a certain number. Look at what happens with simplepasses:

http://img33.imageshack.us/img33/3144/buffer.jpg
The Maya UI cuts it off automatically.

But as you can see I got 122 buffers out of it, and could have easily added even more :thumbsup:. So my guess is you'll have to make these buffers through an array after all. You could try giving the array a finite number, like 54, to create all the initial inputs. That should take care of the problem. Look at the source code for the simple passes.


The next step after that would be to create the dynamically expanding number of passes using the named_framebuffer method for use of custom Passes. And after that writing a script to automatically create a new buffer for Matte passes for each material:
(Matte.Material Name)

Matte first so it's easy to sort through when choosing the pass in compositing.



Hope that helps.

bigbossfr
01-11-2010, 12:14 AM
I don't want to create a another script.
The plan is to create the owns materials (the 5 materials) with the frame buffer put built in.
So we must have a material with 54 buffers to connect all outputs.

I think my source code is not clean. If anyone know C++, please say me why it is crashing after 44.

mercuito
01-11-2010, 01:53 AM
It doubt its crashing because of the number of attributes, more likely, its because you have a bug in your code. Possibly because the number or types of attributes does not match the number in your mi file.

crispy4004
01-11-2010, 04:23 AM
Sounds good, I wish I could figure out how to correctly compile so I could help find the problem. Think there is something wrong with how I setup the shader.lib with Visual Studio 2008. What steps are you taking to compile?

Really want to figure this out, I'll need to compile for Mac os X intel 2010 eventually. If I can't figure it out on a PC then I'm really out of luck when I need to do it on a mac, if someone else here doesn't do it.

3DRenderer
01-11-2010, 06:24 AM
I know this a very noobish question, but for whatever reason I cannot render anything out using these functions. I dont know why. I have downloaded the example sences and followed it up with the tutorial provided but when you say just hit render and everything should appear in the dir. that was made in C:/ test_name, there is nothing. Just a single frame is rendered in my images dir. Im confused and not sure what I am doing wrong.

Thanks


Okay, thanks for the help....???!!!:rolleyes:

crispy4004
01-11-2010, 08:11 AM
Okay, thanks for the help....???!!!:rolleyes:
Understand that this system is currently under a major re-haul to work past some big limitations and give a lot more functionality. Not exactly the best time to answer questions on how to use the now out-of-date solution.

Look into the P_shaders documentation under MegaTK. The python script requires that you use the exact same setup to output passes.

bigbossfr
01-11-2010, 08:46 AM
It doubt its crashing because of the number of attributes, more likely, its because you have a bug in your code. Possibly because the number or types of attributes does not match the number in your mi file.

It is strange because withh 44 buffers in the code, it is working. When i add a another buffer to have 45 buffers, it is crashing (when i put a texture in a slot). :banghead:

I haven't the competence to debuging the code (first time i do something in C++). Mercuito, if you can just look a little the code, it will be great.
I can continu without debuging this code...

ytsejam1976
01-11-2010, 08:59 AM
bigbossfr
Try to use textures.map. i think a limit of buffer in cache. But i'm supppose only.

bigbossfr
01-11-2010, 10:38 AM
bigbossfr
Try to use textures.map. i think a limit of buffer in cache. But i'm supppose only.

It is crashing not just with a texture but also with a ramp, noise, utility or other. It is just when i connect something in the slot.

mercuito
01-11-2010, 08:15 PM
feel free to send me your code and i'll take a look

bigbossfr
01-11-2010, 08:49 PM
I sent you a PM with the code.
Thank you Mercuito.

bigbossfr
01-12-2010, 09:37 PM
Ok, Pavel help me to correct the bug. Now, it is working. :applause:

Soon soon..

crispy4004
01-13-2010, 12:25 AM
Awesome! :beer: I can't wait.

bigbossfr
01-13-2010, 12:38 AM
deeX_mia_material is done.

Other materials will be quick.

arkanoid
01-13-2010, 08:21 AM
deeX_mia_material is done.

Other materials will be quick.

:buttrock:

achoury
01-13-2010, 01:38 PM
deeX_mia_material is done.
Other materials will be quick.

Finally ! Hope we can see more others stuff, this one seam really "save gain time tweaking" , I like it.
Yeah as always " fond le rendering" I'm happy for you!
/Rachid

3DRenderer
01-13-2010, 05:07 PM
Sweet...mia_material is compatible now. How about the mia_material_x material? And is there way to get rid of the megaTK lights and have support for the mental ray lights? Glad to hear about the progress.
Thanks

crispy4004
01-13-2010, 06:48 PM
Sweet...mia_material is compatible now. How the mat_x material? And is there way to get rid of the megaTK lights and have support for the mental ray lights? Glad to hear about the progress.
Thanks
Well, the Deexfastbufferoutput did not require special megaTK lights so I imagine this will not either.

Not sure exactly what "mat_x Material" is. If you're talking about something that automatically creates a matte pass for each material, that is possible in the future. I imagine that would take place inside the DeeX_mia_material. Like a check box that says "Create Matte Pass for Material", and then an "output Material Matte Passes" in the geo output shader.

Right now though I bet DeeX is primarily focused on building the standard shaders with their outputs ready for an initial release. My guess is custom passes support and potentially some sort of matte pass system would come at a later date.

fahr
01-14-2010, 04:41 PM
This sounds really awesome, but one concern I have for this workflow is what if I need to use a maya shader? FOr example, what if I want to make a layered shader that layers 2 miaX_passes materials together? How would I go about this and still be able to use Deex to render the passes?

MasonDoran
01-14-2010, 06:17 PM
nothing wrong with actually using the MegaTk as it was intendended as its own shader to replace the Mia. Its a powerful shader. Then, just map the result for the specular or reflection if needed.

crispy4004
01-14-2010, 06:30 PM
This sounds really awesome, but one concern I have for this workflow is what if I need to use a maya shader? FOr example, what if I want to make a layered shader that layers 2 miaX_passes materials together? How would I go about this and still be able to use Deex to render the passes?
You could always plug the second mia material's outputs into the custom passes (when ready), along with the cut-out map and do the layering in post. Unless you need a massive amount of layer shaders, working this way is really not too much of a hassle.

Besides, I imagine a layered shader that takes into account the pass outputs of each input and combines them into the necessary passes would be fairly difficult and time consuming to write. Think there are other features Deex should try implementing first to make the setup of certain tasks less time consuming.

crispy4004
01-14-2010, 07:00 PM
nothing wrong with actually using the MegaTk as it was intendended as its own shader to replace the Mia. Its a powerful shader. Then, just map the result for the specular or reflection if needed.
Well that all depends. Let me explain why this system is necessary:


The Mia Material has a very delicate balance between the color and reflectivity passes as I found out earlier in this thread. You want to stick to that as much as possible.


Mega_TK is limited with a few passes by only giving the "result". The Mia passes go one step further and break everything down into the "Raw" and "Level" passes, that when added together give the result. It's one more layer of control that quite frankly I find necessary.

For example say you want to color correct the actual texture of an object in compositing. Puppet thankfully took the steps to separate diffuse and color (unlike Maya's Pass presets) so you can CC both independently, but uh-oh, the color is still in the Indirect pass. That means if you use indirect, you are essentially stuck with you got in the maya render.


The P_shaders only have 10 special passes. That may be enough if your Maya Render looks really close to the final result, but usually that is not the case. If it is, you probably spent an unnecessary amount of time tweaking and re-rendering in Maya. I like to have the control over each individual Material in compositing, which requires creating a Matte Pass for each. It's a pain to setup and hopefully DeeX will be able to make that setup easier in the future, but I simply can't get that done in 10 passes.


10 special passes is not nearly enough for additional custom passes as well.

For example, say you want a point world pass. Goodbye to one pass slot. Now how about an SSS pass for easier skin compositing in Post. Say goodbye to another Pass. Maybe you want SSS broken down additionally into the 3 different layers. Again goodbye to even more. Now how about a fake hair shadow to multiply in post on a characters head, so you don't have to keep making corrections in Photoshop to get it just right. One more pass slot down. Now what about a facing Ratio? You get the idea.


Don't get me wrong, Puppet has an awesome system, but it has a few downfalls depending on what level of functionality you need out of it.

bigbossfr
01-14-2010, 08:10 PM
Here a preview :

http://img686.imageshack.us/img686/9663/deexmiamaterial.jpg (http://img686.imageshack.us/i/deexmiamaterial.jpg/)

http://img686.imageshack.us/img686/6273/deexbufferspass.jpg (http://img686.imageshack.us/i/deexbufferspass.jpg/)

I have a little problem : i fail to create a phenomena of a car_paint_phen shad in Maya 2009.:hmm:
If anyone win to create a phenomena of a car_paint_phen, please say me :hmm: .

crispy4004
01-14-2010, 08:34 PM
Good to see the Mia_material is going well. Wish I knew how to help with the car paint.

achoury
01-14-2010, 10:34 PM
hi damien

I sent you a private msg to explain why you get this error
phenomenon "deeX_mi_car_paint" root not found
The reason is because the mi_car_paint itself is a phenomena, not a shader based on paint Shader and the mi_car_paint_x is a copies of a copies! so when you point the root to mi_car_paint_x there is no root since mi_car_paint_x itself need a root witch is assigned somewhere in Paint shader.
If you need to build a phenomena based on mi_car_paint_phen_x for outputting some result passes you need to look at others data like Scripts/AEtemplate and Others, also AdskShaderSDK.mi (mental ray/include)
anyway here is your code corrected without the _X


declare phenomenon
color

"deeX_mi_car_paint" (
color "ambient" default 0 0 0,
color "base_color" default 0.8 0.1 0,
color "edge_color" default 0 0 0,
scalar "edge_color_bias" default 1.0,
color "lit_color" default 0.6 0 0.2,
scalar "lit_color_bias" default 8.0,
scalar "diffuse_weight" default 1.0,
scalar "diffuse_bias" default 1.5,

color "flake_color" default 1 1 1,
scalar "flake_weight" default 1.0,
scalar "flake_reflect" default 0.0,
scalar "flake_exp" default 45.0,
scalar "flake_density" default 0.5,
scalar "flake_decay" default 0.0,
scalar "flake_strength" default 0.8,
scalar "flake_scale" default 0.12,

color "spec" default 1 1 1,
scalar "spec_weight" default 0.2,
scalar "spec_exp" default 60.0,
color "spec_sec" default 1 1 1,
scalar "spec_sec_weight" default 0.3,
scalar "spec_sec_exp" default 25.0,
boolean "spec_glazing" default on,

color "reflection_color" default 1 1 1,
scalar "edge_factor" default 7.0,
scalar "reflection_edge_weight" default 1.0,
scalar "reflection_base_weight" default 0.2,
integer "samples" default 0,
scalar "glossy_spread" default 0.0,
scalar "max_distance" default 0.0,
boolean "single_env_sample" default off,

color "dirt_color" default .3 .3 .3,
scalar "dirt_weight" default 0.0,

scalar "irradiance_weight" default 1.0,
scalar "global_weight" default 1.0,

integer "mode" default 4,
#: property "lightmode"
array light "lights" #: property "lightlink"
)

shader "mi_car_paint_phen"
"mi_car_paint_phen" (
"ambient" = interface "ambient",
"base_color" = interface "base_color",
"edge_color" = interface "edge_color",
"edge_color_bias" = interface "edge_color_bias",
"lit_color" = interface "lit_color",
"lit_color_bias" = interface "lit_color_bias",
"diffuse_weight" = interface "diffuse_weight",
"diffuse_bias" = interface "diffuse_bias",
"flake_color" = interface "flake_color",
"flake_weight" = interface "flake_weight",
"flake_reflect" = interface "flake_reflect",
"flake_exp" = interface "flake_exp",
"flake_density" = interface "flake_density",
"flake_decay" = interface "flake_decay",
"flake_strength" = interface "flake_strength",
"flake_scale" = interface "flake_scale",
"spec" = interface "spec",
"spec_weight" = interface "spec_weight",
"spec_exp" = interface "spec_exp",
"spec_sec" = interface "spec_sec",
"spec_sec_weight" = interface "spec_sec_weight",
"spec_sec_exp" = interface "spec_sec_exp",
"spec_glazing" = interface "spec_glazing",
"reflection_color" = interface "reflection_color",
"edge_factor" = interface "edge_factor",
"reflection_edge_weight" = interface "reflection_edge_weight",
"reflection_base_weight" = interface "reflection_base_weight",
"samples" = interface "samples",
"glossy_spread" = interface "glossy_spread",
"max_distance" = interface "max_distance",
"single_env_sample" = interface "single_env_sample",
"dirt_color" = interface "dirt_color",
"dirt_weight" = interface "dirt_weight",
"irradiance_weight" = interface "irradiance_weight",
"global_weight" = interface "global_weight",
"mode" 4,
"lights" []
)

root
= "mi_car_paint_phen"
version 1
apply material
#: nodeid 3545403
end declare


by the way My phenomena work well under Maya2008/2009/2010 (WinXP32/64 and Vista32/64) !
/Rachid

arkanoid
01-15-2010, 07:19 AM
Well that all depends. Let me explain why this system is necessary:


The Mia Material has a very delicate balance between the color and reflectivity passes as I found out earlier in this thread. You want to stick to that as much as possible.


Mega_TK is limited with a few passes by only giving the "result". The Mia passes go one step further and break everything down into the "Raw" and "Level" passes, that when added together give the result. It's one more layer of control that quite frankly I find necessary.

For example say you want to color correct the actual texture of an object in compositing. Puppet thankfully took the steps to separate diffuse and color (unlike Maya's Pass presets) so you can CC both independently, but uh-oh, the color is still in the Indirect pass. That means if you use indirect, you are essentially stuck with you got in the maya render.


The P_shaders only have 10 special passes. That may be enough if your Maya Render looks really close to the final result, but usually that is not the case. If it is, you probably spent an unnecessary amount of time tweaking and re-rendering in Maya. I like to have the control over each individual Material in compositing, which requires creating a Matte Pass for each. It's a pain to setup and hopefully DeeX will be able to make that setup easier in the future, but I simply can't get that done in 10 passes.


10 special passes is not nearly enough for additional custom passes as well.

For example, say you want a point world pass. Goodbye to one pass slot. Now how about an SSS pass for easier skin compositing in Post. Say goodbye to another Pass. Maybe you want SSS broken down additionally into the 3 different layers. Again goodbye to even more. Now how about a fake hair shadow to multiply in post on a characters head, so you don't have to keep making corrections in Photoshop to get it just right. One more pass slot down. Now what about a facing Ratio? You get the idea.


Don't get me wrong, Puppet has an awesome system, but it has a few downfalls depending on what level of functionality you need out of it.

Hi Crispy. All that is very interesting, but I have some questions about it: you said you need to stick with mia_material because of the embedded physical light balance. But then you want so much control on it (raw+level for every channel) that you could easily overset that mechanism. Isn't it a contradiction? More so that you said one shouldn't take too much time tweaking settings in Maya, so you probably don't get so close to your final effect. You are probably going to break that desired balance anyway.
Btw forgive me if I say some obvious inaccuracies, I didn't go too far with compositing yet.

crispy4004
01-15-2010, 08:35 AM
Hi Crispy. All that is very interesting, but I have some questions about it: you said you need to stick with mia_material because of the embedded physical light balance. But then you want so much control on it (raw+level for every channel) that you could easily overset that mechanism. Isn't it a contradiction? More so that you said one shouldn't take too much time tweaking settings in Maya, so you probably don't get so close to your final effect. You are probably going to break that desired balance anyway.
Btw forgive me if I say some obvious inaccuracies, I didn't go too far with compositing yet.
You are absolutely correct. The bottom line is you go with what looks right in the most efficient way possible. Compositing in itself is a trade-off of sorts, even a cheat to some degree. You try to play by the rules as much as possible but at some point you need the freedom to break them. Why? Because doing so can save you hundreds of hours of work by allowing you to work more like an artist and less like a technician.

There is a reason so many 3d still artists do touch-up to their final render in Photoshop. Technically, that is an even bigger mistake than compositing with passes, but realistically, from an artistic and deadline perspective, it's the best option many 3D Artists have. That and pass compositing is not an easy thing to learn ;).

By the way, there are ways to fake th Mia material balance with a facing ratio pass. Doesn't mean it's physically accurate but hey, who wants to wait an extra 10 minutes rendering a scene to see one small difference with each slight change. The best practice in my eyes is to get things somewhat close in Maya without going overkill. You could literally spend a month trying to get a Maya render perfect when you could achieve similar results with compositing in a few days, possibly hours.

bigbossfr
01-15-2010, 09:23 AM
hi damien

I sent you a private msg to explain why you get this error
phenomenon "deeX_mi_car_paint" root not found
The reason is because the mi_car_paint itself is a phenomena, not a shader based on paint Shader and the mi_car_paint_x is a copies of a copies! so when you point the root to mi_car_paint_x there is no root since mi_car_paint_x itself need a root witch is assigned somewhere in Paint shader.
If you need to build a phenomena based on mi_car_paint_phen_x for outputting some result passes you need to look at others data like Scripts/AEtemplate and Others, also AdskShaderSDK.mi (mental ray/include)
anyway here is your code corrected without the _X


declare phenomenon
color

"deeX_mi_car_paint" (
color "ambient" default 0 0 0,
color "base_color" default 0.8 0.1 0,
color "edge_color" default 0 0 0,
scalar "edge_color_bias" default 1.0,
color "lit_color" default 0.6 0 0.2,
scalar "lit_color_bias" default 8.0,
scalar "diffuse_weight" default 1.0,
scalar "diffuse_bias" default 1.5,

color "flake_color" default 1 1 1,
scalar "flake_weight" default 1.0,
scalar "flake_reflect" default 0.0,
scalar "flake_exp" default 45.0,
scalar "flake_density" default 0.5,
scalar "flake_decay" default 0.0,
scalar "flake_strength" default 0.8,
scalar "flake_scale" default 0.12,

color "spec" default 1 1 1,
scalar "spec_weight" default 0.2,
scalar "spec_exp" default 60.0,
color "spec_sec" default 1 1 1,
scalar "spec_sec_weight" default 0.3,
scalar "spec_sec_exp" default 25.0,
boolean "spec_glazing" default on,

color "reflection_color" default 1 1 1,
scalar "edge_factor" default 7.0,
scalar "reflection_edge_weight" default 1.0,
scalar "reflection_base_weight" default 0.2,
integer "samples" default 0,
scalar "glossy_spread" default 0.0,
scalar "max_distance" default 0.0,
boolean "single_env_sample" default off,

color "dirt_color" default .3 .3 .3,
scalar "dirt_weight" default 0.0,

scalar "irradiance_weight" default 1.0,
scalar "global_weight" default 1.0,

integer "mode" default 4,
#: property "lightmode"
array light "lights" #: property "lightlink"
)

shader "mi_car_paint_phen"
"mi_car_paint_phen" (
"ambient" = interface "ambient",
"base_color" = interface "base_color",
"edge_color" = interface "edge_color",
"edge_color_bias" = interface "edge_color_bias",
"lit_color" = interface "lit_color",
"lit_color_bias" = interface "lit_color_bias",
"diffuse_weight" = interface "diffuse_weight",
"diffuse_bias" = interface "diffuse_bias",
"flake_color" = interface "flake_color",
"flake_weight" = interface "flake_weight",
"flake_reflect" = interface "flake_reflect",
"flake_exp" = interface "flake_exp",
"flake_density" = interface "flake_density",
"flake_decay" = interface "flake_decay",
"flake_strength" = interface "flake_strength",
"flake_scale" = interface "flake_scale",
"spec" = interface "spec",
"spec_weight" = interface "spec_weight",
"spec_exp" = interface "spec_exp",
"spec_sec" = interface "spec_sec",
"spec_sec_weight" = interface "spec_sec_weight",
"spec_sec_exp" = interface "spec_sec_exp",
"spec_glazing" = interface "spec_glazing",
"reflection_color" = interface "reflection_color",
"edge_factor" = interface "edge_factor",
"reflection_edge_weight" = interface "reflection_edge_weight",
"reflection_base_weight" = interface "reflection_base_weight",
"samples" = interface "samples",
"glossy_spread" = interface "glossy_spread",
"max_distance" = interface "max_distance",
"single_env_sample" = interface "single_env_sample",
"dirt_color" = interface "dirt_color",
"dirt_weight" = interface "dirt_weight",
"irradiance_weight" = interface "irradiance_weight",
"global_weight" = interface "global_weight",
"mode" 4,
"lights" []
)

root
= "mi_car_paint_phen"
version 1
apply material
#: nodeid 3545403
end declare


by the way My phenomena work well under Maya2008/2009/2010 (WinXP32/64 and Vista32/64) !
/Rachid

Hi Rachid,
I need a mi_car_paint_phen_x, not a mi_car_paint_phen.
So, i have see the render AdskShaderSDK.mi, and it is not here. It is in a paint.mi.

Here the correct code, with the car_paint_phen_x in a surface shader :

declare phenomenon struct
{
color "result", # main output

color "ambient_result",
color "ambient_raw",
color "ambient_level",

color "diffuse_result",
color "diffuse_raw",
color "diffuse_level",

color "indirect_result",
color "indirect_raw",
color "indirect_level",

color "spec1_result",
color "spec1_raw",
color "spec1_level",

color "spec2_result",
color "spec2_raw",
color "spec2_level",

color "flake_result",
color "flake_raw",
color "flake_level",

color "flake_refl_result",
color "flake_refl_raw",
color "flake_refl_level",

vector "flake_normal",

color "reflection_result",
color "reflection_raw",
color "reflection_level",

color "dirt_result",
color "dirt_raw",
color "dirt_level"
}
"deeX_mi_car_paint"
(
color "ambient" default 0 0 0,
color "base_color" default 0.8 0.1 0,
color "edge_color" default 0 0 0,
scalar "edge_color_bias" default 1.0,
color "lit_color" default 0.6 0 0.2,
scalar "lit_color_bias" default 8.0,
scalar "diffuse_weight" default 1.0,
scalar "diffuse_bias" default 1.5,

color "flake_color" default 1 1 1,
scalar "flake_weight" default 1.0,
scalar "flake_reflect" default 0.0,
scalar "flake_exp" default 45.0,
scalar "flake_density" default 0.5,
scalar "flake_decay" default 0.0,
scalar "flake_strength" default 0.8,
scalar "flake_scale" default 0.12,

color "spec" default 1 1 1,
scalar "spec_weight" default 0.2,
scalar "spec_exp" default 60.0,
color "spec_sec" default 1 1 1,
scalar "spec_sec_weight" default 0.3,
scalar "spec_sec_exp" default 25.0,
boolean "spec_glazing" default on,

color "reflection_color" default 1 1 1,
scalar "edge_factor" default 7.0,
scalar "reflection_edge_weight" default 1.0,
scalar "reflection_base_weight" default 0.2,
integer "samples" default 0,
scalar "glossy_spread" default 0.0,
scalar "max_distance" default 0.0,
boolean "single_env_sample" default off,

color "dirt_color" default .3 .3 .3,
scalar "dirt_weight" default 0.0,

scalar "irradiance_weight" default 1.0,
scalar "global_weight" default 1.0,

integer "mode" default 3,
array light "lights"
)

shader "flakes" "mi_bump_flakes" (
"flake_scale" = interface "flake_scale",
"flake_strength" = interface "flake_strength",
"flake_density" = interface "flake_density"
)

shader "carpaint" "mi_metallic_paint_x" (
"ambient" = interface "ambient",
"base_color" = interface "base_color",
"edge_color" = interface "edge_color",
"edge_color_bias"= interface "edge_color_bias",
"lit_color" = interface "lit_color",
"lit_color_bias" = interface "lit_color_bias",
"diffuse_weight" = interface "diffuse_weight",
"diffuse_bias" = interface "diffuse_bias",

"flake_color" = interface "flake_color",
"flake_weight" = interface "flake_weight",
"flake_exp" = interface "flake_exp",
"flake_reflect" = interface "flake_reflect",
"flake_decay" = interface "flake_decay",
"flake_bump" "flakes",

"spec" = interface "spec",
"spec_weight" = interface "spec_weight",
"spec_exp" = interface "spec_exp",
"spec_sec" = interface "spec_sec",
"spec_sec_weight"= interface "spec_sec_weight",
"spec_sec_exp" = interface "spec_sec_exp",
"spec_glazing" = interface "spec_glazing",

"irradiance_weight" = interface "irradiance_weight",
"global_weight" = interface "global_weight",

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

shader "reflection" "mib_glossy_reflection" (
"reflection_color" 1 1 1,
"environment_color" 1 1 1,
"reflection_base_weight" = interface "reflection_base_weight",
"reflection_edge_weight" = interface "reflection_edge_weight",
"edge_factor" = interface "edge_factor",
"samples" = interface "samples",
"u_spread" = interface "glossy_spread",
"v_spread" = interface "glossy_spread",
"max_distance" = interface "max_distance",
"single_env_sample" = interface "single_env_sample"
)

shader "dirtlayer" "mib_illum_lambert" (
"diffuse" 1 1 1,
"mode" = interface "mode",
"lights" = interface "lights"
)

shader "resultmixer" "mi_metallic_paint_output_mixer" (
"paint" "carpaint", # Get the entire struct from the paint (!)

"reflection_raw_in" = "reflection",
"reflection_color" = interface "reflection_color",

"dirt_raw_in" = "dirtlayer",
"dirt_color" = interface "dirt_color",
"dirt_mix" = interface "dirt_weight"
)

shader "flatSurface" "maya_surfaceshader" (
"outColor" = "resultmixer.result",
"outTransparency" 0. 0. 0.,
"outMatteOpacity" 1. 1. 1.,
"outGlowColor" 0. 0. 0.
)


root = "flatSurface"
apply material
#: nodeid 10914545
end declare

Like we see, we must use a "mi_metallic_paint_output_mixer" (hidden shader ? :wise: ).
Now it is working. To night, i will try to merge this code with my code.

Thank you Rachid !

arkanoid
01-15-2010, 09:44 PM
Thanks for your words Crispy. I understand, that's why I'm trying to put myself in that fight too.
But oddly I know many people who are allergic to most post work, like 3d purists you know? :D I know an archviz guy who refuses to do any plate matching. Instead he prefer just to model everything for free uahaha

By the way, there are ways to fake th Mia material balance with a facing ratio pass. Doesn't mean it's physically accurate but hey, who wants to wait an extra 10 minutes rendering a scene to see one small difference with each slight change.

Will watch out this!

You could literally spend a month trying to get a Maya render perfect

I know... and I think I'm not alone here uhu :p

crispy4004
01-16-2010, 12:31 AM
So DeeX has his hands full with getting this to work and latter adding custom Pass support. Let's see what we as a community can do in the mean time work out a Matte Pass solution. I proposed a Matte Pass Creator Script (http://forums.cgsociety.org/showthread.php?f=89&t=843279) in the programing forums. Best of all it won't suffer from the render 5x render increase.

It would mean we would get 2 different EXRs. One from DeeX's ouputs, and one from Maya's Passes that have all the Mattes. Of course this is all potentially temporary if DeeX adds something similar on a per material basis inside the shaders. But like I said, he is clearly busy at the moment.

Any script writers here interested in helping?

bigbossfr
01-16-2010, 03:16 AM
All is done...:thumbsup:
5 AM, time to go to the bed.

Release this week for windows x64 Maya 2009.

achoury
01-16-2010, 09:33 AM
Hi Rachid,
I need a mi_car_paint_phen_x, not a mi_car_paint_phen.
So, i have see the render AdskShaderSDK.mi, and it is not here. It is in a paint.mi.

Look carefully in AdskShaderSDK.mi
at line 167: Shader for the mi_metallic_paint_x outputs.
at line 269: Shader for the mi_car_paint_phen_x outputs.
So this is the Shader, witch debut with declare shader.
and the code you posted in paint.mi is just a phenomena based on AdskShaderSDK Shader with declare phenomena.

/Rachid

mercuito
01-17-2010, 08:09 PM
Well that all depends. Let me explain why this system is necessary:





The Mia Material has a very delicate balance between the color and reflectivity passes as I found out earlier in this thread. You want to stick to that as much as possible.
Mega_TK is limited with a few passes by only giving the "result". The Mia passes go one step further and break everything down into the "Raw" and "Level" passes, that when added together give the result. It's one more layer of control that quite frankly I find necessary.







For example say you want to color correct the actual texture of an object in compositing. Puppet thankfully took the steps to separate diffuse and color (unlike Maya's Pass presets) so you can CC both independently, but uh-oh, the color is still in the Indirect pass. That means if you use indirect, you are essentially stuck with you got in the maya render.
The P_shaders only have 10 special passes. That may be enough if your Maya Render looks really close to the final result, but usually that is not the case. If it is, you probably spent an unnecessary amount of time tweaking and re-rendering in Maya. I like to have the control over each individual Material in compositing, which requires creating a Matte Pass for each. It's a pain to setup and hopefully DeeX will be able to make that setup easier in the future, but I simply can't get that done in 10 passes.
10 special passes is not nearly enough for additional custom passes as well.







For example, say you want a point world pass. Goodbye to one pass slot. Now how about an SSS pass for easier skin compositing in Post. Say goodbye to another Pass. Maybe you want SSS broken down additionally into the 3 different layers. Again goodbye to even more. Now how about a fake hair shadow to multiply in post on a characters head, so you don't have to keep making corrections in Photoshop to get it just right. One more pass slot down. Now what about a facing Ratio? You get the idea.
Don't get me wrong, Puppet has an awesome system, but it has a few downfalls depending on what level of functionality you need out of it.


Let me just clear up a few things which might be overlooked...




The Mia Material has a very delicate balance between the color and reflectivity passes as I found out earlier in this thread. You want to stick to that as much as possible.
This "delicate balance" is just because the material is energy conserving, ie the diffuse + shadow + reflection always = 1. So a completely reflective material with have no diffuse shading etc. This stops users from breaking the laws of physics :D




2.
Mega_TK is limited with a few passes by only giving the "result". The Mia passes go one step further and break everything down into the "Raw" and "Level" passes, that when added together give the result. It's one more layer of control that quite frankly I find necessary.


For example say you want to color correct the actual texture of an object in compositing. Puppet thankfully took the steps to separate diffuse and color (unlike Maya's Pass presets) so you can CC both independently, but uh-oh, the color is still in the Indirect pass. That means if you use indirect, you are essentially stuck with you got in the maya render.


Now this is when you need to start being VERY careful. There's something a lot of people don't understand. There is actually a very good reason maya's pass system and some of puppets pass contain the colour information mixed in - its all about multiplication.


To quote master zap: "Technically you can only postpone additive math 100% properly to post. Any time you do multiplicative math (in post), you should be worried, because you will run into trouble."


That's because of the way multiplicative math works. In render time, it is happening at a subpixel level because of antialiasing, then filtered to get the final pixel. When you try do that in post, you can only do it per pixel so you will end up with some serious issues (looks like the edges dont quite line up), especially evident when you have semi transparent objects or high contrast areas. For an example, goto the link further down.



The only way to composite 100% correctly without introducing any problems is to do all the multiplication at rendertime - which is why colour is premultiplied with lighting passes. Puppet gets around this in his shaders by using a output shader the divides the colour from some passes at the pixel level, I don't know how well this works, but you can do the same thing in any compositing package.



For more information go here: http://mymentalray.com/forum/showthread.php?t=1491


My suggestion (especially for production), stay away from these problems! It can be very hard to fix, the amount of control you get from splitting passes up to raw/level passes is not always worth the problems you will encounter.

Puppet|
01-17-2010, 09:16 PM
To quote master zap: "Technically you can only postpone additive math 100% properly to post. Any time you do multiplicative math (in post), you should be worried, because you will run into trouble."
p_MegaTK have some trick for avoid such problem like on followed image:

http://www.puppet.tfdv.com/adv_lambert.jpg

For example you'll get right image with p_MegaTK and left one with any other simple passes system (diffuse * shadow).
Yes, it's multiply problem... :)
I'm using dividing buffers for fix it...

crispy4004
01-17-2010, 09:32 PM
Wow, thanks mercuito for bringing this up, never noticed it before. I built a similar scene with just the color_buffer_witters and low and behold, the artifacts exists. All my scenes are pretty brightly lit, so maybe that's why I've never noticed this before.

Looks like Puppet somehow got around it though. I'll test it with Puppets and Deex's outputs when I get back home.

mercuito
01-17-2010, 10:03 PM
p_MegaTK have some trick for avoid such problem like on followed image:

http://www.puppet.tfdv.com/adv_lambert.jpg

For example you'll get right image with p_MegaTK and left one with any other simple passes system (diffuse * shadow).
Yes, it's multiply problem... :)
I'm using dividing buffers for fix it...

Yeah I've looked into your little trick, just had a couple of concerns about how accurate it might be? I was exploring a similar technique but decided against it as it was doing odd things with semi transparent objects (I believe it still composited correctly though, just looked odd before hand).

Most studios use premultiplied passes anyway - i think this is how renderman does it? Either way, doing only addition in comp is a great way to go, keeps things simple and reduces chances of problems.

I love the ability to alter stuff in comp, but I find sometimes people rely on it too much, and you end getting renders out of maya that are pretty crap and then comp can only push it so far. I encourage people to get a good render out of maya and then use comp to make a good render great.

Puppet|
01-18-2010, 07:22 AM
My trick works fine before you are using not hard color correct.
It may have some problem with hard color correct in black areas where low samples was used. In these areas some aliasing may appear (result of low samples and dividing).
But ussualy it's not visible after compositing all passes. Because such area usually multiplyed by dark diffuse or something else.
So it works fine in 90% cases. It's not ideal, but it get result more closer to beauty than other passes techniques (with pure "shadow" and "color" passes).

If you don't need pure "shadow" or "color" pass, you may use "shading" pass, that already contain all these passes combined.
Or just disable "dividing" in my code :)

In any cases it's better than to have outline like on my image that not possible to fix at all.

It's not mental ray relative issue. It's any render problem.
For example I'm using same trick in my renderman shaders.

AlexanderHudson
05-19-2010, 02:34 PM
It is possible to use this tool to separate all the elements from the miss fast skin shader?
I can get it to render out the front/back/mid sss passes, but not spec/ ref / diffuse etc.
Is it necessary to use something like mix8layer to add a blinn for the spec and ref channels?

bigbossfr
05-19-2010, 03:51 PM
Use deex shaders, this tool is old.

AlexanderHudson
05-19-2010, 05:39 PM
Could you please give a poor mental ray noob a quick instruction on how I could set up misss_fast_skin with your shaders in order to render out all the separate passes.
I don't know what combination to use between the deex misss fast shader, deex mia material etc. Which nodes are to be plugged into the the various attributes for light map, diffuse shader, spec etc in the deex misss shader?

CGTalk Moderation
05-19-2010, 05:39 PM
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.