Search Unity

Adding blur to Unity's 'Skybox' shader?

Discussion in 'Shaders' started by CloudyVR, Sep 6, 2019.

  1. CloudyVR

    CloudyVR

    Joined:
    Mar 26, 2017
    Posts:
    715
    I have a textured skybox, but I would like to add blur dynamically. Is this possible with unity's 'Skybox/6 Sided' shader?

    I see the shader has parameters for 'Exposure' and 'Rotation' but is there any way I could add a 'Blur' to it?

    How would (Gaussian) blurring be implemented?

    Would it affect the Environmental Lighting or Reflections?

    Cheers!
     
    Last edited: Sep 7, 2019
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,348
    Not really, no. With a cube map shader, maybe, but it’d be expensive. The easiest solution would be to import your sky in as a cube map and select the “Glossy Reflections” checkbox which blurs the texture in the mip maps. Then write a custom shader to select the mip level to increase the blur. That’s be the cheapest solution.

    This could plausibly affect the reflections if you used a real time reflection probe. Environment lighting won’t be affected much since it’s already based off of a blurred version of the skybox.

    Otherwise the next easiest solution would be to use a depth of field post process.
     
    CloudyVR likes this.
  3. stevphie123

    stevphie123

    Joined:
    Mar 24, 2021
    Posts:
    82
    here's the poor-man's method on how to do it :

    Add DepthOfField and set the distance as far as you can so your scene objects won't be affected.

    Cheers!