It is currently Sat Aug 22, 2020 5:40 am


All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: How to use AmbientOcclusionCalculator to get AO effect?
PostPosted: Wed Jun 15, 2011 3:15 pm 

Joined: Fri Sep 10, 2010 5:38 am
Posts: 30
I am using Ogre+Polyvox to get realtime carving effects. currently the detail needs to be adjusted. So I want to use AmbientOcclusionCalculator to get AO effect with cg Shader. But when I look up to the manual. I totally miss it. So can anyone get me a demo code to have Ambient Occlusion effects to the volume mesh?
PS: I am using Ogre manualObject to generate the final mesh.
Another Problem, I want to smooth the final result of the mesh. So I use smoothRegion function, but have no effects.Only I get is little cubes in the carved area, How to solve it? PolyVox version is PolyVox-GIT-2295971. does it because CubicSurfaceExtractor has built in mesh decimator?
Sorry for so many questions!


Top
Offline Profile  
Reply with quote  
 Post subject: Re: How to use AmbientOcclusionCalculator to get AO effect?
PostPosted: Wed Jun 15, 2011 5:05 pm 
Developer
User avatar

Joined: Sun May 11, 2008 4:29 pm
Posts: 198
Location: UK
pumpkin_zch2u wrote:
I am using Ogre+Polyvox to get realtime carving effects. currently the detail needs to be adjusted. So I want to use AmbientOcclusionCalculator to get AO effect with cg Shader. But when I look up to the manual. I totally miss it. So can anyone get me a demo code to have Ambient Occlusion effects to the volume mesh?
PS: I am using Ogre manualObject to generate the final mesh.
I'll let David give you a detailed answer but I'll point you to some previous discussions in case you haven't seen them (I guess you probably have):
I assume you've managed to run the AmbientOcclusionCalculator and are just wondering how to apply its effects to your rendered mesh?
pumpkin_zch2u wrote:
Another Problem, I want to smooth the final result of the mesh. So I use smoothRegion function, but have no effects.Only I get is little cubes in the carved area, How to solve it? PolyVox version is PolyVox-GIT-2295971. does it because CubicSurfaceExtractor has built in mesh decimator?
Sorry for so many questions!
If you want a smooth mesh I believe you'll have to use SurfaceExtractor rather than CubicSurfaceExtractor. CubicSurfaceExtractor is designed for 'MineCraft-type' scenes whereas SurfaceExtractor is more appropriate for classic smooth terrain.

_________________
Matt Williams
Linux/CMake guy


Top
Offline Profile  
Reply with quote  
 Post subject: Re: How to use AmbientOcclusionCalculator to get AO effect?
PostPosted: Wed Jun 15, 2011 8:11 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
It's also worth noting that there is a unit test which serves as a simple example of using the ambient occlusion calculator:

https://gitorious.org/polyvox/polyvox/b ... erator.cpp

All the ambient occlusion calculator gives you is a 3D array of occlusion values - you will have to take responsibiliy for uploading this to the GPU and sampling it from a shader as discussed in the linked threads. It's also pretty slow at the moment though it may improve in the future.

Also, it probably won't work properly with a density volume - I have only been using it with a cubic mesh. If you want to use a smooth density volume with the ambient occlusion you will probably have to adapt it.


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net