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
Framebuffers on iOS stopped working (version 1.9.x) #3864
Comments
Well, not quite the small example everyone is thinking of 😸 |
Yeah, can you be a bit more specific @orangepascal, perhaps try the FrameBufferTest or any of the other tests that use fbo. Framebuffer worked on iOS in my tests after that commit, so I doubt that Framebuffer as whole is not working on iOS because of that. Can't test at the moment though. |
ok ok the basic version :) my ipad is running ios 8 and this won't render on it with 1.9.x, but does with 1.7. |
Is there a particular reason you are creating the fbo in the resize method and using a TextureRegion instead of the texture directly? See #3850 |
normally I have a framebuffer in "low-res" pixelart, based on the size of the window for correct aspect ratio's.. so I create it in resize to make sure it scales correctly on all systems. Knew about that bug, fixed that, like I mentioned the game does run, just doesn't render. also normally I use some lights or filters on top rendering to the main framebuffer before I then scale that framebuffer to the full screen.. basically everything I did in the project I posted before, but you wanted the bare bone problem case :) which is what I posted now :) |
So not using the TextureRegion and resize method also shows the problem? As said, I can't test at the moment, so just trying to help by looking at the code. |
yup, updated the snippet to just the framebuffer usage: the problem really is in framebuffer :) |
oh, when not using the onResize it does work (even tho onresize gives the correct width+height on ios) |
Hm, might mean no OpenGL context is active when onResize is called.
|
I have exactly the same issue (just on iOS). FrameBuffer works in 1.7.0 and in 1.9.2 nothing is rendered once I call FrameBuffer.begin(). Is it fixed with a7e7f5c? |
the problem is indeed still there. also, disabling the use of Framebuffers does render.. |
Can supply a simple ApplicationAdapter that reproduces your problem so we can test with a minimal setup ----- Reply message ----- the problem is indeed still there. onResize is correctly called after the onCreate, but the problem (with Framebuffer) is still there. Nothing being rendered —You are receiving this because you modified the open/close state.Reply to this email directly or view it on GitHub |
I wrote a little bare-bones test-case, but it works in that one. Moved the creation of my framebuffers outside the resize() call, and then it works. Guessing my own code has a longer init (loading graphics,sounds,etc) causing the difference between that and the bare-bones test-case? possibly still not a perfect solution, cause you normally want to recreate framebuffers after a resize(). so something goes wrong between framebuffers and ios' way of handling the resize (which does trigger 4 times during startup/application create ) |
Do you only create your FBOs in |
I tried creating both in create+resize and just in resize which failed.. creating them in the resize basically just fails. just tested TinyPuncher version, and that does work! I did notice one difference between the cases which I can't find anything that causes it. The working cases startup with this console output: IOSApplication: iOS version: 8.1.1 and the code going wrong does this: IOSApplication: iOS version: 8.1.1 I think it's roboVM output, but both versions use libgdx 1.9.2 and robovm 1.9.0.. so I'm not really sure where the difference comes from and if this might be the cause of it? |
I've run into exactly this same issue (Gdx 1.9.2, RoboVM 1.9.0). In create() I glClear() a framebuffer to red. On every platform (apart from iOS) I get a red texture back. On iOS I just get black. Doesn't seem to be just a resize() issue here, I get a black texture from the framebuffer regardless of where I try to create it on iOS. I notice the ticket has been marked as "Closed" but there didn't appear to be a solution? |
The original issue originated as resize was being called in the wrong place. It was closed as that issue should have been resolved. There hasn't been an self contained example that has shown this to still be a problem, if you can provide one we can work from there. |
Thanks Tom-Ski, if I'm able to replicate it in a fresh minimal project I'll create a new issue. [EDIT - sorry, turns out my error was a mistake in glReadPixels, the Framebuffer was actually working fine. Everything is fine now. ] |
@orangepascal Looks like they are running different versions, that first console output startup is pre 1.9.2 |
ah gotcha.. seems the test cases were running on 1.7.1 indeed. Updating them to 1.9.2 gives us the problem. So here's a short example of the problem: |
Your example works OK for me. Running on iOS 9.3 and latest source of LibGDX. This could be an iOS version issue. Could you try this ApplicationAdapter https://gist.github.com/Tom-Ski/33d7f8819aca782ad55626bad7e1ef45 |
yeah that works, it's basically the work-around I use in my game now. |
Issue details
Rendering on iOS (any version) worked in 1.7.x, now upgraded to 1.9.x and it fails (haven't tried 1.8.x)
Issue is related to framebuffers, without using an FBO it renders normally.
Reproduction steps/code
Small example code: https://bitbucket.org/orangepixel/tiny-puncher
with Libgdx 1.7 it runs normal on iOS and shows everything, if you upgrade it to 1.9 it will run normal but the screen stays black. (removing the rendering to a framebuffer from com.orangepixel.utils.arcadecanvas render() makes it work again)
problem seems to be in framebuffers, possible the cause of the problem:
ef0c210
Version of LibGDX and/or relevant dependencies
1.7.x works, 1.9.x doesn't
Please select the affected platforms
The text was updated successfully, but these errors were encountered: