Closed CrushedPixel closed 9 months ago
Some additional information that might help:
I am working on pretty small scales, my planets are 200-500 units large (400 in this case).
My sun is pretty large.
This is the way I'm deriving the rayleigh_scattering coefficients and other Generation Parameters: https://github.com/CrushedPixel/BrunetonAtmosphereUnreal/blob/main/Source/BrunetonAtmosphere/Public/AtmosphereParameterBuilder.h#L234
The wavelengths used are 700
, 400
, 300
.
My transmittance precomputation (see first post) results look quite similar to the ones returned by the demo
(taken from this issue comment by @tobspr ), but the scattering seems not to fade out the same way in my texture (right):
(my textures are flipped vertically, but that shouldn't matter as UV is consistent within the system)
I have since moved on from this approach and implemented a simpler version based on Schafhitzel over at https://github.com/SweetBiz/SweetAtmosphere.
I apologize for intruding with these questions very specific to my code and project.
Hello everyone, I'm a huge fan of this library, so I'm working on an Unreal Engine port! Unlike the last guy who announced this here, I am intending to deliver - but I'm having some trouble with the rendered results, and am not sure whether it's just the wrong parameters or something else I broke when adapting the code to my needs.
This is the rendered result (nevermind the shadows):
https://github.com/ebruneton/precomputed_atmospheric_scattering/assets/10288753/b7733815-2d89-4bbb-8f0f-fa6b079cb672
There are at least 3 types of artifacts I'm noticing:
Please note that the reason why
rayleigh_density_layer0_exp_scale
is-1.00
is that I apply the density equation to the relative altitude instead of the absolute altitude, as can be seen in the source.These are the precomputed textures including each intermediary step: Prescattered.zip
This is the repository containing the source code: https://github.com/CrushedPixel/BrunetonAtmosphereUnreal/
This is the function calls that produce the above result: https://github.com/CrushedPixel/BrunetonAtmosphereUnreal/blob/e1e2faee253215d13b940d27164623abb691ab59/Shaders/Private/BrunetonAtmosphere.ush#L34
I am thankful for any help, I would love to finally have an open Unreal Engine implementation of this that just works out of the gate and is free!