Jump to content

Max cameras per map? GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT


CangoJoe
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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

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++.

Link to comment
Share on other sites

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".

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...