Forum Discussion
KevinComerford
11 years agoHonored Guest
Working in Linear Color Space
Hey guys, I was wondering if someone else had some input on this issue I have been having.
I generally work in linear color space in unity. I never had issues with my workflow with the DK1 SDK, but I have been having issues with the DK2 SDK. Apparently it takes my linear color space render and brings it down to gamma space. Strange thing is that I have been able to bypass this problem by forcing the oculus hud menu to stay on. So I just keep it blank and wrote a bit of code to keep the menu up. This is not perfect as it doesn't really fix the issue.
Other issues have been popping up because of this hacky fix, so I have been trying to pinpoint the issue. I think I have pinpointed where the problem is. It has to do with the chromatic aberration correction. I disabled the post render texture filters one by one under the _distortionCaps function and problem disappears when I disabled the chromatic aberration. SDK 0.4.2 had a comment in the script that said that it was assuming that you are working in gamma corrected color space when it was going through the filter process. So the problem is certainly the chromatic aberration not handling the linear render texture correctly, but that's where I get stuck. I could be wrong (Sortta a newb to coding), but it looks like this segment is handled by the DLL which means I can't easily modify it for the correct color space.
This problem has been bugging me for a while now. I would certainly appreciate any help or insight on this issue.
I generally work in linear color space in unity. I never had issues with my workflow with the DK1 SDK, but I have been having issues with the DK2 SDK. Apparently it takes my linear color space render and brings it down to gamma space. Strange thing is that I have been able to bypass this problem by forcing the oculus hud menu to stay on. So I just keep it blank and wrote a bit of code to keep the menu up. This is not perfect as it doesn't really fix the issue.
Other issues have been popping up because of this hacky fix, so I have been trying to pinpoint the issue. I think I have pinpointed where the problem is. It has to do with the chromatic aberration correction. I disabled the post render texture filters one by one under the _distortionCaps function and problem disappears when I disabled the chromatic aberration. SDK 0.4.2 had a comment in the script that said that it was assuming that you are working in gamma corrected color space when it was going through the filter process. So the problem is certainly the chromatic aberration not handling the linear render texture correctly, but that's where I get stuck. I could be wrong (Sortta a newb to coding), but it looks like this segment is handled by the DLL which means I can't easily modify it for the correct color space.
This problem has been bugging me for a while now. I would certainly appreciate any help or insight on this issue.
3 Replies
- vrdavebOculus Staff
"kevincomerford" wrote:
I disabled the post render texture filters one by one under the _distortionCaps function and problem disappears when I disabled the chromatic aberration. SDK 0.4.2 had a comment in the script that said that it was assuming that you are working in gamma corrected color space when it was going through the filter process.
If you are working in D3D9, we force sRGB write and read from the eye textures. You can disable that by calling the following code in one of your scripts' Start methods:OVRManager.display.distortionCaps &= ~(uint)Ovr.DistortionCaps.SRGB;
If you use D3D11, we don't mess with the gamma space, but I would still recommend using linear lighting in Unity because it will improve aliasing in texture interpolation. - KevinComerfordHonored GuestDoesn't seem to do anything. :(
I would ideally like to work in DX11 as well. I have some shaders that utilize it. - KevinComerfordHonored GuestLooks like the new distortion filter in 0.4.4 fixed the issue. ;)
The menu script is still interacting strangely enough, but everything seems to auto correct to the projects gamma space now.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 6 years ago
- 2 years ago