.jpg for normal maps

I’ve read about some sharp-eyed people here in these forums noticing when someone was using a .jpg texture, but is it safe to use for a normal map? My normal maps are the usual 3 color (i.e. 24 bit) textures. Is your sight so good, that it can discern between a .png and a .jpg normal map? I mean, the accuracy of this basic normal map isn’t so good anyway, it has just 8-bits per normal component.

Ugh. Do not use jpegs to store normalmaps!

Artifacts in normals are MUCH more visible than artifacts in a diffuse texture. While jpegs might sometimes be good enough for diffuse textures, your normal-maps will definitely suffer heavily under this kind of compression.


Adding to what Jan said, strongly consider using RGTC if you need compression for normal maps. It’s a two channel format, and you just use a rsqrt in the shader to reconstruct the normal.

By diffuse textures you probably mean the color textures I plaster on my models?

Because I am using the normal map to calculate the diffuse lighting component, the dot(L, N) Lambert lighting component, so I am a bit confused.

The Lambertian diffuse lighting equation is as follows:

D * I *dot(N, L)

Where N is the surface normal at the point of interest, L is the direction from the point of interest to the light, I is the light intensity (or color, if you wish to think of it that way) that reaches the surface (which itself may be attenuated by distance), and D is the diffuse reflectance characteristics of the surface at that point. Or diffuse color, if you prefer. A surface looks green under white light because it absorbs all non-green wavelengths of light, reflecting only the green.

A texture is just a look-up table. It can define any of these values, or any value from any other equation. Or other things. A texture who’s contents represent the surface normal at a particular point is usually referred to as a normal map or normal texture. A texture that provides the diffuse reflectance of the surface at a particular point is usually referred to as a diffuse map or diffuse texture.

In my case, I only use the cosine/Lambert term i.e. dot(N, L), nothing else; it is blended onto a surface (because of reflection and the fixed pipeline I’m using). So I see: diffuse texture, another name for color texture, or better diffuse reflectance/color texture. Thanks!