alpha channel in normal map (xPS1.1)

Started by
6 comments, last by mikiex 18 years, 11 months ago
What can I do with the alpha term in a normal map on xPS1.1(xbox) hardware? Occlusion? I could use the alpha term to modulate the final color. Any other ideas?
Advertisement
Assuming you're talking about DXT5 compressed texture?
Ambient occlusion, specular power, specular intensity and so on.
This all depends on the other per pixel data that you have and your lighting model. If you're doing tangent space normal mapping you could use the alpha to get extra high precision, i.e RGB = (0, X, 0), A = Y Z = sqrt(1 - X * X - Y * Y).
Doing punch-out transparency (alpha test). The possibilities are endless :)
I don't have to DXT5 compress the texture. I'm using it as is (ARGB 8888) as to avoid the slower instructions (sqrt) and to get higher image quality.

I am doing tangent space normal mapping. If I'm doing (baked) ambient occlusion, I'd just modulate the resulting r0 by the alpha, no?

My lighting model doesn't involve specular. Oh well too bad.

What's this about getting high precision? Storing two channels and calculating the third component?

What's punch out transparency?
Punch out transparency is transparency where some pixel is either fully transparent or fully opaque. This can be done by alpha testing and cuts out some pixels of a rendered triangle when the alpha value comes from a texture.

The trick with DXT5 is that it compresses the alpha channel seperatly and so there are much less compression artifacts when you do:

r=x
g=y
b=0
a=z

Setting b=0 gives the compressor more freedom. The green channel has a higher resolution than red and blue so it should be used too. You can use swizzles to get the desired result r=x,g=y,b=z in the shader later without much overhead if any.


When you do not use specular stuff the compression artifacts will probably be much less visible. What's best depends on your specific lighting model. May be you should explain what you are up to.
What's the benefit of using DXT5 compression other than having faster texture swapping? (In my system, the normal map is loading into video ram once and it'll never be moved.)

Couldn't I do punch out transparency with the alpha channel from the color map?
Using DXT compression on normal maps is not a good idea.

Use the alpha as an ambient occlusion for simple hemisphere lighting model.
EvilDecl81
Quote:Original post by EvilDecl81
Using DXT compression on normal maps is not a good idea.


That's why I avoided it and am using ARGB8888.

Quote:
Use the alpha as an ambient occlusion for simple hemisphere lighting model.


How would I handle that term in the pixel shader? Just multiply with the result color?



I know you said your not using specular, but it is a good place to put it in the alpha... or you could use it for bump for parallax mapping.. dunno about in 1.1 tho

btw in some cases DXT compression on a normal map doesn't look too bad when
you have the colour map present - its more obviously bad when the colour map
texture is not there or is flat colour.

there are also swizzled formats such as 3dc to improve on the problems of dxt

DXT is worth it, if your going to run out of texture memory soon :)

This topic is closed to new replies.

Advertisement