chunky-dev / chunky

A path tracer to create realistic images of your Minecraft worlds.
https://chunky-dev.github.io/docs
GNU General Public License v3.0
644 stars 76 forks source link

Add a more accurate fog implementation #1660

Open Peregrine05 opened 11 months ago

Peregrine05 commented 11 months ago

This PR is draft because changes are pending.

Fixes #665.

This PR adds more accurate fog implementation that interacts with indirect lighting and emitter lighting correctly *(It does not yet work with Emitter Sampling Strategy). This fog implementation works independently of the old fog implementation, so both can be used together if so desired.

Old: image

New: image

The bounds of the fog is controlled by fog volumes. Each fog volume has its own independent properties, which include material and color properties. Four shapes of volume may be used. These are EXPONENTIAL, LAYER, SPHERE, and CUBOID.

This PR also applies the fog implementation to the clouds (which is toggleable), and adds more configuration options to the clouds. These include the ability to add multiple layers of clouds to the scene, the ability to scale the clouds per-dimension rather than just on the X- and Z-dimensions in conjunction, and the ability to set the color and material per cloud layer.

A new material property specific to the fog material, called Anisotropy, controls the direction light that hits the fog is likely to be scattered. The range of the property is [-1, 1]. Negative values increase the probability that light is scattered toward the direction from which it came, and positive values increase the probability that light is scattered into the direction to which it goes.

This denoiser build works for this PR. chunky-denoiser-dev-fog-5.zip Set the file extension to .jar before using it (GitHub refuses to allow JAR files to be uploaded).