Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Skybox Layers

Discussion in 'Shaders' started by hoesterey, Jan 26, 2016.

  1. hoesterey

    hoesterey

    Joined:
    Mar 19, 2010
    Posts:
    659
    Hello,
    I'm looking for a solution to have a multi layered painted skybox with moving clouds, glowing stars, etc...

    I've seen some sky solutions on the asset store but I need the control to have custom painted layers, I'm hoping to get pointed in the right direction.

    I'm thinking the solution may be to use the standard cube mapped skybox as the back layer for lighting/reflections, then create some 3d objects with a shader that does not write to Z (so they always appear behind everything, just above the skybox)

    Sound sensical?

    Thanks!
     
  2. Teravisor

    Teravisor

    Joined:
    Dec 29, 2014
    Posts:
    654
    Yes, it does. With one remark: it should not only not write to Z, but also be rendered before everything(or make sure ZTest always fails on it as in theory object can be placed outside of your 3D object box or make sure no object ever gets placed outside of it, but that's harder to do). If you need to 'paint' on skybox that's the only way that'll give you enough performance to do it realtime.
     
  3. hoesterey

    hoesterey

    Joined:
    Mar 19, 2010
    Posts:
    659
    Thanks for the info!
    From what your saying I'm guessing my key tags are:
    ZWrite Off //so It does not write to z
    Cull Front //so the inside of the object is rasterized
    Tags { "Queue" = "Background" } //so this pass happens before other objects are rendered.