쉐이더가 아닌 곳에서 이 방법을 쓰게 되었다. -_-ㅋ
(손실 압축)
http://www.gpwiki.org/index.php/MathGem:Color_Operations
>>
Original
5, 4, -3
[-1:1] <- Normalieze
0.707107, 0.565685, -0.424264
[0:1] <- Prepare to encode { x` = (x+1)/2 }
0.853553, 0.782843, 0.287868
Compressed Vec3 { x` = x * 255 }
217, 199, 73
Compressed 4 BYTE
ffd9c749
... Now restore value ...
DWORD -> 4 BYTE
217, 199, 73
[0:1] <- Prepare to decode
0.85098, 0.780392, 0.286275
[-1:1] <- Normalize { x = (x`*2)-1 }
0.701961, 0.560784, -0.427451
'Graphics' 카테고리의 다른 글
Normal Transform (0) | 2010.09.07 |
---|