PDA

View Full Version : Ambient occlusion tests, anyone?



phillydee
06-01-2006, 01:33 PM
I'm curious to see if anyone's created any ambient occlusion shaders out of the node editor... I never really got around to playing with the node editor as I've been too busy and never kept up with the beta releases but I'm curious nonetheless.

Any images or results appreciated!

Karmacop
06-01-2006, 01:47 PM
There is an occlusion node, so you don't need to create anything, just plug it in :)

BazC
06-01-2006, 01:50 PM
It works very well too! :D

phillydee
06-01-2006, 02:05 PM
There is an occlusion node, so you don't need to create anything, just plug it in :)
Yeah, I saw the occlusion node but never really spent time testing heh. I've been using the SG_AMB occlusion plugin, but "Shading Noise Reduction" doesn't work on it and it does take a while to render the occlusion pass. Anyway, seems like the occlusion shader could work well in a production environment... cool:dance:

Carm3D
06-01-2006, 02:51 PM
I did this using LW's occlusion shader. Compared to SG_AmbOcc, Nodal's occlusion looks pretty linear, so I piped it's output into a gradient to smooth things out. Worked out well enough.

LAV
06-01-2006, 03:30 PM
Oh men! LW9 makes me crazy!

Weetos
06-01-2006, 03:54 PM
That sounds promising !

How does the occlusion node compares to SG_AmbOcc in terms of rendering time ?

Carm3D
06-01-2006, 07:20 PM
I don't know how to compare them.. They have different ways of setting the quality (number of rays).

UnCommonGrafx
06-01-2006, 07:48 PM
I think LWs is much more versatile. SG is much more direct.

LWs deserves some notes and experimentation. After that, I think it's pretty much up to the user as to how far to take it.

jameswillmott
06-01-2006, 08:16 PM
Ray for ray I think SG_Amb_Occ might have a fractional edge, but it has nowhere near the versatility of the Occlusion node, which can be used to drive ANYTHING based on occlusion, be it colour, luminosity or even blending between a Lambert and an Oren-Nayar shader... :)

Wickster
06-01-2006, 10:32 PM
Yup and somebody had already written an SG_Occlusion node and probably itching to release it to the masses once LW9 is out. :D

slatr
06-01-2006, 10:54 PM
Just playing with Occlusion on different nodes.. not sure why on reflection it shows all the blue:stumped:

I looked up Occlusion on Wiki, but I am not satisfied, anyone got a good definition or explanation?

BazC
06-01-2006, 11:18 PM
I looked up Occlusion on Wiki, but I am not satisfied, anyone got a good definition or explanation?

Occluded means blocked or obscured, so (ambient) light occlusion calculates the areas where light is partially or completely blocked from reaching the surface and shades the surface accordingly. Does that make sense?

slatr
06-01-2006, 11:33 PM
As applicable to Lightwave.. does this take into account any light or literally the ambient light setting within Lightwave?

BazC
06-02-2006, 12:39 AM
No it's hypothetical light! You can turn off diffuse, all lights and ambient lighting, plug an occlusion node into luminance and get a render like I posted above. It's looking at the geometry in the vacinity of any given point and calculating how it would affect the lighting on the models surface.

I'm not sure if I'm helping any here, sorry! :D

DragonFist
06-02-2006, 02:01 AM
Occlusion is, more basically, a calculation of where light won't go. Let's say that you have a groove in a flat surface. Light will hit most of the surface just fine with all the bounces of light in the area. But inside the groove, many of those bounces wouldn't get inside and so it would be lit less. Ambient Occlusion simply does math to guestimate what areas would have less light on this basis, like grooves or corners, etc. and darkens them.

The result is often used for a sort of faking of radiosity by applying the data to the diffuse channel or luminous channel and, in fact, can have almost identical results to backdrop only radiosity.

The cool thing with having it as a node is that it can be easily applied to all sorts of things that you wouldn't normally attached it to and get some cool effects. Like I saw one guy in use it inverted and with color to create a sort of glow effect.

Hope that helps.

slatr
06-02-2006, 10:15 PM
Baz, would you mind sharing our T-rex scene file or something similar showing your shader tree?

I am not getting the results I expected.

phillydee
06-02-2006, 10:42 PM
heh... I started this thread because I didn't have the most recent LW 9 beta... seeing the renders really got me excited! BUT.... it's now at LW9 RC2, and I can't get my serial to work :P It's running in discovery mode, :stumped:

I guess it won't stop me from having a bit of fun tho...

slatr
06-02-2006, 10:44 PM
Philly, can you tell show an example scene/shaders with occlusion please?

phillydee
06-02-2006, 11:13 PM
Note: all LW 8.5...

I've rendered an ambient occlusion pass (A.jpg) with SG_ambOcc--pure ambient occlusion, no diffuse shading. Then, the regular LW pass--diffuse, shadow, reflection, refraction, the whole works(B.jpg). I then composite these(comp.jpg). Now the thing I was most curious about was how fast does LW's new occlusion shader render compared to SG_ambOcc--some scenes take quite some time...

