Skip to content

Instantly share code, notes, and snippets.

@pajlada
Created July 8, 2014 10:41
Show Gist options
  • Save pajlada/cdc18051cf39fb9f776b to your computer and use it in GitHub Desktop.
Save pajlada/cdc18051cf39fb9f776b to your computer and use it in GitHub Desktop.
half-unpack
local v = this:read(0)
v = v * 2.0
if v >= 1.0 then
this:write(0, v-1.0)
this:write(1, 0.0)
else
this:write(0, 0.0)
this:write(1, 1.0-v)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment