Lightmapping

Blitz3D Forums/Blitz3D Programming/Lightmapping

Craig H. Nisbet(Posted 2003) [#1]
Is there a good resource out there on how to do lightmapping. I'm not interested in an editor that has lightmapping. I would like to code the renderer myself into my program, or use a library for it. Any ideas?


Ricky Smith(Posted 2003) [#2]
Might be a good place to start :

http://www.blitzbasic.com/codearcs/codearcs.php?code=514


:)


jhocking(Posted 2003) [#3]
Look for YAL in the Code Archives.

Oh wait, that's what Smiff linked to. Yeah, that's what you want.


Craig H. Nisbet(Posted 2003) [#4]
Wow the code in the archive is amazing! I'm having a weird problem implementing it though. It seem to render and apply the light brightness to the surface, but it doesn't seem to be capturing the shadows. My program has gotten pretty large, so I wouldn't be shocked if it was just something dumb I did. Has anyone run into this using this lib?


Bot Builder(Posted 2003) [#5]
http://freespace.virgin.net/hugo.elias/ <---- has a good article about radiosity lightmapping if your interested in doing realistic lightmapping.


Akat(Posted 2003) [#6]
but that way explode every polygons... i dont like it


Marcelo(Posted 2003) [#7]
Craig, at the LightMapMesh() function comments:

- The world objects must have EntityPickMode() set to produce shadows.


Akat,
It explodes the poly's but weld it back again after the process.


Craig H. Nisbet(Posted 2003) [#8]
Wow, that's it! Thanks a bunch! You guys rock!


Craig H. Nisbet(Posted 2003) [#9]
Hey, I have a question. Is the entitypick command slow? I'm considering using it as a sort of line of sight system.


jhocking(Posted 2003) [#10]
Relatively slow. But that just means you shouldn't call it too many times in a single frame. If you only need to check line of sight for one character (or only a couple at most) then you don't have any problem. For lots of characters don't check line of sight for all of them in the same frame. Instead stagger the checks; only check line of sight for a couple characters every frame. Assuming you have a high enough framerate (ie. playable) nobody will notice that the checks are staggered.

To put it in perspective, I check line of sight using LinePick (essentially the same as EntityPick) four times per frame and there's little framerate hit.