Author Topic: How are layer organized  (Read 324 times)

lordzeon

  • Newbie
  • *
  • Posts: 30
    • View Profile
How are layer organized
« on: March 14, 2020, 05:24:02 PM »
Hi, i had my own shader for the globe and tweaked it to be ordered correctly, but it have depth and tesselation, so when the camera moves away, some of the country names get clipped in the middle into the globe, also, in the scene view, the countries names don' t show at all... i could change TextRoot scale to avoid this clipping, but then the names are flying in close views, so i was thinking it would be better to make my own shader for it and tweak it for my map... but i cannot find the GameObject and Material used, just the TextRoot Transform... how is that layer created?

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 5829
    • View Profile
Re: How are layer organized
« Reply #1 on: March 15, 2020, 02:35:38 AM »
Check out DrawMapLabels() method in WPMCountries.cs.

lordzeon

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: How are layer organized
« Reply #2 on: March 16, 2020, 01:59:57 PM »
Hi!, sorry for the delay... i think there is no need to make changes in the code, with a shader with stencil and making that layer smaller than the planet i can archieve the effect i think... but i donīt know which material are you using for the countries labels. The problem is notorious when the camera is far when the elevation of the labels is 0, if i add elevation, on the close up, the labels look weird, behind my objects (where they should be), but panning like they where over them.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 5829
    • View Profile
Re: How are layer organized
« Reply #3 on: March 18, 2020, 03:29:47 AM »
Hi,

The shader used is in Resources/Shaders/UnlitGUIText.shader.

Regards

lordzeon

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: How are layer organized
« Reply #4 on: March 18, 2020, 06:51:36 AM »
Thanks! im attaching the country text shader for anyone who have the same issue when zooming out, the Globe Shader must have stencil in something like 5 to replace when greater or equal, and Zwrite On, the text is stencil 6 and always replace, so no matter the size of the overlay text for the countries (World Space Method), the labels will show always over the globe.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 5829
    • View Profile
Re: How are layer organized
« Reply #5 on: March 18, 2020, 07:09:29 AM »
Thanks for sharing the shader :)