3dc texture compression

What it says on the tin: a place to discuss proposed new features.
Post Reply
BundesWehr4
Gnoblar
Posts: 2
Joined: Mon May 07, 2007 7:40 pm
Location: Moscow, Russia

3dc texture compression

Post by BundesWehr4 »

I think, OGRE need 3dc texture plugin( or, modyfy existing dds codec ).
3dc is the technology presented by Ati, it can compress textures up to 1:3 without any graphic data loss.
http://ati.amd.com/products/radeonx800/ ... ePaper.pdf
If 3dc is not supported by hardware, image must be converted to DXTC
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Post by Kojack »

3dc is the technology presented by Ati, it can compress textures up to 1:3 without any graphic data loss.
Actually it's 1:4 compression, and there's definitely graphics data loss. It's still a lossy format, it's just not as lossy with 2 channel data as dxt is. Plus you need custom shaders to deal with it, since to treat the texture as a normal map will require the z component to be generated per pixel in the fragment shader.

It would be good to support it though.

The dds plugin might be able to be expanded to handle it. I just tried using ati's texture tool to save a dds with a 3dc texture inside. The microsoft directx dds viewer thinks the file is invalid.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Thought about it a couple of times, but no-one except ATI have ever implemented support for it so I'm dubious as to the practical value of it generally. If it's really so great, why haven't any other GPU manufacturers implemented it as happened with S3TC / DXTC?

A more universal approach is to use the DXT alpha block trick: http://http.download.nvidia.com/develop ... ession.pdf - that works on all cards.
User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
x 13
Contact:

Re: 3dc texture compression

Post by sparkprime »

I believe there is now wide-ranging support for this... I read this page and it seemed that 3dc is much better than the alpha/green trick:

http://www.ozone3d.net/tutorials/bump_m ... ession.php

Is it worth implementing in OGRE now?
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Re: 3dc texture compression

Post by sinbad »

If by "wide-ranging" you mean "ATI cards", yeah ;)

The latest nvidia cards & drivers still don't support this (or at least, it's not showing up on my GL extensions) and the extension hasn't been picked up by ARB for inclusion. It's still vendor-specific, anyone using it would have to include an alternative uncompressed normal map in their media too.

BC7 (Dx11) has a much better chance of becoming standard in this area I think, although I don't know when that will be exposed in GL.

[edit]Ok allegedly it's supposed to be supported now, but why can't I see it in GL? Maybe it's just via the Dx9 hack.
[edit2]Right, according to this http://developer.nvidia.com/object/real ... ssion.html 3dc can actually be loaded via GL_EXT_texture_compression_latc or GL_EXT_texture_compression_rgtc - so yeah this is actually possible now. Both have an ARB equivalent, although bizarrely my 9800 reports support for GL_EXT_texture_compression_latc but not GL_ARB_texture_compression_latc. Bizarre.

Anyone volunteering for this?
User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
x 13
Contact:

Re: 3dc texture compression

Post by sparkprime »

Ah good that you looked it up as I hadn't done the homework :)

I could do it in principle but I have a big queue of other stuff and it has to be low priority ATM as we can just not compress them as a temporary workaround. I also don't know what would need doing. It would need tweaks to all the render systems as well as additions to the texture management system, and DDS codec? How long do you think it would take *you* and I'll try and use that as a gauge :)
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Re: 3dc texture compression

Post by sinbad »

It would need format detection (magic number) and potentially extension detection (not sure if there's an accepted extension for these), plus detection of the compression format and enabling of it in Dx9 and GL. Finally, there would need to be a codec for decompressing it to a regular uncompressed texture as a fallback for cards that don't support it.

Probably a day or two to write and test all the codepaths on a few cards I'd say. I'm in a similar position with my TODO, I might be able to get to it after 1.7.0 final is done though.
User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
x 13
Contact:

Re: 3dc texture compression

Post by sparkprime »

If you're talking about recognising files by extensions and such, it makes me think there is some kind of 3ds file format that exists independently of the 3ds textures you can put in dds files. I didn't know of such a format but I suppose it might exist. Is there any reason to support such a format? If you're going to use texture compression you're probably going to want mipmaps and the other features dds provides, no?
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Re: 3dc texture compression

Post by sinbad »

Yes, I just didn't know if there was a 3dc-specific format - if not, that makes things potentially simpler.
User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
x 13
Contact:

Re: 3dc texture compression

Post by sparkprime »

It'd be really great to have this. I think neoaxis even implemented it in his OGRE fork.

*please* *please* *please* someone implement it :)
Post Reply