PDA

View Full Version : Using Occlusion Shader



wesleym
07-20-2006, 02:34 PM
Hi,

Does anyone know how to set up an occlusion pass using the occlusion shader?
I have been adding the occlusion shader and attaching it to the luminosity channel of my surface. I then would set the diffuse value of the surface to 10%. Next, I create a preset from this surface setting and just apply it to my objects when I want to setup an occlusion pass.

Does this sound like I am doing this correctly?

thanks,

wes

jameswillmott
07-20-2006, 06:18 PM
I just feed Occlusion straight into the Diffuse Shading input for my preset occlusion surface.

wesleym
07-21-2006, 08:33 AM
Thanks James, I'll give it go.

Matt
07-21-2006, 08:49 AM
Or straight into the Luminosity channel for that exaggerated Occlusion look.

Karmacop
07-21-2006, 09:43 AM
If you want a "real" ambient occlusion pass that you can stick over the top of something then just stick the output of the ambient occlusion node into the diffuse shading input of the surface. This is essentially putting diffuse at 0% and then sticking the occlusion output into the luminosity channel. Of course it all depends on what you want to do with your occlusion pass.

cresshead
07-21-2006, 12:20 PM
does the occlusion shader need:

a working light in the scene? [or can you turn lights all off]
a background colour other than black...


just how do you set up the node?

tried the above but get a black scene.....i turned all lights off and no radiosity...background colour is white....

step by step?

cresshead
07-21-2006, 12:28 PM
okay worked it out....

go render globals panel and turn on shadows for the renderer..

use a distant light...turn off it's shadow casting in the property page
add a fill light if you want to...maybe a pint light..turn it's shadow casting off too...

go to the surface panel and 'edit node'

add a occlussion node...which is found under shaders/diffuse/occlusion
drag to output of that node into the diffuse input of the surface node

note that the occlusion shader can be edited to get a smoother result...1x3 is default..try 4x12 to smooth it out

done!

jahn
07-21-2006, 12:32 PM
turn lights off, and use 100% ambient intensity.

Karmacop
07-21-2006, 12:32 PM
The occlusion shader doesn't need anything, think if it as a texture map. It doesn't interact with lights, radiosity or the background colour.

If you're getting an all black scene then I'm guessing your using the shader on the inside of a room? In this case go into the occlusion node properties and change the mode to ranged and play with it till you get a value you like. Basically it'll give you black if it finds something 0 distance from the surface, white if it doesn't find something until it reaches the max distance or further, and a grey value for any distance in between.

cresshead
07-21-2006, 12:40 PM
cheers!

one extra question...just where did the shading noise reduction button go#
for radiosity....not in the light panel or in the render global panel as far as i can see.....did they ditch it???

Karmacop
07-21-2006, 12:55 PM
turn lights off, and use 100% ambient intensity.
Lighting doesn't matter, but if you want an occlusion pass with no shadows then make sure your lights aren't casting shadows. But you can use occlusion for other things like making it an input for a gradient so you can apply a dirt texture in the darker areas of your occlusion node.


one extra question...just where did the shading noise reduction button go#
for radiosity....not in the light panel or in the render global panel as far as i can see.....did they ditch it???
Render globals> Render > noise reduction, it's near the bottom.

wesleym
07-21-2006, 01:35 PM
Hi All,

If I am lighting a scene with primarly HDR and using an area light for accent, what would be the proper setup? Do I turn off my area light and leave the backdrop radiosity on?

thanks,

wes

Karmacop
07-21-2006, 08:11 PM
Hi All,

If I am lighting a scene with primarly HDR and using an area light for accent, what would be the proper setup? Do I turn off my area light and leave the backdrop radiosity on?

thanks,

wes
What are you trying to do? Just an occlusion pass? Turn radiosity and the light off for speed purposes, but you could leave them both on as neither effect the occlusion shader (but you need to plug occlusion into the diffuse shading input).

jahn
07-22-2006, 04:11 AM
settings: occlusion(with poor quality) linked to diffuse shading and noise reduction enabled.

all lights and radiosity off. only global intensity set to %100.

