GPUOpen-Tools / compressonator

Tool suite for Texture and 3D Model Compression, Optimization and Analysis using CPUs, GPUs and APUs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

new question?

y2keeth opened this issue · comments

commented

is it possible to do RXGB dtx5 uncompressed?

@y2keeth As mentioned in the other issue you opened (#251), Compressonator can decompress DXT5 RxGB textures into formats like RGBA8888. Hopefully that does what you want.

@y2keeth The only engine that uses RXGB is Id Tech 4 ( Doom 3 etc ). In that engine, uncompressed normal maps are just standard RGBA TGA images. The compression algorithm swizzles the Alpha and Red channels either on-the-fly or when baking local files ( or existing pre-baked images in the pk4 pack files ). Are you asking whether compressonator will decompress RXGB back to RGBA with the data swizzled back to normal or leaving the data in it's swizzled design so the alpha channel still holds the red data (etc) ?

commented

yes working with id tech 4 games trying to get the absolute highest quality dds for that engine
https://www.moddb.com/members/y2keeth/mods

commented

@y2keeth The only engine that uses RXGB is Id Tech 4 ( Doom 3 etc ). In that engine, uncompressed normal maps are just standard RGBA TGA images. The compression algorithm swizzles the Alpha and Red channels either on-the-fly or when baking local files ( or existing pre-baked images in the pk4 pack files ). Are you asking whether compressonator will decompress RXGB back to RGBA with the data swizzled back to normal or leaving the data in it's swizzled design so the alpha channel still holds the red data (etc) ?

yes something like that I think

@y2keeth this is an either \ or question. As I understand it, compressonator will export RXGB back to a standard RGBA tangent space normal map in tga or another RGBA format. If it returns a swizzled result, that would be considered a bug since that is not the intended format conversion. So the question is "do you want to decompress back without de-swizzling?" Yes means a non-standard result. No means you want the expected result. If the latter is not happening then this is a bug.

commented

sorry about the bug report I know its not a bug, only way i could figure out how to ask a question
I am not completely sure what i want sorry, as close to a uncompressed RXGB i can get
or the highest quality that will work for idtech 4 games
I thought uncompressed with a RXGB swizzle would be possible

commented

I closed my other ones fyi and will this one when we are done talking

Vanilla Doom 3 does not support a swizzled operation on the uncompressed textures and most would argue there is little benefit there since it is not a lossy format that needs extra protection against artifacts. If you want better normal maps than what is shipped with Doom 3 there are some options though.

  1. Replace the vanilla shader with one that does a better slope reconstruction and renormalization such as this one from Mh ( Method ):

mh_doom3_interaction_vertex_shader.txt

Relevant code block

# perform the diffuse bump mapping
# instead of using the normalization cube map, normalize with math
DP3 light, tex0,tex0;
RSQ light, light.x;
MUL light, light.x, tex0;
#-----------------

TEX localNormal, tex1, texture[1], 2D;
# MOV localNormal.x, localNormal.a # normal map compression hack - is this the only shader they're used in????;
MAD localNormal, localNormal, scaleTwo, subOne;
DP3 light, light, localNormal;

The shader assumes you will never use Doom 3 normal map compression though.

  1. Upscale the normal map tga files properly then use a program like njob to enhance the depth

  2. Import the normal maps into a modelling app that can convert them to heightmaps then sculpt the resultant geometry and bake new normal maps

  3. Convert the normal map to a hightmap then use Photoshop \ Gimp to make taller areas brighter and recessed areas darker then convert back to a normal map

commented

thanks
I will definitely have to try that for the normals

but I am trying to get the dds textures good enough to replace the tga's on doom3, and quake4, and prey on all the textures.

my quake 4 mod is 30gb and my doom3 is getting close to that and prey as well they are to big lol

As I recall, RXGB DDS is at least quarter of the size of TGA ( or lower ) so even if you upscale 2x you will have less than half the storage requirements. I think most modern DDS encoders dither so banding artifacts in compression should be minimized but you can always try pre-dithering before compression and see how things turn out. Sadly, even though RXGB encoding has improved somewhat over the years, there is no dedicated group really pushing the limits the way that L.A.M.E. mp3 encoding folks are constantly improving mp3 encoders by doing blind A\B testing. ATI \ AMD invented "3Dc" normal map compression and it was added to DirectX 10 as "BC5". Almost all engines that use normal maps use BC5 now.

Another thing you can try is to encode to DXTnm then change the metadata to show as RXGB. Supposedly since DXT5nm blanks out the blue channel color channels the encoder does not need to do a 3 way comparison and is able to dedicate even more storage to Red and Green. Never heard of someone trying this though. Should work in theory as long as blue is neutral brightness at the end of DXT5nm encoding. Might be a nice enhancement for compressonator to add "blank blue channel" to RXGB compression so that it just stores a single neutral blue pixel in the encode and says "repeat this". Of course, the improvement might be negligible if the encoder already detects neutral blue in the source image at the start of the encode and handles that sensibly anyway.

commented

things to try thanks the other nice thing about dds, is it zips up nice and smaller even uncompressed
also my upscales are 4x in tga that gets real big fast

commented

bc3 is another option I just found out

commented

RXGB with the argb_8888 compression is that possible?

commented

@y2keeth As mentioned in the other issue you opened (#251), Compressonator can decompress DXT5 RxGB textures into formats like RGBA8888. Hopefully that does what you want.

thats not bad, RXGB with the argb_8888 compression would be perfect i think