Forum rules - please read before posting.

A question about disabling AC's Main Camera component

Hey, I've put together an inventory that uses 3D icons for inventory items. It's a full screen inventory with no alpha, so does not display the game view behind it.

The inventory items are displayed as animated 3D objects using additional scene cameras (without an AC Game Camera script) outputting a render texture than is then assigned to each inventory item's main graphic.

It works great! I found however that rendering 6 additional cameras alongside the AC Main Camera was having a fairly heavy hit on performance. I've worked around this problem by creating four custom actions: Enable Main Camera, Disable Main Camera, Enable Inv Item Cameras and Disable Inv Item Cameras.

When the inventory opens I disable the main camera and enable the Inv Item Cameras, then do the reverse when closing the inventory.

This has resolved the performance issue with only a minor (10fps-ish) hit on performance when opening the inventory.

I now get a message when testing in Unity (but not in builds) saying: Display 1 No camera rendering. Is this something that can be ignored or is it likely to have adverse effects to other things? Seems fine at the moment and the message disappears when re-enabling the main camera.

I was also curious if there is a smarter way of going about this, I wanted to keep AC's inventory item system as not to over complicate things which is why I went the render texture route.

Thanks!

Comments

  • Display 1 No camera rendering. Is this something that can be ignored or is it likely to have adverse effects to other things?

    That'll show if there's no active camera. If the only enabled cameras in your scene are rendering directly to Render Textures, that may be why. It's a Unity message, though - not from AC.

    I was also curious if there is a smarter way of going about this

    If you want them to appear in "item slots", then that's probably the right approach - though be sure to use Camera culling masks to only display layers in these item cameras that they need to show. If you're not already, that may help improve the framerate.

    It should be said also that AC's inventory management is separate from their display. Through scripting, you can still call upon what items the player is carrying, run their interactions, etc - you don't necessarily need to rely on "InventoryBox" elements in order to use AC inventory items. See the Manual's "Inventory scripting" chapter if that's an avenue you'd like to go down.

  • Thanks Chris, looks like it might be worth activating a camera that's culling everything to sit behind the render textures rather than having no camera at all. I'm indeed culling everything par the items for the render textures.

    I'll have a read further into the inventory scripting chapter and see if there's any improvements that can be made.

    Thanks for clarifying!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.
Do NOT follow this link or you will be banned from the site!