New ambient occlusion algorithm in 3DMEditor2

Everything related to the code /
Tout ce qui touche au code
Post Reply
User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

New ambient occlusion algorithm in 3DMEditor2

Post by zuzuf » Wed Jan 06, 2010 10:11 pm

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.
=>;-D Penguin Powered

User avatar
Balthazar
Moderator
Posts: 2055
Joined: Wed Nov 01, 2006 4:31 pm
Location: Russian Federation
Contact:

Re: New ambient occlusion algorithm in 3DMEditor2

Post by Balthazar » Thu Jan 07, 2010 1:43 pm

Awesome... Now we need only crush bug fix :P

xpoy
Posts: 669
Joined: Mon Sep 22, 2008 3:55 am

Re: New ambient occlusion algorithm in 3DMEditor2

Post by xpoy » Thu Jan 07, 2010 9:01 pm

Too tired to read topic, but, I love this modle, and, very fast in build this modle?/:^}~!

User avatar
Balthazar
Moderator
Posts: 2055
Joined: Wed Nov 01, 2006 4:31 pm
Location: Russian Federation
Contact:

Re: New ambient occlusion algorithm in 3DMEditor2

Post by Balthazar » Thu Jan 07, 2010 9:28 pm

Yeah, very beautiful models... Where are they from? Spring?

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Re: New ambient occlusion algorithm in 3DMEditor2

Post by zuzuf » Thu Jan 07, 2010 10:32 pm

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
=>;-D Penguin Powered

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Re: New ambient occlusion algorithm in 3DMEditor2

Post by zuzuf » Sat Jan 09, 2010 1:42 am

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:
=>;-D Penguin Powered

xpoy
Posts: 669
Joined: Mon Sep 22, 2008 3:55 am

Re: New ambient occlusion algorithm in 3DMEditor2

Post by xpoy » Sat Jan 09, 2010 5:17 pm

More! /:^]

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

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Re: New ambient occlusion algorithm in 3DMEditor2

Post by zuzuf » Sat Jan 09, 2010 5:20 pm

Hehe, that more or less what the free resource set is about :P (with goal being to make OTA in HD :) )
=>;-D Penguin Powered

xpoy
Posts: 669
Joined: Mon Sep 22, 2008 3:55 am

Re: New ambient occlusion algorithm in 3DMEditor2

Post by xpoy » Sat Jan 09, 2010 5:32 pm

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..

Post Reply

Who is online

Users browsing this forum: No registered users and 40 guests