wesleym
07-25-2006, 01:59 PM
Thanks KarmaCop, that answers my question. I am just needing an occlusion pass of my scene.

wesleym
07-25-2006, 02:55 PM
If you want a "real" ambient occlusion pass that you can stick over the top of something then just stick the output of the ambient occlusion node into the diffuse shading input of the surface. This is essentially putting diffuse at 0% and then sticking the occlusion output into the luminosity channel. Of course it all depends on what you want to do with your occlusion pass.

Yes, I want to make an occlusion pass that I will multipy over top of another pass in my composite. I don't understand what you mean by adding the output to the luminosity channel. Do I still turn up Ambient Intensity to 100? I have just been setting my Ambient Intensity to 100 and putting the output of the occlusion shader into the diffuse slot. Will this give me the occlusion pass that I need for compositing?

thanks,
wes

jameswillmott
07-25-2006, 04:55 PM
He's saying what the equivalent of plugging the Occlusion shader into the Diffuse Shading input is.

Just plug the Occlusion shader into the Diffuse Shading input for each surface and that'll be your Occlusion pass. Don't forget to lower the range if your scene has a skydome or is inside a building, otherwise everything will come out black.

gareee
07-26-2006, 08:55 AM
Also, a lower grid sixe willgive you a grainy occlusion render, while higher sampling will give you as smoother look, but will increase rendering times.

I would at least do 5x15 or so.

I'm also seeing some very odd occlusion bakes, where the occlusion is not baked properly, and is offest. I'll post an example of this later in this thread.

gareee
07-26-2006, 09:18 AM
Here's a good "bad bake" example. See all the noise around edges? Also, note the discs are evenly inset into the trim, however on the bake, they are shaded on only one side for some reason!

(All points are welded if possible.)

gareee
07-26-2006, 09:28 AM
Here's another one.. note the offset shadow around the panel dial!

Karmacop
07-26-2006, 09:56 AM
It's hard to tell not seeing the uv map and the whole object etc but are you polygons all triangles? That could help with the offset problem. Occlusion shading can come out differently based on how the object interacts with itself, so shading at different angles probably isn't a big problem. The noise at the edge is a bit weird, but the border sampling isn't the best so that could be causing the issue.

gareee
07-26-2006, 10:04 AM
The polys are mostly quads, with triangles where needed.

I have a feeling the bake camera distance option comes into play a lot for the actual shading. Too close, and you can get backflipped polys, and too far away, and you get badly offset shading.

The uv border sampling is just god awful though, and I suspect is the cause of all that garbage. (You don't see it when polys are ajointed in the uv map.)

Is there a setting to change the bake camera's background from black to a medium gray? That might help some.

Karmacop
07-26-2006, 10:12 AM
I have a feeling the bake camera distance option comes into play a lot for the actual shading. Too close, and you can get backflipped polys, and too far away, and you get badly offset shading.
Yes the distance can make a big difference, and if your polygon's normal is a bit off I think it could be causing some trouble, so try tripling your polygons and see if it makes a difference.



Is there a setting to change the bake camera's background from black to a medium gray? That might help some.
No, but that would be good :)

gareee
07-26-2006, 10:15 AM
Tripling has helped very little with non planar ploys, so I've resorted to moving the baking camera distance instead to fix non planars. The majority of the time, it seems to be an excellent solution, however the ditortion caused by blank uv space is a HUGE issue, and many baked occlusion maps need a lot of postwork to be on any use.

BTW, can you plug a bump node into the occlusion node, and then plug that into the diffuse shader node to get a specific noise type of occusion baked map?

(gonna test that now)

Karmacop
07-26-2006, 10:24 AM
Tripling has helped very little with non planar ploys, so I've resorted to moving the baking camera distance instead to fix non planars.
Well here's something else I just remembered, are you uv maps at the same ratio as your model? ie on the map where the shadoes are offset, is the area on the uv map for that polygon the same width and height as on the model? If not that can cause problems like this too.



BTW, can you plug a bump node into the occlusion node, and then plug that into the diffuse shader node to get a specific noise type of occusion baked map?
I'm not sure what you're asking. The occlusion node has no idea about bump maps or normals, it samples in every visible direction.