The unity color correction shader is basically implementing this code but in the source for the unity shader it mentions that it doesn’t compile correctly for Direct3D.
I’ve tried implementing color correction in my own shader and I seem to be running into the same problem of it not compiling correctly for D3D. Do I have to invoke any sort of black magic to get it to compile correctly or do I have to learn Assembly to make this shader?
I asked the same question a long time ago. Considering the 0 replies that got, I concluded that learning assembly is pretty much the only option. In the end, our game just ended up without a fade to black and white for the menu screens as it wasn’t worth that much bother ;).
I’m biting the bullet and going down to assembly. From what I’m seeing the problem is the compiler messes up the assignments and ends up overwriting one of the channels with the UV position from a texture lookup. If I find a way to make the compiler not mess it up, I’ll let you guys know. Fixing the PS code for all 17 cases seems like a pain.