CangoJoe Posted July 16, 2016 Share Posted July 16, 2016 Hello, Not sure if this a bug, but Is there a max number of cameras a map can handle in memory? In various projects it seems the max number of cameras I can hide() or show() is somewhere between 6-8. Only one camera is active at a time (via show()), if I show more than 7 cameras my game crashes back to the editor with error Framebuffer incomplete: GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT or Failed to set clipmap color texture. My System: Windows 10 64bit ATI Radeon R7 260 (latest driver) AMD Processor I've attached a test case. To test: Activate each control panel in any order to show() a camera for 2 seconds and then hide() it. At least for my system it can only handle show/hiding 7 cameras before crashing. If you have a powerful PC with lots of RAM,feel free to add more cameras and switches to where your game crashes as I suspect this is a memory issue. Quote Link to comment Share on other sites More sharing options...
shadmar Posted July 16, 2016 Share Posted July 16, 2016 Not that it changes the bug or anything, but why would you need 7 active cameras? Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
CangoJoe Posted July 16, 2016 Author Share Posted July 16, 2016 A game I'm working on is a camera intensive RPG that creates a mini-vignette whenever you interact with an NPC. It shows a previously hidden camera upon interaction with an NPC and hides the camera again when you're finished. There's also remote controlled vehicles that activate their own set of cameras. Whenever I operate vehicles, interact with NPC or combination of both, I eventually reach my 'camera limit' and the client crashes back to the desktop. There are no Lua script errors as far as I can tell. The attached test case is a distilled version of what I'm trying to accomplish. As you'll see, only one camera is active at a time. An alternative method to test this is to simply create a map with a bunch of non-Hidden cameras and try to run it - eventually an error is thrown. Quote Link to comment Share on other sites More sharing options...
Josh Posted July 16, 2016 Share Posted July 16, 2016 The camera gbuffers are likely making your video card run out of memory. What I can do is have the camera dump the gbuffers when they are hidden. Note that hiding the camera's parent will not result in the camera gbuffers being released. The camera itself must be hidden, or its projection mode can be set to 0. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted July 16, 2016 Share Posted July 16, 2016 The update is available now (Lua, Windows only). Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
CangoJoe Posted July 17, 2016 Author Share Posted July 17, 2016 Excellent that sounds like the solution I needed - thank you! How do I go about getting the update - do I need the beta branch? I tried updating through the Project Manager and it said everything was already up to date. I'm using LE 4.x at the moment. Quote Link to comment Share on other sites More sharing options...
macklebee Posted July 17, 2016 Share Posted July 17, 2016 http://www.leadwerks.com/werkspace/topic/8347-beta-branch-available-in-steam/ Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
CangoJoe Posted July 17, 2016 Author Share Posted July 17, 2016 Ok, I've installed the beta branch, updated the projects but unfortunately still having the same problem. I've also tried other ideas including; SetProjection(0), hiding the camera and setting it to nil when its not active. Yet my camera limit remains the same. Is there anything else I can try? I have an ugly work around in mind using a single camera but hopefully I won't have to resort to it. Quote Link to comment Share on other sites More sharing options...
Rick Posted July 17, 2016 Share Posted July 17, 2016 I would just make pivots for the pos/rot you want and then move/rotate the 1 camera in your game to these pivots when you need to and then snap it back to it's original position when done. 2 Quote Link to comment Share on other sites More sharing options...
Josh Posted July 17, 2016 Share Posted July 17, 2016 I would just make pivots for the pos/rot you want and then move/rotate the 1 camera in your game to these pivots when you need to and then snap it back to it's original position when done. This would be the best approach because you wouldn't get as much memory fragmentation. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Crazycarpet Posted July 17, 2016 Share Posted July 17, 2016 I have an ugly work around in mind using a single camera but hopefully I won't have to resort to it. I think having a whole wack of cameras would be the ugly way of doing it. xD Rick's suggestion is great, I'd do that... it doesn't have to be ugly if you organize it properly... you could just have a Lua table that stores your cameras, then a function like App:SetActiveCamera().... that's basically what I do in my game, except in C++. Quote Link to comment Share on other sites More sharing options...
Josh Posted July 17, 2016 Share Posted July 17, 2016 I've actually considered the idea of camera sharing buffers underneath the hood, so that ten cameras rendered with the same context would all use the same set of buffers, but the idea seemed complicated and it was "designing for the exception". Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
CangoJoe Posted July 17, 2016 Author Share Posted July 17, 2016 Alrighty I will go with the single camera solution as suggested by Rick. Thank you sirs for your help and input. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.