Archived

This topic is now archived and is closed to further replies.

HellRaiZer

Crappy looking lightmaps!!!

Recommended Posts

HellRaiZer    1001
Help me! I have serious problems with my lightmaps. Problem#1 is that lighting isn't "continues" from polygon to polygon or (problem #2-alternative) lumels aren't aligned to polygons. Imagine two polygons, sharing an edge. Both of them projects to the same axis (lets say yz plane). If i calculate lightmaps, and try to render them (with any type of filtering for the lightmaps), the light intensity on the edge isn't smoothly changed! The two approaches that i (tried to) follow (but they failed both) are: 1) Make a single lightmap for the two, then calculate lumels, and finally calculate lighting. Then render them as normal. This way doesn't have the above problem (#1), but when there are much more polygons "packed" into the same lightmap, first there are many unwanted lumels generated (memory and calculation time waste), and second lumels aren't aligned to polygons' edges (problem #2). This can only be handled when lumel density is very large (say 1 lumel / cm!). But this is unacceptable (at least for me) if i want the rendering to finish someday! 2) Make two lightmaps, one for each polygon. This way there is less (to no) memory waste, because all lumels belong to a polygon (this depends from polygon and patch/lumel shape). But this way problem #1 appears. Because of the filtering (NEAREST, NEAREST just gives patch-render look so it's not acceptable), the change of light across the edge isn't smooth. I can't find a way to solve non of those problems. Any suggestion acceptable. If the problem isn't clear enough, i'll try to upload some screenshots, for you to see it in action (!!!). Just say it. Thanks in advance, and pleeease help me on that. If neseccary i'll change the whole system if needed. I can't handle those crappy looking lightmaps any more. HEEELP! HellRaiZer [edited by - HellRaiZer on August 8, 2003 2:04:27 PM]

Share this post


Link to post
Share on other sites
Yann L    1802
Hmm, I use method number 1, but for even more batched polygons. I initially create locally connected polygon groups (taking into account orientation, convexity, face and vertex normals), and assign a lightmap to a whole group (containing anything between 1 and 5000+ faces). This solves almost all continuity problems. There are still edges that will connect to more than one lightmap, especially on concave meshes, but if you use a consistent world-to-lightmap resolution ratio, then all lumels will be equally large. If the connection is still visible, I simply interpolate between the two adjacent texel rows. That again, solves pretty much 95% of all remaining cases. The real problematic ones will keep a little line, but I can live with that.

About wasting memory: if you pack your lightmaps into larger light textures, by using masking, then the memory waste is kept to an absolute minimum (typically around 2 to 3% of lightmap space wasted).

Share this post


Link to post
Share on other sites
HellRaiZer    1001
Thanks for the reply.

quote:

The real problematic ones will keep a little line, but I can live with that.



Those "problematic" ones, are the reason for this post.
I''ll try to live with them too.
Btw, i also think that the 1st method is more efficient, despite its drawbacks (at least for me). You have less texture bindings.

Forget it!
You see, yesterday my hdd blew up and now i have no code to work with. All my backups where in that drive!!!!! I know this sounds stupid, but since yesterday i never thought that this code is something good to keep it safe. Today i understand what "backup your code" means!!!

Thanks again and when i come to this again i''ll be back

Btw, i think i''ll focus on something else for the time. Something that doesn''t need artistic skills. I''m not an artist and i don''t how any of them to make good looking models for me. Yesterday i tried to texture a little level i made, and it was hell. I don''t like this stuff. I think terrain''s would be fine for starting over!! Lod, Texturing etc. will keep me busy for a while.

Thanks again. Sorry for not posting these earlier, and made you reply to this. I''ll have your opinion in mind when i come to lightmapping again.

HellRaiZer

Share this post


Link to post
Share on other sites