codeonwort / pathosengine

OpenGL Rendering Engine for Study
MIT License
20 stars 0 forks source link

Fix volumetric clouds #39

Open codeonwort opened 2 years ago

codeonwort commented 2 years ago

2022_09_22_rc1

My volumetric clouds, implemented several years ago, but it never worked as I wanted in various aspects:

After some rework:

fix_cloud_1 fix_cloud_2

Fixed things so far:

TODO:

codeonwort commented 2 years ago

Note about raymarching quality

raymarch_uniform Uniform raymarching (min=54, max=96)

raymarch_adaptive Adaptive raymarching (min=54, max=96)

raymarch_adaptive_ref

Adaptive raymarching, reference quality (min=200, max=400)

Raymarching strategy:

  1. Coarse march until hit a cloud particle.
  2. If hit, switch to fine march.
  3. If fine march hits nothing 10 times, switch to coarse march.

But once a ray exits fine march, it never reaches to the second cloud. There is just not enough iterations left once fine march is done. This is largely due to erosion noises which carve the cloud shapes and cause long-stay fine march, but they are also essential for visual.

I don't wanna increase the iteration count but I'm out of idea for now.