Add a more accurate fog implementation#1660
Draft
Peregrine05 wants to merge 49 commits intochunky-dev:masterfrom
Draft
Add a more accurate fog implementation#1660Peregrine05 wants to merge 49 commits intochunky-dev:masterfrom
Peregrine05 wants to merge 49 commits intochunky-dev:masterfrom
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 <46458276+JustinTimeCuber@users.noreply.github.com>
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 <46458276+JustinTimeCuber@users.noreply.github.com>
Implement anisotropy for particle fog
Pull latest changes
ThatRedox
reviewed
Oct 31, 2023
| * @return Next intersection | ||
| */ | ||
| public static boolean nextIntersection(Scene scene, Ray ray) { | ||
| public static boolean nextIntersection(Scene scene, Ray ray, Random random, IntersectionConfig config) { |
Member
There was a problem hiding this comment.
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
.jarbefore using it (GitHub refuses to allow JAR files to be uploaded).