PDA

View Full Version : Pass as Channel


voyager
06-08-2008, 07:39 AM
Hi ... Can I set a pass in rendering as a channel ??? If it is possible, please inform me in details ... thanks in advance

cryptosporidium
06-11-2008, 07:46 AM
no, you cant do this. at least never heard of that

1nfern0
06-12-2008, 02:19 AM
maybe not as you want it ...
but if you plan you scene in advance, and know what you want to output in that particular pass then it's a matter of building the right rendertree to produce the output as channel.

CMIIW,

GeneCrucean
06-12-2008, 11:18 AM
You can do a pass as a channel but it's a little overly complicated for what it's worth.

You need a mix8color plugged into EVERY shader that you would have used in the pass, then you turn on each layer and set it's weight to 0. Now you have a way to globally override all shaders in the scene.

Inside the partition's override, you will override one of the remaining 7 layers from the mix8color with a storeColorInChannel node.

Here is a script that will add a mix8color node to every selected "shader" (not object).

var sel = application.selection;
for (i=0;i<sel.count;i++) {
logmessage(sel(i).fullname) ;
var OldShader = sel(i).Shaders;

//logmessage (OldShader(0).name);

oBuffers = SIApplyShaderToCnxPoint ("Texture\\Mixers\\Mix_8colors", sel(i) + ".surface","Buffers",true);

//Convert the shader to a Shader object
var oBuffers= oBuffers(0);


SIConnectShaderToCnxPoint (OldShader(0), oBuffers.base_color, false);
SIConnectShaderToCnxPoint(oBuffers, sel(i) + ".shadow", false);
SIConnectShaderToCnxPoint(oBuffers, sel(i) + ".Photon", false);

for (j=1;j<8;j++) {
oBuffers.Parameters("inuse"+j).Value= 1;
oBuffers.Parameters("weight"+j).red.Value= 0;
oBuffers.Parameters("weight"+j).green.Value= 0;
oBuffers.Parameters("weight"+j).blue.Value= 0;
oBuffers.Parameters("weight"+j).alpha.Value= 1;
}
}
Hope that helps a little, and hopefully v7 will make this process a little more intuitive.

GeneCrucean
06-12-2008, 11:55 AM
Here is a quick scene to show how it's done.

voyager
06-18-2008, 05:43 AM
thank you GeneCrucean for the reply and although it is a little complicated (especially in large scenes) but it is worth as you said ... but here is the tricky question ?? if I assign different cameras to the different passes and then set these passes as Channels ... Do I lose those cameras and only get the view from the active camera or I will retain them and get them all in the Channel on render as well ???
Another thing ... How can I get the specular and the reflection of theses passes when I set them as channels ?? I know I can simply turn off the diffuse and any other property from within the shader and then get what I want, but is there any other way to do that ??? thanks in advance

GeneCrucean
06-18-2008, 10:58 AM
It's definitely a complicated system that's not "yet" optimized that well but hopefully v7 will address some of this. Imo, the current system is great for simple things but not so great as a pass replacement system.

if I assign different cameras to the different passes and then set these passes as Channels ... Do I lose those cameras and only get the view from the active camera or I will retain them and get them all in the Channel on render as well ???
Camera's don't really matter with this system because all of the magic happens in the pass/partitions. Add as many cameras as you like.


How can I get the specular and the reflection of theses passes when I set them as channels ?? I know I can simply turn off the diffuse and any other property from within the shader and then get what I want, but is there any other way to do that ???
To my knowledge that's the only way to do it because there is no way to split info from a shader. Say a Blinn. So currently the only way to do it is to duplicate a portion of your shader and turn off everything you don't need (just like an override). Remember that things like this will add to render times.

voyager
06-21-2008, 04:18 PM
Here is a simple scene ... A frame (with red reflective Blinn), A glass (with a transparent Architectural material) within it , Sphere (with a yellow reflective Blinn) and 2 Torusus (with a green reflective Blinn).

http://i28.tinypic.com/1z2eyx4.jpg

When I set a new Channel with only the Glass in it, I will not get the desired effect. What I get instead is the glass with parts of other objects seen through it ...

http://i28.tinypic.com/2ebxzlk.jpg

Is this all what I can get from setting new channels??

ThE_JacO
06-22-2008, 04:42 AM
When you set a channel what you do is you ask mental ray to dump that buffer into a file at that point in the process.
What you see there when you apply that channel to the glass only is what MRay has "in memory" of that object at that point.

Since the glass is behind something it doesn't get uselessly calculated, hence when you dump it it doesn't show those pixels.

If you want the render to change properties drasitcally (like one object visible only in secondary rays but not in primary) then you have to use passes, since you're probably asking for something with properties different from what the objects have in that pass.

Your "desired effect" might not be what channels are for, but what you have in that image is definitely correct. Channels can only provide isolation of elements that are being calculated in each pass. Knowing what the "desired effect" would be might help :)

P.S.
Also link pictures instead of embedding them in the post please, it's annoying having to load 300k to load a page every time and having thread pages with a scrollbar the size of a pea :)

voyager
06-23-2008, 03:11 PM
Thanks ThE_JacO (http://community.softimage.com/member.php?u=593) for this scientific explanation that really clears many things to me in regarding Pass as channels and this is the magic of these forums where the one can get such information directly from the professionals ... I already knew that I can get my "desired effect" by simply setting a new pass and turn off what I don't want to be visible .. but what I was looking for is a way that make me set these passes as channels to reduce the rendering time..Anyway, thanks for the reply
By the way.. If you check it, I embedded only 30K pictures in the post and not 300k :)