Sunday, January 15, 2012

Aaaarrrghhh! Patents!!!!

I've added DXT texture support to RMQ, with the intention of helping to reduce download sizes and speed up load times, but an obvious question arises: what if the end-user's hardware doesn't support the required extension?

My initial thought was to unpack the DDS to an RGBA format and upload that instead. We still get the reduced download size, and the player can play the game.

However, it appears as though unpacking a DXT compressed texture is patented. Now, it may be the case that the patent may be invalid, but who wants to take that risk?

Currently I have a few options.

I could drop DDS support altogether. Goodbye smaller downloads, goodbye faster loading, but the problems go away.

I could implement an alternative - like DarkPlaces does - and unpack to a lower resolution and lower-quality representation.

I could round-trip through an unpatented format (like S2TC) before unpacking.

I could enforce hardware support for compressed textures as a technical requirement.

None of these are ideal, and all of them provide a poorer experience for the player than what I would like. Currently I'm round-tripping, but quality drops off a little (I run a despeckle filter after the round-trip to reduce the worst of that) and there is an obvious increased load time. What I'd really like to do is just make the patent go away. We're obviously not out to make any money from this, and patent enforcement of this kind just makes the consumer suffer.

What really kills me is that I could do this legally in a handful of lines of D3D code - load the DDS texture into the scratch pool, create a regular texture as normal, get both of their level 0 surfaces and use D3DXLoadSurfaceFromSurface to transfer.

2 comments:

Anonymous said...

Aren't you making too big of an issue out of this? Also is having the hardware requirement an issue? I mean, hasn't DXT compression been widespread for the past 10 years or so?

mhquake said...

The issue is with open-source Linux drivers that may not include it - owing to it's patent status.

If I can get a confirmation that it's a non-issue for them I'd happily shut the door on this, but otherwise it's important for RMQ which needs to be cross-platform.