Author Topic: Display ui on different layer  (Read 42 times)

williewight

  • Newbie
  • *
  • Posts: 28
    • View Profile
Display ui on different layer
« on: January 08, 2019, 12:11:52 PM »
I'm wondering how the UI is displayed on the map. I was hoping to do some image effects on a camera with UI turned off then render the UI with a different camera to be on top of the image effects. But it doesn't appear that it's actually on a different layer than the map itself. Any idea on how to manipulate the layering or should I look for an alternative solution?

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4083
    • View Profile
Re: Display ui on different layer
« Reply #1 on: January 08, 2019, 12:19:28 PM »
Try changing the WorldMapStrategyKit’s root gameobject layer to Default or other. All children will copy the layer of the parent.

williewight

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Display ui on different layer
« Reply #2 on: January 08, 2019, 01:36:57 PM »
It appear when I set the layer of anything under the WordMapStrategyKit during runtime they disappear even in the scene view and return when I return them to the default layer. This is for the terrain mode so maybe that's part of the reason.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4083
    • View Profile
Re: Display ui on different layer
« Reply #3 on: January 08, 2019, 01:45:07 PM »
Oh thanks for the heads up. Will check this soon and get back to you.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4083
    • View Profile
Re: Display ui on different layer
« Reply #4 on: January 09, 2019, 03:02:14 AM »
Fixed in latest beta. Changing the root gameobject layer now updates the terrain mode camera culling mask properly. Also added a "Redraw" button to the inspector (under WMSK's window section).

williewight

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Display ui on different layer
« Reply #5 on: January 09, 2019, 04:17:58 PM »
I tried out the latest beta but I'm still having trouble. I don't think we're quite on the same page yet. I want to be able to set the ui on the terrain to be on a different layer for camera culling masks. I would like if Camera1 could see only the default terrain layer with the map on it and Camera2 could see only the UI. That way I can do a camera effect on Camera1 without it changing the UI on camera 2.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 4083
    • View Profile
Re: Display ui on different layer
« Reply #6 on: January 10, 2019, 02:31:47 AM »
Could you be more specific about what you refer by "UI"?

Everything rendered by WMSK (including frontiers, labels and anything visible under WorldMapStrategyKit) is captured by an internal camera into a custom RenderTexture which is used by the terrain shader and can't be separated. So if you are adding UI as children objects of WMSK (like markers) it's not possible - you will need to draw those UI elements on top of the real terrain and not as children of WMSK.






williewight

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Display ui on different layer
« Reply #7 on: January 10, 2019, 08:50:26 AM »
Oh ok, that's what I needed to know. I'll need to change the material texture itself then.