Lightmapping on the Fly?

Blitz3D Forums/Blitz3D Programming/Lightmapping on the Fly?

YellBellzDotCom(Posted 2006) [#1]
I have been going over shadowing for a while now and looked at every piece of code I could find. The problem is, I only understand less then 1% of the code.

What I have is a terrain created from TED, lightmapped already with trees, buildings, etc. I really need to get some shadows projected from my characters though.

While all the code and demos I found looked great I couldnt implement them into my game, demo's used Loadimage terrains where I use a mesh terrain, etc.

I was wondering if it would be possible to create a lightmap of the scene and overide the previous one. A newer lightmap would account for sun direction changes, character and npc changes, cast shadows accordingly, save it as a lightmap then overide the previous existing one to show all the updated shadows. This would have to occur every flip of course or maybe stagger it so it doesnt eat up your pc? I have a feeling that yous will all tell me that this would be too CPU/GPU consuming though or else wouldve already been done.

I would love Swifts Shadow System, but Im broke from the DarkBasic Pro days, lol.

I may have to resort to the blob shadows for moving entities.

Ok, thanks, bye.


YellBellzDotCom(Posted 2006) [#2]
Ok, I found out myself, lol. Using YAL, it took over 30secs to lightmap a simple box with a sphere.

Back to searching...


IPete2(Posted 2006) [#3]
Xyle,

It is not possible to use B3d to lightmap on the fly. Period.

Actually I would be surpriesed if any language could light map on the fly a decent sized level in a game. There are just much better ways of getting the same result - in fact better results.

Swifts shadow system would be okay for characters, there's also a thing called towel shadow somewhere in the archives by...er.. Rob I think. Check that out for another way.

Also look into the other shadow systems which abound currently.

IPete2.


YellBellzDotCom(Posted 2006) [#4]
Thanks for the info there IPete2. I have spent the last few days scouring the archives and posts about shadowing and of course, cant seem to grab the ideas. Alot of the examples and demos are way out of my league using very complex functions and methods or math that I dont understand.

As for Swifts, the demo looked great, but I really cant purchase any more 3rd party solutions.

I did see the towel system and it looked great, I may play with this more as my understanding progresses. Thanks for the help there. Again, I apologize for not posting this in the beginners forums, I need to go there and play with kids my own age, lol.


puki(Posted 2006) [#5]
You can switch light maps for a sort of light on/off or shadow/no shadow effect.

I've not put it into practice but it is probably as far as you can go for static objects/lights.


YellBellzDotCom(Posted 2006) [#6]
I looked over some lightmapping techniques in the code archives and they were way beyond me. The idea was to create a lightmap of the scene, render the scene with the lightmap, move characters, create a new lightmap, then render the scene again.

In reality this theory is similiar to ShadowMapping, but shadowmapping is alot simpler.
Load Scene
Create Shadowmap image from Light Perspective
Render scene in all shadow
Compare pixels of scene with image to see whats visible
Render scene again but dont update any "blocked" pixels, sot they stay shadowed from the shadow render.

errr something like that anyways. This seems to be the method Im looking for but as of right now Im still at the Blob Shadow stage, lol.