Page 1 of 1

New ambient occlusion algorithm in 3DMEditor2

Posted: Wed Jan 06, 2010 10:11 pm
by zuzuf
I've just done a commit so the code is now in the SVN repository. It gives good results even though it's not perfect :
Image
Image

It took only a few seconds to build those large light maps using a high level of details (up to 512 rays) compared to several minutes (or hours) with previous algorithm. Also it performs much better when UV mapping is correctly made (3DMEditor's auto UV mapping features currently don't give great results). This is due to the way it works:
N random directions are generated and for each one the object is rendered to an offscreen buffer using texture coordinates as color components with an orthographic camera. The buffer is read in order to compute the texels visible from infinity. At the end you get an estimation of the amount of light each texel receives from infinity :).

It takes almost the same time to compute the light map for small and big models (you can even try with very big models it's still very fast). The only problem is due to rasterization : if a part of a model has a high texture density (higher than pixel density) then its texels may not be detected and this region will be darker than it should.

Re: New ambient occlusion algorithm in 3DMEditor2

Posted: Thu Jan 07, 2010 1:43 pm
by Balthazar
Awesome... Now we need only crush bug fix :P

Re: New ambient occlusion algorithm in 3DMEditor2

Posted: Thu Jan 07, 2010 9:01 pm
by xpoy
Too tired to read topic, but, I love this modle, and, very fast in build this modle?/:^}~!

Re: New ambient occlusion algorithm in 3DMEditor2

Posted: Thu Jan 07, 2010 9:28 pm
by Balthazar
Yeah, very beautiful models... Where are they from? Spring?

Re: New ambient occlusion algorithm in 3DMEditor2

Posted: Thu Jan 07, 2010 10:32 pm
by zuzuf
They are from Spring, someone made those models and posted them on their forum a while ago.
I have other models too, some with UV mapping, some without. Most of them without proper texturing.

PS: I have improved a bit the ambient occlusion algorithm (a few tweaks) and added support for 3DO import

Re: New ambient occlusion algorithm in 3DMEditor2

Posted: Sat Jan 09, 2010 1:42 am
by zuzuf
I've added an improved version of the ambient occlusion algorithm for machines with support for shadow mapping and vertex/fragment programs. This version does everything on the GPU which is much faster (no matter the quality settings I always get the work done in less than a second 8) ). Also this full-GPU version doesn't have the problem the other version has : since it does standard shadow mapping occlusion queries for all texels everything that should be lit is list properly :wink:

Re: New ambient occlusion algorithm in 3DMEditor2

Posted: Sat Jan 09, 2010 5:17 pm
by xpoy
More! /:^]

Maybe we can create a ourself mod, and ask some models owner for use them...

Re: New ambient occlusion algorithm in 3DMEditor2

Posted: Sat Jan 09, 2010 5:20 pm
by zuzuf
Hehe, that more or less what the free resource set is about :P (with goal being to make OTA in HD :) )

Re: New ambient occlusion algorithm in 3DMEditor2

Posted: Sat Jan 09, 2010 5:32 pm
by xpoy
Infact I'm careful leading a big mod plan for multi-game..... Well, at persent there aren't a alpha version for show the goal, but it will be a TA3D/ TA mod..