Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question adding clouds to fake volumetric effect in scriptable render feature

Discussion in 'Universal Render Pipeline' started by Zenchuck, Sep 13, 2022.

  1. Zenchuck

    Zenchuck

    Joined:
    Jun 2, 2010
    Posts:
    297
    This is the first render feature I have attempted working with - following the tutorial "
    Volumetric Light Scattering as a Custom Renderer Feature in URP" by written by Ignacio del Barrio. Big thanks to him for putting this together.

    https://www.raywenderlich.com/22027...cattering-as-a-custom-renderer-feature-in-urp

    The tutorial shows a process of creating a pass that renders the skybox as usual and then renders the opaque objects on top of that as solid black objects, before performing a radial blur on the result.

    Well, this all looks great and I really like the result, but I would like to add the clouds in the skybox into the mask pass along with all of the opaque so that the light scattering would be affected by the clouds.

    I can write the shader that would give me the skybox with black clouds - I can picture it in my mind - I just don't know how to put it all together. How I could mix that back into the result.

    Appreciate the help.

    Cheers,

    Andrew
     
  2. Zenchuck

    Zenchuck

    Joined:
    Jun 2, 2010
    Posts:
    297
    Just thinking about it, I should be able to replace the skybox shader with one that renders black clouds.
     
  3. Zenchuck

    Zenchuck

    Joined:
    Jun 2, 2010
    Posts:
    297
    I've set up a replacement material for the skybox, now just need to figure out how to set it once

    //RenderSettings.skybox = cloudOccluder;

    context.DrawSkybox(camera);

    //RenderSettings.skybox = defaultSkybox;