Skip to content

[KK] Add TextureUtils.CorrectColorSpaceForKoikatu for KK UI textures - #113

Merged
ManlyMarco merged 2 commits into
IllusionMods:masterfrom
Lusiocc:fix/kk-linear-colorspace-textures
Jul 9, 2026
Merged

[KK] Add TextureUtils.CorrectColorSpaceForKoikatu for KK UI textures#113
ManlyMarco merged 2 commits into
IllusionMods:masterfrom
Lusiocc:fix/kk-linear-colorspace-textures

Conversation

@Lusiocc

@Lusiocc Lusiocc commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Description

KK (Unity 5.6, Linear) samples sRGB UI PNGs too dark. Add a public gamma-LUT fixer (KK-only, no-op elsewhere) and apply it to the InterfaceMaker skin.

Motivation and Context

KKs VE window and IMGUI windows in general were too dark.

How Has This Been Tested?

KK and HS2 satrted and checked if colors are correct.

Performance test:

Size Pixels Iters M2 Color32+LUT
VE-small 32 1,024 10000 0.007 ms
medium 256 65,536 1000 0.345 ms
multi-MB 2048 4,194,304 100 19.999 ms
4K 4096 16,777,216 50 66.620 ms
8K 8192 67,108,864 10 286.915 ms

ms are average over the iterations NOT total time.
Performance test was made in a clean Unity project, since i tested multiple ways.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

KK (Unity 5.6, Linear) samples sRGB UI PNGs too dark. Add a public gamma-LUT fixer (KK-only, no-op elsewhere) and apply it to the InterfaceMaker skin.

@ManlyMarco ManlyMarco left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The difference in KK is already handled by having a separate light texture that is pre-baked
If it's not close enough then it would be best to replace that texture instead, or if it's fixed at runtime then the light texture system should be scrapped instead.

The API is fine as it is for use by other plugins, but the name of the method does not indicate that it does not work in KK, either make it always work or name it something like CorrectColorForKoikatu.

…tColorSpaceForKoikatu and remove the example implementation.
@ManlyMarco ManlyMarco changed the title [KK] Add TextureUtils.CorrectColorSpaceForLinear for KK UI textures [KK] Add TextureUtils.CorrectColorSpaceForKoikatu for KK UI textures Jul 9, 2026
@ManlyMarco
ManlyMarco merged commit 246546f into IllusionMods:master Jul 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants