2 replies to this topic
#1 Members - Reputation: 128
Posted 25 July 2012 - 01:58 AM
Hello again!
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?
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?
Sponsor:
#2 Members - Reputation: 4028
Posted 25 July 2012 - 05:08 AM
If you're also using DXT compression then the data you get back from LockRect will be the compressed version of the texture. You'll need to decompress it back to RGBA if so, and that's where you start getting into patent minefields.
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.
#3 Moderators - Reputation: 14296
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.






