shader opac for occlusion but transparent for color

   4658   8   2
User Avatar
Member
25 posts
Joined: May 2012
Offline
Hi all,

I have a particle system set up and want to render it with a backgroundimage behind, but i also have geometry that occludes the particle cloud in some areas. this geometry should not be visible for the camera but hide the particles when they are behind.
so i try to create a shader for that geometry which on the one hand is opac for propper occlusion culling but on the other hand is transparent/invisible for the cam.

I attached an example:
The green cube should be invisible but the intersecting part of the red cube should not be visible. Though the blue surface should be visible through all the red cube.

How do i have to configure the Shader for that? i tried out all kind of opacity/alphasettings…

Any idea?

Thanks in advance!

Cheers,
Stefan

Attachments:
boxes.png (24.3 KB)

asinus humanum est
User Avatar
Member
217 posts
Joined: Sept. 2009
Offline
send a test file.
User Avatar
Member
25 posts
Joined: May 2012
Offline
here it is…
the box makes a nice alpha but now should be invisible in the RGB channel so i get colored AA from the bg-image.

Attachments:
sample.hipnc (207.1 KB)

asinus humanum est
User Avatar
Member
217 posts
Joined: Sept. 2009
Offline
this is a quick solution…. Anyway, I would tend to do this in comp!!!


Cheers

Attachments:
sample.hipnc (183.9 KB)

User Avatar
Member
25 posts
Joined: May 2012
Offline
thanks for that!! I also played around with projection maps but it messed up with my imported fbx geo.

what solution would you see in comp? render with black bg, unpremult the black and premult with the bgImage doesn't bring the same result somehow….

Cheers
Stefan
asinus humanum est
User Avatar
Member
217 posts
Joined: Sept. 2009
Offline
Just set up different render ROPs and merge them together.
This means a loooooot freedom. Force the stuff you need to have in each rop, and get ride of aliasing issues, black holdouts and nasty edges…etc.
User Avatar
Member
25 posts
Joined: May 2012
Offline
unfortunately i have no idea how to use the rop net

anyway don't I have to render 2 times when i merge 2 rops? I plan to render a looooot of particles so doubled rendertime may be a bit critical. :?

so maybe the easiest way is to get the projection to work…
asinus humanum est
User Avatar
Member
217 posts
Joined: Sept. 2009
Offline
As always there are more solutions to one problem…
But again if you need to change things later on it could be great to have the particles in a separate pass… in your case it menas having the abilty to easily change the background…

good luck!
User Avatar
Member
25 posts
Joined: May 2012
Offline
…you'r right. I'll trie out both on the actual shot and see what works best.

thanks for your help

Cheers,
Stefan
asinus humanum est
  • Quick Links