mirror of https://github.com/Chlumsky/msdfgen.git
GPU-like pixel conversion
This commit is contained in:
parent
d034a702eb
commit
75813f37b3
|
|
@ -6,7 +6,7 @@
|
||||||
namespace msdfgen {
|
namespace msdfgen {
|
||||||
|
|
||||||
inline byte pixelFloatToByte(float x) {
|
inline byte pixelFloatToByte(float x) {
|
||||||
return byte(clamp(256.f*x, 255.f));
|
return byte(~int(255.5f-255.f*clamp(x)));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline float pixelByteToFloat(byte x) {
|
inline float pixelByteToFloat(byte x) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue