beeemtee Posted August 12, 2009 Share Posted August 12, 2009 Hi, which is the easiest or the common method to have an ambient occlusion pass for a whole scene, I mean all the geometry? I have both displacements in materials and SOP level assignments. The solutions I can think of all involve some degrees of handwork. How do you guys solve these kind of problems? cheers bmt Quote Link to comment Share on other sites More sharing options...
mrice Posted August 12, 2009 Share Posted August 12, 2009 (edited) I'd think the easiest way is to add a light template object with a vex global illumination shader to the scene, and make an 'occlusion' take which activates it. Set the 'global tint' value of the shader to 2. To override the materials, make a python script and save it in your home/houdini/python directory for future reuse: import mantra def filterMaterial(): mantra.setproperty('object:surface', 'plastic') def filterInstance(): mantra.setproperty('object:surface', 'plastic') In the occlusion take, set your mantra rop's command parameter to "mantra -P $HOME/houdini10.0/python/default_material.py", changing the path and filename to point to your script. This should preserve your displacements, but if you're displacing normals inside a surface shader that would be more tricky... Is your avatar from Mindgames? I know I've seen that somewhere! Edited August 12, 2009 by mrice Quote Link to comment Share on other sites More sharing options...
sanostol Posted August 13, 2009 Share Posted August 13, 2009 very cool, mrice! another way would be to add a global illumination light set to ambient occlusion to the scene and export a extra imageplane with Cl as vex variable and Your lighttemplate, that has the global illumination shader attached, in the light mask. the renderengine should be micropolygon Martin Quote Link to comment Share on other sites More sharing options...
beeemtee Posted August 13, 2009 Author Share Posted August 13, 2009 Thanks a lot! I will try both approaches. yes, Michael, the avatar is from Mindgame. It's from the scene when god (or whatever it is) tells Nishi that he is dead. I love the whole movie, but that hissy is particularly funny. (ok, it actually resembles me, when I need help badly.) cheers bmt Quote Link to comment Share on other sites More sharing options...
stevenong Posted August 13, 2009 Share Posted August 13, 2009 Great stuff guys! Both approaches are simple and easy to implement. Thanks for sharing! Cheers! steven Quote Link to comment Share on other sites More sharing options...
mrice Posted August 13, 2009 Share Posted August 13, 2009 export a extra imageplane with Cl as vex variable and Your lighttemplate, that has the global illumination shader attached, in the light mask. I keep forgetting how we can do this now in houdini10, thanks! Quote Link to comment Share on other sites More sharing options...
sanostol Posted August 14, 2009 Share Posted August 14, 2009 it is a fantastic tool. I miss it in my other softwares I keep forgetting how we can do this now in houdini10, thanks! Quote Link to comment Share on other sites More sharing options...
dbukovec Posted August 14, 2009 Share Posted August 14, 2009 Also, probably the most simple one is to place an occlusionVOP separately into the surface shader and connect it to an export parameter named occlusion or whatever, and add just an image plane to the mantra node. Since it is not connected to anything, you can copy-paste it into other surface shaders, and you will have an occlusion pass, regardless what is the displacement on all the shaders. Quote Link to comment Share on other sites More sharing options...
beeemtee Posted August 15, 2009 Author Share Posted August 15, 2009 Hi, the solution what Martin suggested is really nice, and easy to setup, the only problem with it that it needs a separate render, what in practice nearly doubles the render time (it will be faster than the original render, since it doesn't use the lights). In this regard Daniel's solution is better since it calculates the occlusion during the main render, but it's harder to setup and needs maintenance. the ideal solution would be a custom light, which would calculate the occlusion and export a custom vex variable. the Cl of this light would be set to zero, to not contribute to the lighting of the scene. unfortunately one can not export arbitrary variables from a light shader, at least i wasn't able to. A value connected to Cl get exported as Cl, but not if using a parameter node as in a shader. Why is that? IMO it would be very useful. bmt Quote Link to comment Share on other sites More sharing options...
mrice Posted August 17, 2009 Share Posted August 17, 2009 unfortunately one can not export arbitrary variables from a light shader, at least i wasn't able to. A value connected to Cl get exported as Cl, but not if using a parameter node as in a shader. Why is that? IMO it would be very useful. You can do that, but you'll need to import the variable in an illuminance loop in your surface shaders to render it. So it's not really the "easiest" way because you'll have to build that into all of your surface shaders. Cl works because its a global variable available to the surface shader. Quote Link to comment Share on other sites More sharing options...
beeemtee Posted August 17, 2009 Author Share Posted August 17, 2009 yep, that's pointless in this situation. thanks anyway! Quote Link to comment Share on other sites More sharing options...
tomhanks Posted August 25, 2009 Share Posted August 25, 2009 Hi guys! Since you are talking about Occlusion pass, I have a question. Is there a way for a object not to cast occlusion on itself? Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.