#1380 closed defect (fixed)
[PATCH] Water reflections bug on Mac w/ Intel HD 3000 graphics
Reported by: | vls | Owned by: | |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 17 |
Component: | Core engine | Keywords: | patch |
Cc: | Patch: |
Description (last modified by )
Attachments (5)
Change History (39)
by , 12 years ago
Attachment: | black rect.jpg added |
---|
comment:1 by , 12 years ago
Milestone: | Backlog → Alpha 10 |
---|---|
Priority: | Should Have → Release Blocker |
comment:2 by , 12 years ago
Summary: | Artifact on map → Graphical Artifact Ingame on Mac |
---|
comment:3 by , 12 years ago
Priority: | Release Blocker → Should Have |
---|
Hi, I'd like to request your system_info.txt
from the Mac :) You can find it in ~/Library/Application\ Support/0ad/logs/system_info.txt
. Unfortunately it's hard to troubleshoot this without more information and most of our devs don't have access to a Mac.
Are you using one of our app bundles, which one?
follow-up: 5 comment:4 by , 12 years ago
I get this one too, on a MacBook Air 13" (last generation iirc)... But not permanently, it appears/disappears when moving/zoominh, on every version since Alpha 8.
I did not find it a huge nuisance, but it is there, moving with the camera (though, again, it depends on the zoom …) To be more precise on the problem: it moves much like if it was an object "behind" the map, so it moves on the screen (imagine a starfield moving behind, for example). It also gets bigger when you move from the left side corner to the far right corner of the map. Perfect rectangle, which leads me to think it's some sort of zBuffer problem. It's especially prominent when zoomed out. Revealing the map changes strictly nothing. it still happens when rotating, and it moves in a consistent way, albeit fairly unpredictable. It happens in wireframe mode too.
It appears on any map that has water, including maps that are only water, but I failed to have it on exclusively land maps (such as the demo wall test RM). It may come from a problem with the water rendering.
comment:5 by , 12 years ago
Replying to wraitii:
I get this one too, on a MacBook Air 13" (last generation iirc)... But not permanently, it appears/disappears when moving/zoominh, on every version since Alpha 8.
Can you attach your system_info.txt
file per the above instructions? Which version of the game are you using? Do you get any OpenGL errors during the game (or in the logs, ~/Library/Application\ Support/0ad/logs/interestinglog.html
)?
comment:6 by , 12 years ago
System info: http://pastebin.com/nArAAMmy. It happened on every version of the game I used since Alpha 8, and I'm currently up-to-date with SVN. No error of any kind, as far as openGL is concerned. I'm going to try changing some of the settings to see if I can pinpoint the problem.
comment:7 by , 12 years ago
Allright, further progress: it only happens for me when "fancywater=true", ie the games uses the fancy water shaders. it also happens using "renderpath=fixed", using preferglsl=true, and the other settings don't seem to change anything either.
So I think it's linked with the presence of advanced water.
comment:8 by , 12 years ago
Milestone: | Alpha 10 → Alpha 11 |
---|
Weren't there water rendering problems with Intel HD graphics on other OSes too? I don't know if they still exist or have been fixed.
(We could disable fancy water with that card on Macs if nothing else.)
comment:10 by , 12 years ago
Confirmed: this does not happen on my iMac, so it might be a problem with the Intel HD 3100 of the MacBook Air. I'd advise against disabling fancy water, but not enabling it by default (and warning of compatibility issues) is an idea if it can't be fixed. However, as non-fancy water is so ugly, I really find it hard to play with it disabled.
comment:12 by , 12 years ago
Milestone: | Alpha 11 → Alpha 12 |
---|
comment:13 by , 12 years ago
I'm not entirely sure what's being described, but if it's a black thing that appears in the reflection in the water, it could be the reflection camera cutting off the skybox because it's too far away.
Maybe try setting the view.far value in the config to something larger.
comment:14 by , 12 years ago
Description: | modified (diff) |
---|
comment:15 by , 12 years ago
In reply to myconid, the artifact is black lines on the screen. The lines can be either horizonal or vertical, sometimes, as in the screenshot at the top, two sides of a rectangle. The lines are only a few pixels wide. They can appear even when there is no water on the screen, as long as the map has water on it.
I am also using a newer macbook air and have encountered this bug in the Sept 2012 build. As described above, turning off 'enable water reflections' eliminates this issue.
comment:16 by , 12 years ago
This has been reported by k776 has being fixed with my changes to the water shader. Any confirmation?
comment:17 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Still haven't seen this since the water changes. Marking as fixed for this release.
comment:18 by , 11 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Re-opening since it still happened on my MacBook Air (mid-11 with Intel HD 3000 on 10.8.2).
I have a patch, attached. It's extremely simple and fixes the issue, but I want to make sure it doesn't break other systems, as it basically shortcuts the scissor test. I think the scissor test wasn't wide enough or something, and since water reflections/refractions are rendered before anything else the scissor test for clearing shouldn't really be necessary so I just removed it.
The patch also fixes a bug: the reflections were rendered when the refractions and the reflections were disabled.
by , 11 years ago
Attachment: | patch.patch added |
---|
comment:19 by , 11 years ago
The patch doesn't change anything on my iMac which didn't have the issue in the first place, so if someone else reports it as working I'd say we commit.
comment:20 by , 11 years ago
Cc: | added |
---|
Removing code that has been there for some time is always risky. I'm including myconid into the conversation since he is familiar with the renderer as well. To both of you:
What does GL_SCISSOR_TEST do? If it fixed the Mac, will it break Linux/Windows instead? What was the original reason to use GL_SCISSOR_TEST? Is this no longer the case?
comment:21 by , 11 years ago
GL_SCISSOR_TEST is used for masking out part of a buffer.
Reflections/refractions use parts of the main screen buffers for rendering, then copy the result to a texture, then clear the buffers. As an optimisation, instead of clearing the entire buffers, they use a scissor test to clear just the parts that they used.
It looks like on the Macbook something goes wrong and a few pixels of either the depth or stencil buffers are left uncleared. Since the problem only occurs on the Macbook, that suggests a driver or hardware glitch rather than a bug in our code.
The patch works around the issue by removing the optimisation and clearing everything in the buffers. The downside is that it makes the fancywater slightly slower for everyone.
comment:22 by , 11 years ago
Milestone: | Alpha 12 → Alpha 13 |
---|
Ok, doesn't sound like an acceptable approach to remove the scissor test then. Moving this to Alpha 13 so we have time to work out a proper solution.
comment:23 by , 11 years ago
I have no idea how it works, but maybe OpenGL is actually faster at clearing the whole buffers as clearing a specific part, it should be checked. Anyway, this is indeed what the patch did, and I agree with Myconid on the issue. i'll give a shot at clearing a small margin more, but I doubt it'll work. In case it indeed doesn't, perhaps there could a specific handling of this case.
comment:24 by , 11 years ago
Milestone: | Alpha 13 → Backlog |
---|
comment:25 by , 11 years ago
Summary: | Graphical Artifact Ingame on Mac → Water reflections bug on Mac w/ Intel HD 3000 graphics |
---|
comment:26 by , 10 years ago
This would be fixed by using framebuffers for water rendering, which we should just do anyhow. I think I haven't yet because some graphic cards didn't support them but they're basically too slow to live anyhow.
by , 10 years ago
Attachment: | waterFramebuffer.patch added |
---|
comment:27 by , 10 years ago
Above patch switches to framebuffers (for now there's a basic check that probably should be removed) and fixes the issue.
comment:28 by , 10 years ago
Cc: | removed |
---|---|
Keywords: | patch review added |
Milestone: | Backlog → Alpha 16 |
Summary: | Water reflections bug on Mac w/ Intel HD 3000 graphics → [PATCH]Water reflections bug on Mac w/ Intel HD 3000 graphics |
comment:29 by , 10 years ago
glDeleteFramebuffers
should be pglDeleteFramebuffersEXT
, that's a build error in MSVC. You probably shouldn't be storing -1 in a GLuint
(signed/unsigned mismatch build warning).
I haven't closely reviewed the patch, someone with more GL expertise should do that, but it seems to run fine on Windows with an AMD Radeon HD 6850. I guess the real test will be with Intel HD graphics.
by , 10 years ago
Attachment: | waterFramebuffer.2.patch added |
---|
comment:30 by , 10 years ago
Updated version fixing the build error (not the -1 stuff, forgot about that.) The setting to -1 may actually be buggy for the next frame in case of errors, I'll have to check. It works just fine on my Intel HD Graphics 3000 384 Mo, but that's a fairly "high-end" intel HD.
Getting proper configurations would be somewhat of a requirement for proper handling of water, but we can't really do that until we've centralized settings a bit.
comment:31 by , 10 years ago
Milestone: | Alpha 16 → Alpha 17 |
---|
comment:32 by , 10 years ago
Summary: | [PATCH]Water reflections bug on Mac w/ Intel HD 3000 graphics → [PATCH] Water reflections bug on Mac w/ Intel HD 3000 graphics |
---|
comment:33 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Fixed by using FrameBuffer Objects (verified on my MBA).
comment:34 by , 8 years ago
Keywords: | review removed |
---|
Hey vladislav. I had the exact same thing and let Philip know. I didn't bother making a ticket for it at the time because I thought it might have just been my computer. Sad to hear it isn't just me :-(
I'll update this to a release blocker in Alpha 10, but no guarantees it'll actually be fixed before release.