[Open Source] Physically Based Sky for URP

Hey, I just released the PBSky repo. You can find more information on my Github page.

In short, it provides the following features:

  • Physically Based Sky
  • Atmospheric Scattering
  • Height-Based Fog
  • Dynamic Sky Reflection
  • Dynamic Ambient Lighting (currently PBSky only)

Please feel free to try it out and leave your feedback! :speech_balloon:

3 Likes

Regarding the lighting units in URP, you may start with:

  • Sun Intensity: 3 (3.030782)
  • Color Adjustments Exposure: 0

The formula I used is:

// HDRP sun intensity (lux)
float lux = 130000.0f;
// HDRP exposure (ev100)
float ev100 = 14;
// URP sun intensity
float sunIntensity = (lux / PI) / ColorUtils.ConvertEV100ToExposure(-ev100);

Please feel free to correct me if anything is wrong!

Really cool!! Is this a port of the hdrp sky?

1 Like

Yes, this is based on HDRP 17.0!

1 Like

I saw a Github repo from Unity China that adds physical light units (and fixed exposure) to URP:

Pretty cool! :clap:

1 Like

Hi @wwWwwwW1

I tried your physically based sky and I’m encountering a strange issue.
When the sun is close to the horizon it’s almost as if the area close to the horizon is rendered over other objects that are occluding both the sun and the horizon.

See the attached images that show a screenshot of the portion of sky towards the horizon and a view in the same direction but from inside a room that occludes both the sun and the horizon.


If I heavily increase the aerosol density the issue goes away, but this leads to a very foggy looking sunset which isn’t good.


Do you know what could be the issue?

Is there (or will there be) an option for spherical planets or custom night skies?