Volumes Of Fun http://www.volumesoffun.com/phpBB3/ |
|
How to use AmbientOcclusionCalculator to get AO effect? http://www.volumesoffun.com/phpBB3/viewtopic.php?f=14&t=226 |
Page 1 of 1 |
Author: | pumpkin_zch2u [ Wed Jun 15, 2011 3:15 pm ] |
Post subject: | How to use AmbientOcclusionCalculator to get AO effect? |
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! |
Author: | milliams [ Wed Jun 15, 2011 5:05 pm ] |
Post subject: | Re: How to use AmbientOcclusionCalculator to get AO effect? |
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? 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): PS: I am using Ogre manualObject to generate the final mesh. 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? 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.
Sorry for so many questions! |
Author: | David Williams [ Wed Jun 15, 2011 8:11 pm ] |
Post subject: | Re: How to use AmbientOcclusionCalculator to get AO effect? |
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. |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |