mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-20 05:43:12 +01:00
texturec: Added normalmap BC5 encoding.
This commit is contained in:
@@ -2293,10 +2293,10 @@ namespace bgfx
|
||||
{
|
||||
for (uint32_t xx = 0; xx < width; ++xx)
|
||||
{
|
||||
decodeBlockDxt45A(temp+1, src);
|
||||
src += 8;
|
||||
decodeBlockDxt45A(temp+2, src);
|
||||
src += 8;
|
||||
decodeBlockDxt45A(temp+1, src);
|
||||
src += 8;
|
||||
|
||||
for (uint32_t ii = 0; ii < 16; ++ii)
|
||||
{
|
||||
@@ -2512,10 +2512,10 @@ namespace bgfx
|
||||
{
|
||||
uint8_t temp[16*4];
|
||||
|
||||
decodeBlockDxt45A(temp+1, src);
|
||||
src += 8;
|
||||
decodeBlockDxt45A(temp+2, src);
|
||||
src += 8;
|
||||
decodeBlockDxt45A(temp+1, src);
|
||||
src += 8;
|
||||
|
||||
for (uint32_t ii = 0; ii < 16; ++ii)
|
||||
{
|
||||
@@ -2523,7 +2523,7 @@ namespace bgfx
|
||||
float ny = temp[ii*4+1]*2.0f/255.0f - 1.0f;
|
||||
float nz = sqrtf(1.0f - nx*nx - ny*ny);
|
||||
|
||||
const uint32_t offset = (yy + ii/4)*_pitch + (xx*4 + ii%4)*16;
|
||||
const uint32_t offset = (yy*4 + ii/4)*_width*16 + (xx*4 + ii%4)*16;
|
||||
float* block = (float*)&dst[offset];
|
||||
block[0] = nx;
|
||||
block[1] = ny;
|
||||
|
||||
Reference in New Issue
Block a user