View Full Version : passes question
implicit 05-19-2004, 07:08 PM i've got a little confusion in my brain about passes.
for example:
i want one pass rendering out my objects with their shading & texturing.
and the other pass should be the dirtmap for those particular objects.
i somehow can't seperate it, but wouldn't like to use two scenes for that. also for future stuff i'd like to know how i can set up this properly.
thanks in advance
--
just to clarify: i dont need to duplicate the objects and hide it in the viewport and only set rendering visibility options for output (dirtmap pass)?
|
|
pimeto
05-19-2004, 07:26 PM
http://www.xsibase.com/forum/index.php?board=6;action=display;threadid=6902;start=0
i think this will do the job for you ;)
ThE_JacO
05-19-2004, 07:54 PM
If I got this right what you are trying to do is actually build passes in XSI that will merge the 2 setups in a single scene and can be rendered separately right ?
in that case look up in the manual for passes, partitions and overrides.
simpliest way is to keep the default as you have it.
create a new pass and put all objects you want to dirtmap in the same partition, then set a material on that partition and connect dirtmap to the rendertree for this.
partitions are basically mutually exclusive groups inside a pass, a pass is like a scene in its own right.
so you can deal with a partition inside a pass like you deal with a group, add materials or overrides to it for basically every property, not only rendering qualities.
start from here and do a bit of reading and testing with simple scenes to get the hang of the thing and it will be a walk in the park.
implicit
05-19-2004, 08:00 PM
no, that wasnt my question. you reffered to a general ambient occlusion thread.
i was asking for an answer to my passes/ partitions question.
i can explain again:
need to know how to seperate shaders for an object to those particular passes.
here is a possible pass-setup:
diffuse
reflection
ambient occlusion
toon
--
so i need to know how i can seperate or share those different shader-modes for one object and seperate them to the passes.
its no problem accessing standard passes that are incorporated in the rendering options (stuff like reflection). but ambient occlusion is not integrated in xsi, but an addon. but anyway, i'm wondering how to set up this properly. confused here :curious:
ThE_JacO
05-19-2004, 08:04 PM
that's what I just posted.
create a new pass
get all the object you want to dirtmap in a partition
apply a material (or a surface override) to the partition
open rendertree for the partition
connect dirtamp to that tree (and it will affect all objects in the same partition).
this is in the tutorials book, it's in the manuals, in several tutorials, and in countless posts over here and XSIbase.
have a look into it and you'll find a wealth of informations.
implicit
05-19-2004, 08:05 PM
ok thanks jaco.
i was wondering if i can share/ seperate different shaders for one object in those partitions.
that object might have different clusters with particular shaders but generally all they are for example "phong".
and then ambient occlusion for all clusters.
that are 2 passes.
"phong" & "ambient occlusion"
implicit
05-19-2004, 08:09 PM
yes jaco, i know how passes work basically. but maybe i didnt express myself good enough...
its not different objects. its maybe one object that has different shader setups.
as wrote, one might be phong on all its clusters. one might be lambert. one ambient occlusion.
those are 3 passes i want for one object. but this object has clusters with different settings of each its shader-modes.
and that's why i was wondering if i need to duplicate this object 3 times for each different pass or how i can setup this exactly.
ThE_JacO
05-19-2004, 08:09 PM
stay away from clusters in passes.
clusters, because of their nature, need to have top priority in many situations, it follows that they are messy when overridden by lower priorities like groups.
beside that, with passes and partitions you can organize and setup ANY kind of pass, since you can have unlimited numbers of partitions all only grouping certain objects and only overriding very specific parts of the rendertree.
implicit
05-19-2004, 08:23 PM
you mean i should not use any clusters on my object? what if my object has different texture clusters or different shader clusters with different colors and settings?
ThE_JacO
05-19-2004, 08:30 PM
if you have different samples clusters with different projections that's fine, they are only passed to the rendertree to know where to map things.
but different clusters with different local materials on a single object are a clear way to ask for problems in a proper multipass system.
there's several ways to work around it (like vertex maps or rastermaps to drive the weighting of mixers)
if all you need is an ambient occlusion pass anyway you'll want it at object level, and a partition should override everything.
but clusters can't be grouped, so if you want to override only one of them or something it's a tuff job.
leigh
05-19-2004, 08:30 PM
Clusters are evil.
ThE_JacO
05-19-2004, 08:37 PM
Originally posted by Leigh
Clusters are evil.
listen to Leigh, she's recent in the lines of XSItroopers but she got her s**t right ;)
implicit
05-19-2004, 09:05 PM
why so, what's wrong with clusters?
i find them lovely. and i thought they were the way to go to seperate different parts of an object.
what should i use then to seperate quickly different parts of an object (for shading & texturing)???
:surprised :eek: :eek: :rolleyes:
implicit
05-20-2004, 09:49 AM
?
please answer my question leigh or jaco,
thank you
Nocturn
05-20-2004, 12:32 PM
You can use a black/white texture to determine which parts of the object will be affected by a particular material.
Plug 2 or more phongs lamberts etc into a mix 2 (or 8) colors node, and for the weight plug in your black/white texture.
Or you can also paint a vertex color map on the object and use that as a weightmap for the blending. This tutorial covers it:
http://www.edharriss.com/tutorials/Branch_Tutorial_files/branch_tutorial.htm
I have a question about the priority of materials.
From lowest to top priority, is this correct?
Local material
Group material
Partition material
ThE_JacO
05-20-2004, 12:39 PM
clusters are needed and nice for many things, but their nature also goes along with one quality, which is not being groupable.
if you can't group them you can't partition them.
clusters to mix materials are a bad idea anyway, using maps or vertex maps to drive weights and blendings is a much more reliable solution.
implicit
05-21-2004, 12:24 PM
but isnt it so much more time-consuming to seperate object parts by maps?
lets say my object needs 6 different parts to be differently shaded... creating clusters from samples-selection i believe is just so much quicker than doing maps for that reason.
?
ThE_JacO
05-21-2004, 01:01 PM
this is dragging a bit too long.
yes, it would be nice if you could just use cluster.
no, can't use them because due to their nature it's unwise to use them if you are going to want to override only parts of an object.
yes, you can use them if in all passes but the one using the default materials you are always gonna work at object level (like for a DMap shader).
Funk Ride
05-21-2004, 09:15 PM
Originally posted by Nocturn
Or you can also paint a vertex color map on the object and use that as a weightmap for the blending. This tutorial covers it:
http://www.edharriss.com/tutorials/Branch_Tutorial_files/branch_tutorial.htm
Just wondering, but are there any problems with using weight maps instead of color at vertex maps? Can they be used to the same degree as the vertex maps too?
cheers,
Ablefish
05-26-2004, 02:56 AM
Umm... I don't mean to complicate things, but you CAN Group clusters. In fact, this was how I used to get around the over-ride problem. You can't partition them, but if you over-ride a material property that the cluster is inheriting from a group, it will behave properly at render time.
However, that being said, I still try to avoid clusters as well. In most cases it is a lot easier dealing with a single rendertree for an object.
Oh, and to answer that last question, I think the only reason to use a weight map over a vertex map or image clip is because it will be a little bit smaller in terms of storage size - it doesn't hold color info, just 0-1.
ThE_JacO
05-26-2004, 09:19 AM
color@vertex maps have another advantage over weightmaps, they are easier to work with on a sample level, making abrupt color cuts around a loop easily achievable, weightmaps sit on top of a points cluster that makes the whole thing an itchy issue if you want to emulate clusters.
as for the grouping workaround (my bad, I should have written can't be grouped in a mutually exclusive way like partitioning requires) I've tryied it a few times but it was rather shaky as far as stability goes.
you had better luck with it ?
Funk Ride
05-26-2004, 11:50 AM
Thanks for the replies guys, clears up a few things for me. I can see the advantage of color at vertices now, being able, for one thing, to modulate the weight with more than just the 0-1 values, but RGB too. Very nice.
There's one other issue that has me kinda perplexed, but I think I know what's going on, but can't understand why.
Say I have a simple poly sphere object, and apply a texture to it, then in the TE I move certain UV coords to position them over my texture, and then collapse the extraneous ones, and move them out of the way to the side. Now, if I do this with a spherical, or Cylyndrical projection, and then blend the texture with a base color in the mix2colors shader in the render tree, with the image's alpa, or colormatte shader in use, what happens is that the areas outside(collapsed UV's) the selected area, seem to be still blending wit hthe base color, not actually appear to be using the alpha channel.
No, if I move the collapsed UVs above, or below the image in the TE, it seems to work, the image, with alpha, appears, and the base color is clear.
This doesn't happen if I apply a planar projection though.
Just wondering if there's an explanation for it, cause what it seems to be doing, is repeating the texture on the U direction, but not V as it moves away from the iamge.
It's kinda hard to explain, but I'll post some images later though to highlight it more.
Edit: here's the images.
Ok, in the first pic, I've used a simple example of what I'm getting at. It's got a planar XY projection, with the uwanted sample points in the TE collapsed and moved out the ay. Now, it renders fine, with the way I have it set up, the texture on one layer above the base color in the color mixer, with a color matte to set the alpha.
In the second pic, I've got the exact same setup, in regards to the TE and sample points, except I've applied a spherical projection onto the object, teh render tree setup is the same as image 1. The problem seems to be that the collapsed Sample Points in the TE are still holding the colour value for the texture, even though they have been moved out the way of the texture. If I move the collapsed points in the V direction, down, or up past the texture, it renders fine, like in image 1.
The same problem happnes if use the image's alpha instead of a matte.
It's easy enough to work around, but it's just one of those things I'd like to understand, and get right in my head.
Sorry for the long post, and I've probably made it sound convoluted.
Image 1 (Planar Projection)
http://www.dephunkt.com/images/1.jpg
Image 2 (Sperical Projection)
http://www.dephunkt.com/images/2.jpg
Ablefish
05-26-2004, 05:05 PM
Turns out the culprit is that Seam U is toggled on for the spherical projection by default.
I tried it out, and it threw me there for a second because I had thought it was related in some way to the texture support object, but I froze the object and it was still happening. So I opened up both Texture_Projection properties and compared them.
I'm not totally sure what the Seam options do differently from wrapping - they're not covered in the help menu. But turn it off and you'll have the behaviour you're looking for.
Jaco: I don't remember having any specific stability problems, but then again I probably wasn't over-riding more than a few simple properties. It was a while ago, I give cluster materials a bit of a wide berth now.
Funk Ride
05-26-2004, 05:56 PM
Ablefish - you're a mountain of help, cheers for fnding out what was going on. The seam options don't seem to appear before freezing the projections, which is probably where I was getting stuck. I was too busy trying to work out how to fix it without seeing what would happen after freezing.,
Thanks a ton.
implicit
05-26-2004, 06:01 PM
while you guys are at it my original question was still not really answered.
so again, what if i want to include an ambient occlusion pass?
one pass textured
one ambient occlusion
do i have to make a partition in a new pass and connect it somehow to the ambient occlusion? but how?
or do i need to duplicate the object (one for each pass) and make visibilities-overrides for each?
Ablefish
05-26-2004, 06:11 PM
I think we're all confused because the very first reply to this thread directed you to an xsibase thread describing exactly how to create and comp an ambient occlusion pass using the dirtmap shader.
Maybe it would help if you could explain why this doesn't work for you, because as it is - if you apply a material to a partition, it will over-ride any cluster materials, so that shouldn't be an issue.
implicit
05-26-2004, 06:21 PM
well, did you read those firt posts?
that link is directing to a general ambient occlusion thread and my question was rather passes-oriented.
because i am confused about how to split up my shaders/ materials in the passes for one object.
and i read manuals and stuff and i understand how the passes work basically.
i'm just confused about how to make passes with different shaders/ materials or textures for one object.
like
pass 01 = texture 1
pass 02 = texture 2
pass 03 = ambient occlusion
pass 04 = lambert
pass 05 = highlights
pass 06 = shadows
do you understand now what i mean?
so i wonder if this is possible with passes or if i need to split up my scene into different scenes and not passes.
Funk Ride
05-26-2004, 06:23 PM
Really sorry to go off-topic again. But... in regards to the spheerical projection issue I mentioned, there's a way to have it function as though the seam U was switched off, before having to freeze it. In the TE, just move the collapsed UV's along the V direction so that they are either above, or below the image. It renders out fine then when using shaders like color matte.
Still wonder why it defaults to wrapping it on U though.
Ablefish
05-26-2004, 06:49 PM
Implicit: In the very first post of that thread, the bigMuh describes how to create an ambient occlusion pass. He then goes on to explain how to composite the output of the two passes. To be honest, it exactly answers your very first post.
But are you asking a more general question? How to set up passes for an object with multiple (cluster) materials? If you're trying to use the pass presets, this won't work because the over-rides that the presets use on the partitions doesn't 'see' the cluster-level material.
To get around this, you can either combine your cluster materials to a single object-level material (and then blow away the cluster materials), or make a group out of each individual cluster material - and then drag the material from the cluster onto the group (so it's the group-applied material that the partition sees and over-rides.)
If you're asking something else, sorry if I'm missing it. :shrug:
Funkride: Sorry to confuse you - freezing the projection was just something I did while trying to figure out what was going on. You don't have to freeze, all you have to do is open up the texture projection (from the clusters menu in the explorer) and toggle off Seam U.
Funk Ride
05-26-2004, 07:33 PM
Hey Ablefish. That's what I thought too, but, the seam UV option seems to only apear in the Projection PPG after it's been frozen, just below the wrapping options.
Do you think this might be something to do with using the Half-Life 2 version?
CGTalk Moderation
01-18-2006, 06:00 AM
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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.