Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float light_f = (float)light / 255.0;
- light_f = pow(light_f, 2.2f); // gamma -> linear space
- light_f = light_f * light_amount;
- light_f = pow(light_f, 1.0f/2.2f); // linear -> gamma space
- if(light_f > 1.0)
- light_f = 1.0;
- light = 255.0 * light_f + 0.5;
- replaced with:
- light = core::clamp(core::round32(light*sqrtf(light_amount)), 0, 255);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement