R32f / lockrect -> reading on cpu
Members - Reputation: 128
Posted 25 July 2012 - 01:58 AM
Till now processing r32f at vertex shader wasn't a big deal, but I decided to exlude bmp/jpg heightmaps from my project and replace them with dds version in r32f format, which allows my crappy gpu to do vtf.
I spent some time trying to get proper values from this format and I'm still failing, even though I found lots of conversion methods.
The msdn says that the most important is the red channel, but I don't really get it in terms of reading from lockedrect.
I use standard method of reading data from texture - so each time I take four bytes and I don't really know how to decode it to proper black-white value.
I used to take only red byte and it seemed aaaalmost ok, but there were some glitches on the output height-image. Could someone give me a clue how to take the brightness from these four bytes properly?
Crossbones+ - Reputation: 11248
Posted 25 July 2012 - 05:08 AM
It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.
Moderators - Reputation: 47700
Posted 25 July 2012 - 05:26 AM
I'd personally just ignore the patent issues. HTC isn't going to sue you for decompressing a texture (unless your name is Apple), and even then, they'd lose:
and that's where you start getting into patent minefields
In September 2011, Intel employee Ian Romanick mentioned that the S3TC patent had been marked as invalid in patent litigation between Apple and HTC, the latter of which acquired S3 and all of their patents.