Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

For a current unity project I need a layered map like in Dwarf Fortress. The game will take place in a 3D city enviroment and the camera should be 'snapped' to layers. So there will be (for example) a cave layer, ground layer and floor 1 - 3 layer. The player should be able to navigate the camera up and down with a keypress. So if the player is looking currently at the ground layer and press + the camera should snip to floor 1 layer. All layers below the current level will be blurred and all levels above wont be visible (or at least faded out very strong)

My question now is: Is the layer system of unity useful for such a scenario, or is it better to implement an own data structure? I know about the ability of ignoring layers for rendering and raycasting but can the system be extended to support the features described above?

share|improve this question

1 Answer 1

I would think using multiple cameras + layers would be your best bet/most flexible.

Each camera can use it's own Culling Mask property to render only selected layers. Using multiple cameras should allow you to apply effects (such as blur) only to selected layers, and using Normalize Viewport Rect you can control where each camera 'draws' to the screen.

So, when a player moves up or down a layer/level you would:

  • Disable cameras above the player
  • Adjust each cameras Normalize Viewport Rect to center the current layer on screen
  • Blur the layer below current layer

Also, in this scenario, where each camera has its own layer/level, each camera can be set to a different Depth which affects its rendering order.

share|improve this answer
    
Thank you for your input. I will read up on the topics you brought up. –  floAr Oct 14 '13 at 6:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.