• Advertisement

Archived

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

a minor Lightmapping niggle

This topic is 5038 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hehe ok, i can post pictures now! Coz i need pictures to illustrate the problem.... its not really a problem, more of a niggle thats annoying me..... Anyway, here is a screenshot of our 3d engine in action, rendering a nice scene. hooray! If you look closely, you can see "seams" of where two polygons join each other. This is caused by the lightmaps being darker near the edges of the polys.... but i can''t quite figure out WHY its darker. Ive tried increasing the resolution of the maps... to no avail. I was wondering if anyone has experienced anything like this, or has an idea of whats going on. Cheers Muncher

Share this post


Link to post
Share on other sites
Advertisement
I did, in my engine (we don't use lightmaps tho). The problem turned out to be bad normals, generated by a plug in.
Are you using normals too, or only lightmaps?
Even if you are using only lightmaps, look for normal problems when you generate them. Furthermore, do you average the normals on a side, to provide a smoother lightmap? If so, try to turn that off.

[edited by - Raduprv on May 9, 2004 9:48:18 PM]

Share this post


Link to post
Share on other sites
i take it the dark edges on the light maps arent present in the light maps themselves?
if so, what settings are you using for your texture clamping? and which card are you testing on?

Share this post


Link to post
Share on other sites
hrmmm i''ll have a look, it could be a normal miscalculation...

But Im not averaging the normals near the edges, in fact the lightmap for each polygon extends past its edges (ie/ the lightmaps are square, but the polys are only triangles).

Share this post


Link to post
Share on other sites
Like _the_phantom_ said, is the problem in the lightmaps as well, or only in the rendered scene?
Do you enable lighting in OpenGL or not? If you do, try to disable it.

Share this post


Link to post
Share on other sites
Card is GeForce3

texture settings are:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE);
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE );

the dark edges are present in the lightmaps: Here is the same screen with only the lightmaps rendered...


Share this post


Link to post
Share on other sites
Can you disable the lightmaps, and use the opengl lighting, to see if it is a normal problem?

Share this post


Link to post
Share on other sites
From what I can see, the normals look good, so try to change the clamping settings?

Share this post


Link to post
Share on other sites
the clamp_to_edge produced the best results. Others made the lightmaps have very strong borders. I can''t think of much else to change without completely diving back into the code and sorting the problem out..... doh,i want a quick fix

Share this post


Link to post
Share on other sites
Is it to hard to make the lightmap not extend past/below the edges?

Share this post


Link to post
Share on other sites
aye, clamp_to_edge is the correct mode you'd want for a light map.

If you look closely at the OpenGL lighted image you can make out a slight band at about the same point the bands are on the light mapped version.. now, this could be down to image compression however it does seem a tad coincidental that that would be the case...

[edited by - _the_phantom_ on May 9, 2004 11:44:55 PM]

Share this post


Link to post
Share on other sites
Yes, but they are not that accentuated as in the lightmaps version...

Share this post


Link to post
Share on other sites
hmmm the fact they exist at all at the same point in the image seems to support the fact there IS a problem, and that problem is probably being made worse by the lower rez nature of the lightmap... at least that is what would seem likely to me..


[Phantom Web | OpenGL Window Framework]
"i wonder why i do that... type words which are nuffin like the word i wanted every now and badger"

[edited by - _the_phantom_ on May 9, 2004 12:02:13 AM]

Share this post


Link to post
Share on other sites
I would guess you have a bilinear texture filtering problem. It can only be solved by your
lightmapper, as the problem comes from how your texture was generated. Your border pixels
have to be *exactly* the same (e.g. color), otherwise you will get visible seams.

Share this post


Link to post
Share on other sites
Whatever you''re doing, don''t blur your lightmaps if your lightmapper gives you this option.

Share this post


Link to post
Share on other sites
yeah, your right phantom, there is that same band on the openGL lit scene. I didn''t realize, i just took the screenshot and didn''t really look closely. I have since looked at it closely (i can post a screenie if ya want... i like pictures) and there is a very distinct line there.

Still, im not quite sure whats causing it. Thanks for your help so far to guys, i really appreciate it.

Muncher

Share this post


Link to post
Share on other sites
If the line is really there (the image is too small, and it can be due to a compression artefact) then check your normals (and/or materials).

Share this post


Link to post
Share on other sites

  • Advertisement