Anyway, thanks for the images, Carm and Baz. Does look promising:thumbsup:

lots
06-03-2006, 10:15 AM
This only took a minute and a half as far as I recall. When I get back on my main computer I'll do it again and give the times with nodal AO and SG. Though from the tests i did early on, it seems that the nodal AO was a tad bit slower. I havnt re-examined this recently, so perhaps things have sped up :)

hrgiger
06-03-2006, 11:01 AM
I guess I don't know much about ambient occlusion either but I gather from this thread that it is sort of a guesstimated radiosity and will deliver similar results.
I assume it has to be evaluated per surface or in other words, you must apply the node to each object in your scene?

BazC
06-03-2006, 11:16 AM
Baz, would you mind sharing our T-rex scene file or something similar showing your shader tree?

I am not getting the results I expected.

I can't share the Trex scene but I'll post something soon.

duke
06-03-2006, 11:19 AM
I did a test a while ago, and neck-to-neck with same sample count the rendertime is pretty much exactly the same. The results differ - and infact I prefer SG_ambocc, but the rendertimes are the same. The big thing is that due to the speedups, the overall rendertime for raytraced stuff is faster. At work we had an AO pass with about 1.2mill polys, which took about 40mins a frame, and in some LW9 tests it was only taking 8mins :O The rendertime increase for this kinda stuff (complex, high poly scenes with lots of raytracing) is unbelievable.

duke
06-03-2006, 11:21 AM
If anyone wants to get rendertime comparisons between 8.5/9/9-SG you can shoot the scene/objects to [email protected]

BazC
06-03-2006, 11:44 AM
OK here is the node set up for that T.rex render couldn't be simpler could it?

Just apply this node set up to your surface, turn Diffuse down to zero so your scene lights aren't affecting your surface and turn on ray traced shadows!

connerh
06-03-2006, 11:56 AM
Don't forget inversed AO.

Dave Jerrard
06-03-2006, 12:19 PM
I guess I don't know much about ambient occlusion either but I gather from this thread that it is sort of a guesstimated radiosity and will deliver similar results.
I assume it has to be evaluated per surface or in other words, you must apply the node to each object in your scene?
Close. It's actually based on how much of the backdrop any point on a surface can see. A sphere will be able to see the same amount of backdrop from any point on its surface, so the AO will give a constant value. If you added a groove in that sphere, then the surface of that groove will see less of the backdrop since the sides of the groove will at least partially occlude the backdrop. The AO node will have a lower value for these areas.

It's very much like using Backdrop Radiosity, except for the following:
It's not concerned with the backdrop color. It is only a measure of how much of the backdrop is visible from a point. A white or black backdrop will affect the surface exactly the same. Only occluding geometry can affect it.
It's applied per surface. This gives you more control over ambient lighting effects.
It can be used for pretty much anything. Since it's a node, it can be used to affect the strength of any surface attribute, or other node. In fact, it can be used to affect how much a surface is affected by radiosity. It can also be used as a limiter in reflective grooves (like seams between car body panels) to reduce render times.
It can be mapped so it only affects parts of a surface. Again, since it's a node, it can be modified by other nodes.
So, yes, it has to be applied per surface. This is one of the things that makes it so powerful. You're not stuck with it being all or nothing. This is where you run into a double edged sword. To have more control, you have to have more controls. Nodes give you virtually unlimited control, and with that control, you get virtually unlimited nodes that you can use in infinite ways. Don't let this scare you though. LightWave's nodes let you mix & match surfacing methods, so you can just use what you want. I do most of my coloring through the Diffuse Shading nodes, but I still use the old gradient layers for Specularity & Transparency to set up those aspects because I find them faster.

He Who Should Get Back To His Ultimate Node Experiment Soon.

slatr
06-03-2006, 09:59 PM
I don't think I had my diffuse turned down. Thanks for all your help! :D

nthused
06-03-2006, 11:18 PM
I used LW's Ambient Occlusion on the image in this thread:

http://www.newtek.com/forums/showthread.php?t=51839

BazC
06-04-2006, 01:10 AM
I don't think I had my diffuse turned down. Thanks for all your help! :D

You're very welcome!

phillydee
06-04-2006, 12:16 PM
I used LW's Ambient Occlusion on the image in this thread:

http://www.newtek.com/forums/showthread.php?t=51839
Nice man. One of the main things I was curious about with LW's occlusion shader was that if it was affected by "Noise Reduction"... in LW 8.5 SG doesn't get affected with Shading Noise Reduction turned on, if I recall correctly...

Captain Obvious
06-04-2006, 07:50 PM
Nice man. One of the main things I was curious about with LW's occlusion shader was that if it was affected by "Noise Reduction"... in LW 8.5 SG doesn't get affected with Shading Noise Reduction turned on, if I recall correctly...
Do the noise reduction in post, instead!

ScottSullivan
06-04-2006, 09:38 PM
Very simple (or obvious for most of you probably) question (sort of).

Is there an easy way to apply AO to every surface and do a render (image sequence) without destroying the original surfaces?

For example, I have a character that is colored/textured the way I like for my render. I send it out to a sequence. Then I do an AO image sequence for an AO pass to be added to the original in post in my compositor.

Only thing I can think of is to save two of each objects in the scene, one normal and one with an "_ao" extension with all surfaces having the ambient occulsion. But there's got to be an easy way to apply it to all surfaces? Sorry if this is an easy RTFM question.

Scott

jameswillmott
06-04-2006, 10:08 PM
I save out surface libraries, it's essentially the same as saving a separate object but if your original geometry changes you don't need to save the libraries out again ( unless you add new surfaces )

phillydee
06-04-2006, 10:32 PM
Do the noise reduction in post, instead!
yeah.. i have.

The thing I would prefer is if the edge sharpness stayed but the noise got blurred. I've noticed this with "Shading Noise Reduction", like when used on radiosity, etc. the noise gets blurred out but the edge stays sharp. When I blur my A.O. pass in post, it blurs the edges as well--which is 'ok' if you don't blur too much but I'd prefer the way Shading Noise Reduction handles the noise instead. That's why I was curious in the first place with the occlusion node...

Captain Obvious
06-05-2006, 09:08 AM
yeah.. i have.

The thing I would prefer is if the edge sharpness stayed but the noise got blurred. I've noticed this with "Shading Noise Reduction", like when used on radiosity, etc. the noise gets blurred out but the edge stays sharp. When I blur my A.O. pass in post, it blurs the edges as well--which is 'ok' if you don't blur too much but I'd prefer the way Shading Noise Reduction handles the noise instead. That's why I was curious in the first place with the occlusion node...
Then you should use a better noise reduction method. I use NeatImage, and it doesn't blur the edges at all.

Tesselator
06-05-2006, 05:54 PM
Very simple (or obvious for most of you probably) question (sort of).

Is there an easy way to apply AO to every surface and do a render (image sequence) without destroying the original surfaces?

For example, I have a character that is colored/textured the way I like for my render. I send it out to a sequence. Then I do an AO image sequence for an AO pass to be added to the original in post in my compositor.

Only thing I can think of is to save two of each objects in the scene, one normal and one with an "_ao" extension with all surfaces having the ambient occulsion. But there's got to be an easy way to apply it to all surfaces? Sorry if this is an easy RTFM question.

Scott


Yup,

Save All Objects.
Change the content directory.
Apply AO as you want it to one surface.
RMB on that surface name and select Copy.
Multi-Select all surfaces.
RMB on the list and select Paste.
Save All Objects.

phillydee
06-05-2006, 07:56 PM
Then you should use a better noise reduction method. I use NeatImage, and it doesn't blur the edges at all.
Heh... you don't call yourself captain obvious for nothing! Thanks, man. Didn't know there was a better noise reduction method other than plain ol' blurrrr....

ScottSullivan
06-06-2006, 05:41 AM
Tesselator and James, thanks for that list. That helps and makes it easier (changing to another content directory) and less likely to ruin my current scene. I just figured there must be an easy way to just click "AO to Scene" instead of going through each surface. With bigger scenes, that can get tedious.

But hey, that's why we get paid the big bucks! :D

Thanks!

Scott

phillydee
06-06-2006, 07:52 AM
one good thing about SG_AmbOcc: you can globably apply the shader to the entire scene--as the plugin comes with a generic class that has a requester box that asks you if you want to add or remove the ambient occlusion. You can save the defaults as well, so if you customized the plugin, when you hit 'add' these custom settings will be added. Nifty....

Tesselator
06-06-2006, 08:22 AM
Tesselator and James, thanks for that list. That helps and makes it easier (changing to another content directory) and less likely to ruin my current scene. I just figured there must be an easy way to just click "AO to Scene" instead of going through each surface. With bigger scenes, that can get tedious.

But hey, that's why we get paid the big bucks! :D

Thanks!

Scott
It shouldn't be any more or less tedious for larger or smaller
scenes. It's the same number of mouse clicks. Might take a
little longer to save all with 10,000 objects but other than that.


I think this could be scripted into a one touch button.
It all seems to be there when I think about what's actually
needed to pull it off.

Yup! Bob Hood ROCKS! :D Give it a try.

Tesselator
06-06-2006, 08:25 AM
Or... you could use the RealFlow free plug-in to apply a saved .srf
to all objects in any specific folder. ;)

http://www.flay.com/GetDetail.cfm?ID=909
http://www.interialabs.de/lw/lscript/index.html
etc.

ScottSullivan
06-06-2006, 10:24 AM
Very cool. Thanks guys!