Search Unity

blending skybox

Discussion in 'Made With Unity' started by llavigne, Feb 25, 2008.

  1. llavigne

    llavigne

    Joined:
    Dec 27, 2007
    Posts:
    977
    I am trying to blend skybox materials with RenderSettings.skybox.Lerp( skyFoggedUp,skyUnfogged, ratio);
    and nothing happens to the sky when the ratio is .5, any idea on how I can do this ?
     
  2. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,536
    Material blending only blends their colors and other "simple" parameters.

    Texture blending is a fundamentally different operation (as in: "has fundamentally different performance"), and that is usually done with a custom shader that reads both textures and outputs a color that is blended between those two.

    For example, SkyboxBlended shader on the wiki does exactly that.
     
  3. llavigne

    llavigne

    Joined:
    Dec 27, 2007
    Posts:
    977
    Thanks, this is great !

    Now in order to get the actual color of the skybox, I need to change the tint color to 57% gray, not 50% gray, no big deal just requires some tinkering, what's the math behind this ?
     
  4. llavigne

    llavigne

    Joined:
    Dec 27, 2007
    Posts:
    977
    Now if I want to blend on a 3d grid of cubemap, so I can move along the plane and the cubemap diffuse lighting will varry with where I am and also depends on altitude, how do I do that?

    I assume that I need to compute the barycenter inside cube that's a portion of the grid which would be like Nichola's Palestine game. Is this script available to us?