Jump to content
soroush

Ambient Occlusion for a Closed Environment?

Recommended Posts

Hello everyone,

Anyone has any idea that what is the best way to get AO from a closed space that lights can't pass trough?

Imagine a room without any windows. If I put a light inside the room the result will be shadows instead of AO. And If I put an ENV light, it will be black unless I un-check the casting shadows which it makes everything white.

Thanks

 

Share this post


Link to post
Share on other sites

You could use Occlusion VOP in your surface material. Remember to change max distance from -1 to something close to an interior size (otherwise every ray hit will be treated as an occlusion == black render). Also Background color has to be set to 2.0.

Share this post


Link to post
Share on other sites
7 hours ago, symek said:

You could use Occlusion VOP in your surface material. Remember to change max distance from -1 to something close to an interior size (otherwise every ray hit will be treated as an occlusion == black render). Also Background color has to be set to 2.0.

I am pretty new in Houdini.

Where do I have to connect the Occlusion VOP to? and also how do I get it out in my passes? any special setting do I have change in my render settings?

Share this post


Link to post
Share on other sites

the answer to all those questions would be writing a part of the software doc !

I suggest you start with the basics, tuts on sidefx etc...

Share this post


Link to post
Share on other sites
2 hours ago, 6ril said:

the answer to all those questions would be writing a part of the software doc !

I suggest you start with the basics, tuts on sidefx etc...

the question might be basic but I can't spend like months to read all the docs now to find the answer. My scene is ready to render so I thought maybe there is an easy and quick method to do it, specially because the situation in my scene is something unusual as the space is a closed space.

I am learning Houdini, and asking a question here doesn't mean I don't google things or I don't look at the Houdini docs.

Thanks anyway

Share this post


Link to post
Share on other sites

didn't know you got a scene ready, and re-reading myself now, I sound a little harsh, sorry about that.

are you comfortable with mantra shader building/modifying ? render aovs ?

Can't really help you now, and I haven't used mantra for like a year now, but I'm sure someone will help you, implementing AO shouldn't be a big pb.

 

Share this post


Link to post
Share on other sites

In Houdini 16 set material flag on the Occlusion node placed inside /mat context and use it as the material. To make the same in SHOPs, drop Material Shader Builder and connect Occlusion to Cf.

occlusion.hipnc

Share this post


Link to post
Share on other sites
5 hours ago, 6ril said:

didn't know you got a scene ready, and re-reading myself now, I sound a little harsh, sorry about that.

are you comfortable with mantra shader building/modifying ? render aovs ?

Can't really help you now, and I haven't used mantra for like a year now, but I'm sure someone will help you, implementing AO shouldn't be a big pb.

 

no problem man, I totally understand you and I know that my question is something that soppose to be simple. but I just can't get it right!

I am ok to modify the shaders but not like a pro, cuz I came from 3ds max and Maya background.

I can get the AO right for any objects. but when I have the objects inside another objects, everything will be black.

Share this post


Link to post
Share on other sites
3 hours ago, f1480187 said:

In Houdini 16 set material flag on the Occlusion node placed inside /mat context and use it as the material. To make the same in SHOPs, drop Material Shader Builder and connect Occlusion to Cf.

occlusion.hipnc

Thank you for your help, I don't have access to Houdini 16 and I am working with houdini 15.5. I have opened your file and it is not giving me the AO.

I have actually tried this way and couldn't get an AO from it. I have tried many methods from yesterday and non of them works for me. specially when I have an objects inside a closed object. (I know your example is like that also but it doesn't work for me :| )

Share this post


Link to post
Share on other sites

@soroush it does work, but I guess since it comes from H16, you loose the material tab on the box object. So get inside box1, add a material node at the end, and select the /shop/vopmaterial1. Don't forget to put the display flag on that new node ;)

that's it, just hit render and see the occlusion, you can then play with the param of the occlusion node in Shop

max ray distance : the spreading of the occlusion

background color : intensity of the "light"

 

Share this post


Link to post
Share on other sites

you can just use Env Light in AO mode

there is Max Ray Distance slider there as well

Share this post


Link to post
Share on other sites
2 hours ago, 6ril said:

@soroush it does work, but I guess since it comes from H16, you loose the material tab on the box object. So get inside box1, add a material node at the end, and select the /shop/vopmaterial1. Don't forget to put the display flag on that new node ;)

that's it, just hit render and see the occlusion, you can then play with the param of the occlusion node in Shop

max ray distance : the spreading of the occlusion

background color : intensity of the "light"

 

It is working now! I do remember I have tried it before and was not working!

I have created a new scene with a new shader yesterday, same as what you did and was nor working!

gonna try it in my scene now. Thanks a lot Cyril!

Share this post


Link to post
Share on other sites
20 minutes ago, anim said:

you can just use Env Light in AO mode

there is Max Ray Distance slider there as well

Thank you Tomas, But I don't think if the method with ENV light works in my situatio.

Share this post


Link to post
Share on other sites

what do you mean? Diffuse shader and env light, then tweak the distance to be small enough, that should work

Share this post


Link to post
Share on other sites
1 hour ago, anim said:

what do you mean? Diffuse shader and env light, then tweak the distance to be small enough, that should work

I am not sure, cuz when I tried with ENV light it does give me a black result because it is a closed environment,  so there is not any place for the ENV light to pass trough my space.

Share this post


Link to post
Share on other sites
2 hours ago, anim said:

you are misunderstanding what Env Light in AO Mode does, just try what I said, or just look at this file

AO_light_inside.hip

OH! I got it now!

I think the problem that I was keep getting black result was that the number of Max RA Distance was too high by defult.

Thanks Man! That is working now!

Cyril Method works also!

Share this post


Link to post
Share on other sites
6 hours ago, 6ril said:

@soroush it does work, but I guess since it comes from H16, you loose the material tab on the box object. So get inside box1, add a material node at the end, and select the /shop/vopmaterial1. Don't forget to put the display flag on that new node ;)

that's it, just hit render and see the occlusion, you can then play with the param of the occlusion node in Shop

max ray distance : the spreading of the occlusion

background color : intensity of the "light"

 

I know it is stupid! the problem that I was always getting the black result was that I didn't change the background color and it was always Black so it was not generating any lights!

Thanks man. Everything works great now!

Share this post


Link to post
Share on other sites

glad to hear :) even tho it's f1480187 who unstuck you ;)

f1480187 the unstucker !

 

got a problem? press the f1480187 key !

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×