mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
do it on individual channels
This commit is contained in:
parent
cf263a6609
commit
41ec0e8ecb
@ -125,15 +125,19 @@ namespace NewHorizons.Utility.Files
|
||||
// Needs a black border
|
||||
if (x == 0 || y == 0 || x == texture.width - 1 || y == texture.height - 1)
|
||||
{
|
||||
pixels[i] = Color.white;
|
||||
pixels[i].r = 1;
|
||||
pixels[i].g = 1;
|
||||
pixels[i].b = 1;
|
||||
pixels[i].a = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// convert gamma to linear, then invert
|
||||
// outer wilds will invert, then convert linear to gamma (reversing the process)
|
||||
pixels[i] = Color.white - pixels[i].linear;
|
||||
pixels[i].r = 1f - Mathf.LinearToGammaSpace(pixels[i].r);
|
||||
pixels[i].g = 1f - Mathf.LinearToGammaSpace(pixels[i].g);
|
||||
pixels[i].b = 1f - Mathf.LinearToGammaSpace(pixels[i].b);
|
||||
}
|
||||
pixels[i].a = 1; // dont invert alpha
|
||||
}
|
||||
|
||||
// keep this linear. we do our own gamma to linear conversion
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user