Register
handmade.network»Forums»Color management in games
Oliver Marsh
144 posts / 3 projects

A budding game developer and programmer

Color management in games
6 months ago Edited by Oliver Marsh on May 19, 2019, 2:21 a.m.
I've been working on a new game with an artist. The assets he's making are in photoshop in srgb iec61966-2 color space. Photoshop's a color managed environment and i can look at what they look like in there and they look right. Then when I export then and run them in the game they are dull. If i convert the asset to my calibrated monitor space, they then look correct in game.

From what I understand the game is not a color managed environment and takes no notice of what color space they were authored in, and does no color correction to account for the difference in monitor colors.

The question is how do you account for the color difference? Do you have to write a post processing shader that takes the montor's calbiration profile and outputs the correct result? Also I'm using Unity, so not sure if there is something like this already.



Simon Anciaux
681 posts
Color management in games
6 months ago
OliverMarsh
Then when I export then and run them in the game they are dull.


I suppose you've already done that but make sure the material you use is correctly setup.

OliverMarsh
From what I understand the game is not a color managed environment and takes no notice of what color space they were authored in, and does no color correction to account for the difference in monitor colors.


Image are exported to sRGB because sRGB is a common color space for screens to use, and GPUs support sRGB textures. In Unity there is a checkbox in the texture importer to enable/disable sRGB (by default it's on I believe). So game engines know about color space but kind of requires you to feed them sRGB and to render to sRGB.

I don't know if the OS or the engine handle a conversion of the frame buffer to the monitor color space. Maybe you could use a post process shader to convert the final color space, but that would require you to find the user color space and know how to convert to it. Maybe ask in the Unity forums ?
Miles
35 posts / 2 projects
Color management in games
6 months ago
You shouldn't need to do any gamma conversion in post-processing, the graphics API should be able to handle this for you - for example in OpenGL, it's done by creating the framebuffer with an SRGB pixel format and calling glEnable(GL_FRAMEBUFFER_SRGB) when rendering, and other APIs should have something similar. I couldn't tell you where that fits into Unity's rendering pipeline though.

Whatever the problem may be, it's almost certainly not an issue with monitor color calibration, otherwise everything else will look wrong on your monitor as well, not just the game.
Mārtiņš Možeiko
1983 posts / 1 project
Color management in games
6 months ago
In Unity framebuffer colorspace is controlled in Project Settings -> Rendering section: https://docs.unity3d.com/Manual/L...dering-LinearOrGammaWorkflow.html

This section desribes how Unity deals with linear color space. Read also other linked articles about this topic.
Oliver Marsh
144 posts / 3 projects

A budding game developer and programmer

Color management in games
6 months ago
Thanks for the responses, I think I've got a better handle of things now.

I think what I got hung up on was that the final frame buffer would be output in srgb but the monitor might have a different calibration profile, so there would have to be a conversion. But I'm pretty sure the OS must do this. Also I think some of the assets weren't done in srgb space, so that made things more confusing.