PDA

View Full Version : Problem with lightmaps



Spark
03-22-2001, 12:37 AM
Hi,

I have a problem with my lightmaps that I can't find any good solution to:

The edges of the triangles doesn't blend into the edge of the triangle next to them becasue they don't use the same lightmap. How to solve this problem? All commercial engines I have seen doesn't have this problem.

// Spark

andreiga
03-22-2001, 03:05 AM
Originally posted by Spark:
Hi,

I have a problem with my lightmaps that I can't find any good solution to:

The edges of the triangles doesn't blend into the edge of the triangle next to them becasue they don't use the same lightmap. How to solve this problem? All commercial engines I have seen doesn't have this problem.

// Spark

First you have to have the same size of the texture maps. Second, when you generate the maps make sure you don't have any bandings at the edges. Third, disable the mipmap and see if the problem still exists (mipmaps are calculated as weighted average of the sourunding pixels and if the pixels nearby the pixels at the edges are not the same the two averages are different). And fourth, but not the last thing you can try, make sure you use the wrap mode and make sure the filtering is not having above the problem of the mipmaping.

Spark
03-22-2001, 04:44 AM
but that doesn't solve the problem, I need the lightmaps to blend into the lightmaps that they are connected to, this is the only way to make them smooth, right?

Tom Nuydens
03-22-2001, 05:29 AM
You should use GL_CLAMP, not GL_REPEAT for the lightmap's wrapping mode. Mipmapping shouldn't hurt, nor should filtering. If the wrapping mode isn't the culprit, make sure your lightmaps are being generated correctly.

If you're still at a loss, could you post a screenshot of your problem somewhere (or e-mail me one)?

- Tom

Don't Disturb
03-22-2001, 05:31 AM
You simply need to make sure that the lightmaps are identical at the edges.
Example of something that would look correct:

## ## ######
# ### ## #
## # ###
## ## ## ###Example of something that would look incorrect:


## # ######
# ### # #
## ## ###
## ## # ###This should solve your problem.

[This message has been edited by Don't Disturb (edited 03-23-2001).]

andreiga
03-22-2001, 08:55 AM
Originally posted by Tom Nuydens:
You should use GL_CLAMP, not GL_REPEAT for the lightmap's wrapping mode. Mipmapping shouldn't hurt, nor should filtering. If the wrapping mode isn't the culprit, make sure your lightmaps are being generated correctly.

If you're still at a loss, could you post a screenshot of your problem somewhere (or e-mail me one)?

- Tom

Mipmapping doesn't heart? Then if you're using a, let's say, 16x16 mipmap level of an original ligthmap texture of 64x64 texture
the nearest lightmap should be identical in order not to have any problems.
And if the view of the polygons is very anysotropic you get lots of pixels which are using lower mipmaps levels.

very

Tom Nuydens
03-22-2001, 11:56 AM
Sorry, but until you show me a screenshot that says otherwise, I'm not going to believe that mipmapping can cause lightmapping artifacts http://www.opengl.org/discussion_boards/ubb/smile.gif

Why would it mess up lightmaps but not regular textures?

- Tom

Don't Disturb
03-23-2001, 10:56 AM
Whoops, you're right. Mipmapping won't cause any problems. I have edited my post accordingly.