This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Encodes a float with range [-1.0,1.0] into a color channel with range [0,255] | |
function encodeFloat(f){ | |
if(f<0.0){ | |
f = -f; | |
return Math.min(Math.floor((1.0-f)*127.0),127); | |
} | |
else{ | |
return 128+Math.min(Math.floor(f*128.0),128); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function test() | |
{ | |
} | |
function test2() | |
{ | |
} |
NewerOlder