Forum rules - please read before posting.

Applying camera filters to only 3D characters in 2.5D game

Hey friends! :)
I'm making a 2.5D game, and I'm hoping to apply certain camera filters to the 3D characters, but not to the background images, sprite masks, menus, etc. If I were doing this outside of AdventureCreator, I think I would want to have one camera that renders my 3D characters and apply the filter there, then have another camera for everything else. I'm trying to figure how to map that into the way that AC manages cameras.

Under _Cameras, I see both Main Camera and BackgroundCamera, and based on the Culling Masks, I would expect the latter to just draw the background images and the former to draw everything else. However, putting a filter on BackgroundCamera has no effect, and putting it on Main Camera affects everything. Based on some code docs, I suspect there's something more complex going on, but I don't yet follow exactly what's going on. Any advice for how to apply camera filters to just the 3D characters?

Thanks! :D
Adam

Comments

  • The MainCamera should not be rendering the background - if you pause the game and disable the BackgroundCamera, you should see that the background disappears.  It may be that your camera filter needs to ignore objects placed on the BackgroundImage layer in your scene.
  • Hmm, you're right: removing the BackgroundCamera does remove the background. However, filters on the BackgroundCamera have no effect on the background, but filters on the Main Camera do. Should it even be possible for a filter on one camera to affect other cameras? Does AC do anything complex that I might expect this sort of behavior?

    (I recognize that this is possibly a more general Unity question, and I'm not certain how AC-specific the issue will end up being, so I quite appreciate any advice)
  • I found on http://www.adventurecreator.org/scripting-guide/class_a_c_1_1_main_camera.html :
    "only the MainCamera actually performs any rendering".

    I'll look more deeply into how this works, but that might explain things?
  • Yes, that'll be it.  The background image is actually drawn in Unity's GUI code, which means it's not physically present in the scene - and hence won't be included in camera filter calculations.

    This is done out of convenience - as it basically allows you to define backgrounds without having to position them in physical space or worry about them colliding / interfering with other objects.

    If you want the camera filter to be applied to it, you'll have to instead detach the background from the camera, and place it in your scene manually as a sprite or plane texture.  To limit its visibility to just the one camera, attach the LimitVisibility component to it and configure it in the Inspector.
  • This all makes sense; thanks!
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.