Mip-Mapping Chroma Transparency Textures

blakboks

How do "the ol' pro's" go about doing the mip-mapping on chroma transparency textures? Is there a setting to get good auto mip-mapping (i.e. in the nVidia DDS texture tools). Or do you have to do each level by hand? Or do people typically just not use mip-mapping on these textures?

Thanks in advance again!
 
I had an issue with a grate kind of thing, too far back and it was a solid thing, but as you got closer, the holes showed up, I used chroma for it and just played with the mip bias to tune it. I think I also only used 4 mips, but I can't remember for sure if I did that or just thought it, it was a while ago. But the main thing was just finding that right balance of mip bias and it turned out fine.
I also made the texture's holes straight up and down squares, there was no diagonals. Diagonals and chroma will give an ugly looking edge.
 
I haven't actually played around with mip bias at all yet, as that was one thing I intend to tweak during 'optimization'.

I think I actually found exactly what I was looking for, though. In the nVidia DDS export from Photoshop, if you use 'point' as the mip-map filter method (same as photoshop's 'nearest neighbor' filtering), then it doesn't do any blending, and you maintain the perfectly crisp (albeit aliased) edges (no pink 'halo' if you use magenta as your chroma color)--which doesn't really bother me seeing as it's in the distance, anyway, and overall looks much smoother than no mip-mapping.

However, when I did this and saved it as a DX1 texture, for some reason rF didn't recognize the chroma color, and everything ended up opaque. So, to remedy this, I did DX1 with 1bit alpha, which makes the chroma pixels black, and I just used black as my chroma color in the gTex. It happened to work out fine for me in this instance because none of my solid pixels were black, but I don't know how well it will work if you do happen to have black pixels that you don't want to be transparent.
 
In photoshop under layers, you have rgb layer and alpha layer (if you don't see an alpha layer, click the button top right of layers pane > create a new layer > alpha).
Anything in the rgb layer will not effect transparency weather it be chroma or alpha. Everything in the alpha layer will effect transparency.
In grey scale, black is transparent, white is opaque. grey (if used around the edges) will give you a soft edge on the transparency, but is only effective with alpha transparency in dxt3 and 5, preferably dxt5. dxt1 with 1 bit alpha will only give you 2 colours (shades) in the alpha layer, if its black and white, it will be full opaque or full transparent, if its grey it will be slightly transparent.

Chroma only accepts 2 colours in the alpha layer, anything not white will be transparent (I think) anything white will be opaque.

This probably what you are doing by the sounds of what your saying,,,
If you don't set an alpha layer but have transparent areas in your workspace, then save as dxt1,3 or 5 with alpha, the alpha layer will automatically be generated using the transparency in the workspace. But you should really set your alpha layer up manually.


One other thing I forgot to mention, edge blend was another tweak I used along with mip bias to tune in the chroma transp.

[ED] actually, now I think more abotu it, I think anything in the alpha layer not black will be opaque with chroma. I'd have to do some tests to make sure, I will double check this in a little while.
 
OK I did a test with chroma, anything not white in the alpha channel will be transparent.
 
Actually, you don't need an alpha for chroma transparency. It works in a similar fashion to 'green-screen' technology. You define the RGB values of the color you want to be transparent, and it knocks them out. It's about the oldest type of transparency we've had in games. Even NES games used this type of transparency in their bitmaps. Very often magenta (R 255, G 0, B 255) is used for the chroma color, since it's so rarely used in the artwork. So, since it can only key out one color (and not a range of colors), you're HAVE to have aliased edges, because any pixel other than your chroma color will NOT be keyed out (not even (R 254, G 0, B 255) from the above example. This is why you can't use the typical filters (i.e. triangle) for mip-map generation, whenever it tries to blend the pixels when creating the smaller levels you get non-magenta pixels and subsequently a pink ring around the texture (or whatever color you choose as your chroma).

So, my problems now stem from .dds weirdness. As I said above, when I use a DX1 texture without an alpha my texture comes out fine (or so it appears), however when I set my chroma color to (255,0,255) in the gTex, nothing gets knocked out. I reopened my .dds texture in Photoshop to check to make sure that the .dds compression wasn't affecting the color, so it seems like it's an issue with the way that rFactor uses that texture. I just hope I don't have a need to do a chroma transparency with a texture with black pixels :(.
 

Back
Top