This one will be difficult to track.
It appears to be a driver or HW issue, which likely Unity is either workarounding or emulating.
You can try debugging further what's going on by going to GL3Plus/src/windowing/GLX/OgreGLXWindow.cpp and you'll find GLXWindow::create
Code: Select all
int minAttribs[] = {
GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_RED_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_GREEN_SIZE, 1,
#if OGRE_NO_QUAD_BUFFER_STEREO == 0
GLX_STEREO, mStereoEnabled ? True : False,
#endif
None
};
int maxAttribs[] = {
GLX_SAMPLES, static_cast<int>(samples),
GLX_DOUBLEBUFFER, 1,
GLX_STENCIL_SIZE, INT_MAX,
GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT, 1,
None
};
Try changing it to:
Code: Select all
int minAttribs[] = {
GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_RED_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_GREEN_SIZE, 1,
#if OGRE_NO_QUAD_BUFFER_STEREO == 0
GLX_STEREO, mStereoEnabled ? True : False,
#endif
GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT, 1, //This is new
None
};
int maxAttribs[] = {
GLX_SAMPLES, static_cast<int>(samples),
GLX_DOUBLEBUFFER, 1,
GLX_STENCIL_SIZE, INT_MAX,
GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT, 1,
None
};
A few lines later you'll see:
Code: Select all
fbConfig = mGLSupport->selectFBConfig(minAttribs, maxAttribs);
If fbConfig is null after that call, then your GPU doesn't actually support sRGB (a few lines later it will throw saying "Unexpected failure to determine a GLXFBConfig"). If it does, then we can patch Ogre.
Also checkout this:
Code: Select all
if (gamma != 0)
{
mGLSupport->getFBConfigAttrib(fbConfig, GL_FRAMEBUFFER_SRGB_CAPABLE_EXT, &gamma);
}
gamma should always be non-zero, both before and after the getFBConfigAttrib call. If not, then tell me when it happens to be 0.
Cheers
Matias