Created
November 10, 2021 04:21
-
-
Save behreajj/62a5e8d29e60f8955fec4feafa8f5873 to your computer and use it in GitHub Desktop.
Linear Gamma Luts
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
byte[ ] stlLut = new byte[256]; | |
byte[ ] ltsLut = new byte[256]; | |
for (int i = 0; i < 256; ++i) | |
{ | |
float x = i / 255.0f; | |
float y = StandardToLinearChannel (x); | |
stlLut[i] = (byte) (0.5f + 255.0f * y); | |
float z = LinearToStandardChannel (x); | |
ltsLut[i] = (byte) (0.5f + 255.0f * z); | |
} | |
Debug.Log (stlLut[127]); | |
Debug.Log ((int) (0.5f + 255.0f * StandardToLinearChannel (0.498f))); | |
Debug.Log (ltsLut[127]); | |
Debug.Log ((int) (0.5f + 255.0f * LinearToStandardChannel (0.498f))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment