-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a more accurate fog implementation #1660
base: master
Are you sure you want to change the base?
Conversation
…ottom of the sun will be
# Conflicts: # chunky/src/java/se/llbit/chunky/renderer/scene/PathTracer.java
# Conflicts: # chunky/src/java/se/llbit/math/Ray.java
Co-Authored-By: Justin Barker <[email protected]>
Add spherical and cuboid fog volumes.
- Re-enabled use of old (fast) fog. - Made PathTracer `addSkyFog()` in diffuse reflections. - Added an option to render particle fog in the render preview to the `Advanced` tab. - Set the default uniform fog density to 0.05. - Fixed the sphere implementation. - Moved all fog controls to a new `Fog` tab. - Renamed the `Sky & Fog` tab to `Sky`.
Implement JsonSerializable and add GUI
Includes changes from chunky-dev#1621. Co-Authored-By: Justin Barker <[email protected]>
Implement anisotropy for particle fog
Pull latest changes
* @return Next intersection | ||
*/ | ||
public static boolean nextIntersection(Scene scene, Ray ray) { | ||
public static boolean nextIntersection(Scene scene, Ray ray, Random random, IntersectionConfig config) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better for this to give the intersection with the entire fog volume instead of needing to pass in a random and intersect in here. That would give ray tracers more flexibility on what it wants to do with the fog (ie ignore it, intersect with fog, calculate attenuation of fog, etc).
Diffuse sampling fog
Revert "Diffuse sampling fog"
fix coordinateSystem()
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:
New:
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
, andCUBOID
.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).