View Full Version : .jpg for normal maps
01-07-2011, 11:32 AM
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.
01-07-2011, 12:27 PM
Adding to what Jan said, strongly consider using RGTC (http://www.opengl.org/wiki/Red_Green_Texture_Compression) 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.
01-07-2011, 01:59 PM
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.
01-07-2011, 02:19 PM
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.
01-07-2011, 02:52 PM
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!
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.