Page 1 of 2

GPU-RAD: Make lightmaps using your gpu

Posted: Fri Jul 16, 2010 8:14 pm
by omaremad
This project is at a very early stage and was mainly written for me to generate indirect lightmaps rather than to create a full artist proof commercial level lightmapper.

It generates lightmaps or indirectmaps(the real intenion) on the GPU and saves them to a texture. Its based on the instant radiosity principle but with a few diffrences from most implementaions to allow it to make savable lightmaps.

here is the evolution of the system:

Image
Image
Image

Here is a demo for you guys to play around with and test your systems.
edit will upload in 10 minutes

Posted: Fri Jul 16, 2010 8:32 pm
by omaremad
Thanks to blindside for the xeffects core (though it uses ESM's which are not currently in xeffects) and pcode for the test mesh.

http://irrlichtirc.g0dsoft.com/omaremad/rad.zip
edit:btw it most likely will fail on ati, bc of my dirty code

SHADER 2.0 cards and above.

Posted: Fri Jul 16, 2010 9:03 pm
by omaremad
if the exe in the zip doesnt work (ati people) use this one

http://irrlichtirc.g0dsoft.com/omaremad/rad.exe

Posted: Fri Jul 16, 2010 9:19 pm
by ACE247
Neat work.
But whats whats horrible lens bending from/for??

Posted: Fri Jul 16, 2010 9:37 pm
by omaremad
Its a left over from the hemicubetests, it can be changed without affecting the algorithm.

Posted: Sat Jul 17, 2010 2:12 am
by BlindSide
Ah I've been waiting to see progress on this, will comment once I've had a good look.

Posted: Sat Jul 31, 2010 11:54 pm
by omaremad
I have added RGAD HDR when processing the lighting so lights can be greater than 255 per component and the radiosity compuations work accrodingly. I also added area weighting so the user can control how many indirect lights are processed for the surface area of the meshes.

Right now its working fine on my hardware, i have no idea how it runs on diffrent machines speed wise and errorwise, therefore i have no incentive to release the source till i know it will work on other machines, meshes etc.... without artefacts.

Posted: Sun Aug 01, 2010 12:26 am
by d3jake
Forgive me if this was said somewhere in this thread and I cannot find it, but with this application, are the lights generated by point\directional light sources, or from faces casting light?

Posted: Mon Aug 02, 2010 5:11 pm
by christianclavet
It work fine on my system. The camera lens are extra-wide but the rendering of the lightmap is rendered properly.

How many lights could you render with your current system? It look pretty neat right now! Is there a special thing to do with the scene (meshes) so the render occur?

Posted: Sat Aug 07, 2010 4:45 pm
by omaremad
All it requires is a mesh with two uv layers with the 2nd layer already unwrapped in a lightmap layout. This program only does radisitity, unwrapping is left to the user, blender has nice scripts for it.

Also the mesh must have a lightmap file assigned to it, even if its a empty image, it just needs to be the resolution and filename you want the output to be.

The algorithm generates radiosity by bouncing light saved in UV space, the light is biunced by creating small virtual lights.

Here is the source, its more for the intrested programmer/ code oreinted artist since it is not a user friendly application, just a radisoity generator.

http://irrlichtirc.g0dsoft.com/omaremad/src.zip

I am planning to use this to create an amazing irrlight TECH DEMO and by tech demo, i mean a proof of concept with artist pipeline to show how people can make amazing realtime scenes with irrlicht.

I already started working on the art assets ill put in the level.
Image

Posted: Sat Aug 07, 2010 4:55 pm
by freetimecoder
Holy Crap :shock:
This will be awesome!

Posted: Sat Aug 07, 2010 5:08 pm
by Virion
niceeeeeeee

Posted: Mon Sep 06, 2010 10:09 pm
by omaremad
Here is an updated source as requested by 3dmodlerman

New Features:
UV tree optimisation for faster model processing
Gamma and improved HDR
Better random sampling(better generator and new seed for every bounce layer)
User definable occlusion angle.
Better edge padding
Memory management and comments
Dynamic scaling(the less light to bounce the faster the calculation)
All shader model 2.0+ suppourted (NV,ATI,Intel)

As always this requires a mesh with 2 uv layers and and assigned textures (including a blank lightmap of the wanted resolution), this is better for the artist anyway since they can unwarp the meshes in whatever way they want for best lightmap desnity.

irrmesh and b3d are good formats for this.

Image
http://irrlichtirc.g0dsoft.com/omaremad/bin.zip

Posted: Wed Sep 08, 2010 11:34 am
by xDan
it looks amazing, of course 8)

Unfortunately I only have shader model 1 :cry:

Posted: Sun Sep 12, 2010 7:29 pm
by devsh
just keep in mind Xeffects is pretty slow, and ofc if you want to have Real Good quality lightmapping, generate spherical harmonics :)