Marcelo's Lightmapper Question

Blitz3D Forums/Blitz3D Programming/Marcelo's Lightmapper Question

Craig H. Nisbet(Posted 2003) [#1]
I've been using Marcelo's lightmapper from the code archive. It's really incredible! I am having one problem, and I wanted to see if anyone else is using this and has had a similar issue. I'm my program, I use both b3d files in constructed meshes(polygon by polygon) that are lightmapped. The meshes are static of course. The constucted meshes(inverted cubes) are build the same why the skybox is made in the castle demo that came with Blitz 3D. The lightmap generation for all the meshes goes great and it look incredible, but when I try to have the library load the maps back onto the meshes from the files it creates, the b3d files load the maps perfectly, but the constructed meshes don't. Actually what it looks like, is that it is somehow messing up the UVs on the meshs. It doesn't seem to have this problem with b3d's of primitives like cubes and spheres. Anyone run into this problem. I know it's a longshot, but I thought I would try. Thanks.


Ice9(Posted 2003) [#2]
You have to use surface ID's. If your mesh has multiple surfaces the surfaces don't get ordered the same way each
time you load them. Look at swifts version of YAL in the code archive .. there are two fingerprint functions in there to determine if a surface is the correct surface.
Because no two meshes will occupy exactly the same space,
idealy, you get the global coordinates of each vertex and use some creativity to put them all together to make a unique number that represents the surface then store that in the lightmap info so when you load it you can use the same algorithm to check and see which surface gets which coordinates.