Problem with lightmaps

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

Originally posted by Spark:
[b]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[/b]

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.

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?

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

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).]

Originally posted by Tom Nuydens:
[b]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[/b]

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

Sorry, but until you show me a screenshot that says otherwise, I’m not going to believe that mipmapping can cause lightmapping artifacts

Why would it mess up lightmaps but not regular textures?

  • Tom

Whoops, you’re right. Mipmapping won’t cause any problems. I have edited my post accordingly.