View Full Version : Peculiar 'artifacts' with bumpmapping & mipmapping

04-25-2003, 03:08 PM
I have noticed strange lines on my my lit surfaces that move with the light.
Especially in low resolutions and with moving light-sources they are not nice to look at.

Not until this moment it occured to me that they vanish if I disable mipmapping for both the bump and the color map. Only mipmapping one of those doesn't help either.
Mipmapping was very good for performance and nice for qualitiy, though, which means I don't really want to miss it.

Is there a fix to my problem?
Could it have to do with differing sizes between bump and color map?

Thanks for any advice!

04-25-2003, 04:06 PM
Are you using, at least, trilinear filtering in your mipmapping? That could help, assuming you aren't already using it.

04-25-2003, 06:02 PM
Assuming your MIP maps are normalized, and you're using CLAMP_TO_EDGE (so there's no border color involved) I don't quite see what would cause such an artifact.

04-26-2003, 02:30 AM
Trilinear filtering doesn't help (I was using it already).

When I used clamp to edge my texturing is screwed up but the lines remain.

What do you mean by normalized MIP maps?
That sounds interesting. Thanks!

04-26-2003, 07:51 AM
The normals in your normal maps needs to have a length of one for bumpmapping to work correctly, if you just calculate your mip levels by averaging this will not be the case in general, so you need to renormalize.

04-26-2003, 10:52 AM
If you're using the texture mode GL_REPEAT, another thing you'll have to check is that the normals in the mipmaps "wrap" correctly.

Suppose you made your full-size normalmap from a perfectly tilable grayscale bumpmap. If you computed the normals on the edges by looking to the other side of the bumpmap, your normalmap will also wrap correctly. However, if all you do to create your mipped normalmaps is resize and renormalize, your edges won't wrap perfectly anymore. You have to actually compute the normalmap mipmaps from the bumpmap mipmaps. Make sense?

-- Zeno

04-27-2003, 12:29 AM
Hmmm, OK. I did not create the normal map myself.
Could you tell me how to renormalize it?
Will this also work with automatic MIP mapping like GL_GENERATE_MIPMAP_SGIS ?

What confuses me, though, is the fact that I have to disable MIP mapping for _both_ the color and the normal map. If I just MIP map the color map the problem remains. In this case renormalizing wouldn't help either?

Thanks for the help!

04-27-2003, 07:42 AM
auto-generation of MIP maps does not re-normalize the normals stored in the normal map.

I'm assuming you know what a "normalized" vector is, and understand why each texel in a normal map needs to represent a normalized vector? And how such a vector is represented in an RGB triplet?

04-27-2003, 08:00 AM
Originally posted by jwatte:
I'm assuming you know what a "normalized" vector is, and understand why each texel in a normal map needs to represent a normalized vector? And how such a vector is represented in an RGB triplet?
I know what you are talking about, at least I think so.
But auto-mipmapping is really comfortable on the one hand, and on the other I don't even know how to make my own mipmapper. Can I just feed the mip-maps to OGL and everything is auto from then on, with Trilinear filtering and everything or do I have to do all by myself? Sounds painfull, but if you have any info on this I'd be gratefull.

One thing I'd like to say again is that when I do not MIP map the normal map but the color map I still have those lines. Isn't this strange?

If you are interested I would gladly provide a screenshot via e-mail (as I don't have any webspace).
Thanks for the help!

04-27-2003, 08:06 AM
you should read "A practical and robust bump-mapping technique for today's GPUs"

Its at Nvidia's, and I think the file name is bumpmap.pdf
It;s one of the best documents on the subject.
It is well explained with source code.

PS: There is no guarantee your lines will disappear since I had a problem like this on a certain card, but not on the new version of the same GPU. I'm not certain if this is my fault or the card so I wont say anything further.

04-28-2003, 07:06 AM
I have now decided to try the renormalize approach. I am now perfectly aware of the way to make my own mipmaps, it wasn't so bad as I feared. I do not have any good plan about the actual renormalizing yet and I also fear that my efforts will be in vain.
Anyway I have to try.
Thanks everybody for the help and the hint to read that paper, it seems pretty nice indeed!

[This message has been edited by B_old (edited 04-28-2003).]