New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Races are very dark #2190
Comments
This is not normal, so I suspect there is a compatibility/driver issue somewhere. Maybe you can give more info : OS, GPU, logging output, does changing graphics level matter? |
Hi, thanks for looking into the issue. Here is the info: OS: Archlinux
Graphics level: 1 I have played around with the graphics level and the lighting improves on graphic level 3+. However, the game is for me unplayable with those settings. |
Can you post the content of: $HOME/.config/supertuxkart/0.8.2/stdout.log? |
The lighting does not change whether I run windowed or fullscreen. Also, the lighting does not change after the "ready, set, go" sequence. I have taken screenshot after the sequence. The stdout.log file is here: https://www.dropbox.com/s/q7fagvt8op0rotb/stdout.log?dl=0 |
Sorry for the delay in answering, but your stdout file is not there anymore. Could you re-upload it? |
I see something similar on intel HD4000 with mesa 11. I think this is a bug in mesa because it works for me with mesa 10.3.2. I reported it to them: @scrzbble you can check if older version of mesa driver solves this issue for you. |
Someone has similar issues with current mesa: As I see we even have "FramebufferSRGBWorking" in graphics restrictions. I will check if it works. |
Disclaimer: I know very little about stk/irrlicht, so just a drive-by comment, feel free to ignore. Sometimes such issues result from picking an incorrect visual. Different drivers will return these in different orders, so perhaps you were relying on one order and it changed. Make sure that you're filtering on the srgb attribute of the visual to get the one you expected. |
I was digging a bit around this bug (@imirkin I already sent it to mesa mailing list, it's waiting for moderator approval now. Generally I agree that this patch doesn't have a sense). Here is how it works in Supertuxkart:
Then, during rendering scene, we do:
It looks that glEnable(GL_FRAMEBUFFER_SRGB) doesn't work anymore. It's because of following lines in intel_screen.c in intelCreateBuffer() function:
Previously MESA_FORMAT_B8G8R8X8_UNORM was not available, and thus MESA_FORMAT_B8G8R8A8_UNORM was handled as last case (using MESA_FORMAT_B8G8R8A8_SRGB format). Now it uses MESA_FORMAT_B8G8R8X8_UNORM format. Atm. I'm not sure how to workaround it. |
In CIrrDeviceLinux.cpp you appear to have:
Any idea why this is commented out? The ifdefs are wrong... need to check for GLX_ARB_framebuffer_sRGB and GLX_EXT_framebuffer_sRGB, not GL_*, but it probably wouldn't matter either way. But this should be the right way to ensure you have a sRGB visual. If you can't find one with sRGB, then you should disable your expectations that you're rendering to a sRGB winsys fb. |
Or conversely if you don't really care about whether you have a sRGB visual or not, and just need to know, you could query the fb's state with glGetFramebufferAttachmentParameteriv(GL_DRAW_FRAMEBUFFER, GL_BACK_LEFT (??? i can never remember the right one), GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, &issrgb) |
@imirkin Unfortunately setting GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB doesn't help. It makes things even worse because in this case irrlicht uses different internal texture format. In COpenGLTexture.cpp:
But intel still doesn't handle it. And it causes the user interface to be dark too. Anyway, thanks a lot for your hints! |
Well, that's the right fix. However I just noticed something funny... on a haswell / mesa 11.0.6:
And also no srgb-enabled GLXFBConfigs. So I think that's the core of the problem... (a) You need to fix your engine to support situations with the selected visual is not srgb-enabled I'm not exactly an expert on this stuff, so I'll reply on-list and see if people who actually understand GLX, sRGB, visuals, etc can provide feedback. |
Is CreationParams.WithAlphaChannel true? I bet it's not... forcing alpha in your visual would also "solve" your problem. But that will also be through luck (and knowledge of intel driver internals) -- the core issues are outlined above. |
Nice hack with CreationParams.WithAlphaChannel which is set to true :) Indeed it forces to use MESA_FORMAT_B8G8R8A8_SRGB format. About glxinfo, I see exactly the same. SRGB is not reported anywhere. Ok, then I will try to handle the situation that srgb-capable visual is not available. We at least know the reason of this bug now. |
The is really odd, and will probably require careful reading of some specs, but it seems like the intel driver will optionally make a config be srgb-enabled even if the reported visual says no. Since the intel guys aren't dummies, I'm guessing it's allowed. You need to determine the srgb-ness of things by querying the winsys framebuffer as I mentioned earlier (with glGetFramebufferAttachmentParameter). |
Okay, I made some changes on our side:
It also should be fixed soon on mesa side by this patch: It's actually hard to handle it properly on our side, because we can't really trust glGetFramebufferAttachmentParameteriv function. It for example returns GL_LINEAR on nvidia drivers and glEnable(GL_FRAMEBUFFER_SRGB) works fine there. It should be relatively easy to write a shader for gamma correction, but still we have a problem when to use it. And still there is no similar issues with other drivers, so I'm not sure if we should really care about it. I'm closing this ticket because workaround for intel on linux is already applied. |
With 0.9, tracks have become very dark. See screenshot.
The text was updated successfully, but these errors were encountered: