Jump to content
  • Advertisement
Sign in to follow this  
XBoy

alpha channel in normal map (xPS1.1)

This topic is 4848 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Using DXT compression on normal maps is not a good idea.

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

Share this post


Link to post
Share on other sites
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?



Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!