http://forum.celestialmatters.org/ 

Manifestations of Atmospheric Light Scattering (Mie Theory) http://forum.celestialmatters.org/viewtopic.php?f=9&t=116 
Page 4 of 7 
Author:  t00fri [ Thu, 151107, 21:24 GMT ] 
Post subject:  
chris wrote: chris wrote: t00fri wrote: The result of the call > scattersim l w 1024 h 1024 earth.cfg seems to exhibit still some strange artefacts in the image in topright position: You're right . . . I hadn't noticed it in the smaller views. I'm looking into it nowit's quite tricky to use the lookup tables properly. Chris It looks like they're artifacts of bilinear interpolation in the extinction lookup table. I think that I probably need to change my approach slightly and create a lookup table of optical depths, then compute the extinction from that. The optical depth doesn't vary linearly either (with view height and angle), but it's much closer to linear than extinction, which is exp(optical depth). Chris Chris, it seems to me that such regular "interference type" patterns dont look very much like interpolation artefacts. But probably one has simply to try otherwise. Bye Fridger 
Author:  chris [ Thu, 151107, 21:45 GMT ] 
Post subject:  
t00fri wrote: chris wrote: It looks like they're artifacts of bilinear interpolation in the extinction lookup table. I think that I probably need to change my approach slightly and create a lookup table of optical depths, then compute the extinction from that. The optical depth doesn't vary linearly either (with view height and angle), but it's much closer to linear than extinction, which is exp(optical depth). Chris Chris, it seems to me that such regular "interference type" patterns dont look very much like interpolation artefacts. But probably one has simply to try otherwise. Bye Fridger Some evidence that it is an interpolation artifact: you can work around the problem for now by increasing the size of the extinction lookup table: in scattersim.cpp, adjust the constant ExtinctionLUTViewAngleSteps from 256 to 512. Chris 
Author:  t00fri [ Thu, 151107, 22:03 GMT ] 
Post subject:  
Chris, indeed, I modified both // Extinction lookup table dimensions const unsigned int ExtinctionLUTHeightSteps = 256; const unsigned int ExtinctionLUTViewAngleSteps = 512; and the artefact was gone. Any reason against increasing 'const unsigned int ExtinctionLUTHeightSteps = 256;' also by a factor of two? It is clear that it is related to the LUT, since without the l option the artefact is not present. bye Fridger 
Author:  chris [ Thu, 151107, 22:11 GMT ] 
Post subject:  
t00fri wrote: Chris,
indeed, I modified both // Extinction lookup table dimensions const unsigned int ExtinctionLUTHeightSteps = 256; const unsigned int ExtinctionLUTViewAngleSteps = 512; and the artefact was gone. Any reason against increasing 'const unsigned int ExtinctionLUTHeightSteps = 256;' also by a factor of two? It is clear that it is related to the LUT, since without the l option the artefact is not present. I've been trying to keep the LUTs as small as possible. Since my plan is to implement this technique in Celestia on the GPU with the LUTs in textures, it's best to not waste graphics memory by making them unnecessarily large. Increasing the size of the extinction LUT isn't such a problem since it's only 2D. However, the inscattering LUT is 3D, and thus the maximum size of any dimension is quite constrained. Chris 
Author:  t00fri [ Thu, 151107, 22:22 GMT ] 
Post subject:  
Chris, in your .cfg files, did you generally tune the wavelengths corresponding to your Rayleigh colors to be in the ration 1/lambda^4? The relation between RGB colors and wavelengths can be looked up in the net. F. 
Author:  chris [ Thu, 151107, 22:47 GMT ] 
Post subject:  
t00fri wrote: Chris,
in your .cfg files, did you generally tune the wavelengths corresponding to your Rayleigh colors to be in the ration 1/lambda^4? The relation between RGB colors and wavelengths can be looked up in the net. Yes, I did. I assumed 600nm for red, 520nm for green, and 450nm for blue. It occurs to me that the cfg files would be easier to edit if there was a separate term multiplied that was multiplied by the scattering coefficients. Then you could change the density of the atmosphere by adjusting that one term while leaving the separate rgb values alone and maintaining the 1/lambda^4 relationship. Chris 
Author:  t00fri [ Thu, 151107, 23:11 GMT ] 
Post subject:  
Good... I wonder how to simplify the adjustments of the various colorrelated parameters. Perhaps it would be easier to use my H S V > RGB routine (galaxy.cpp) with the constraint of 1/lambda^4 RGBlambda ratios. What one typically wants is to modify the Value=V, and the Hue=H. It may be the easier approach to reality. Normally one wants to keep the Saturation=S rather constant. While I didn't have the time to compare the definitions of your various Mie parameters in scattersim with those previously used in Celestia, the question is how similiar they are at this time? It rather seems their definition is NOT identical. Bye F. 
Author:  t00fri [ Fri, 161107, 0:29 GMT ] 
Post subject:  
Warming up a bit with 'scattersim' for Titan... Here are the modified parameters: Code: Radius 2575
SurfaceRed 0.5 SurfaceGreen 0.5 SurfaceBlue 0.5 RayleighScaleHeight 0 RayleighRed 0.00106 RayleighGreen 0.0018 RayleighBlue 0.00323 MieScaleHeight 220.0 Mie 0.00005 MieAsymmetry 0.15 AbsorbScaleHeight 60 AbsorbRed 0.0035 AbsorbGreen 0.0075 AbsorbBlue 0.025 The Raleigh ratios have not been changed in order to retain 1/lambda^4 scaling. Bye F. 
Author:  t00fri [ Fri, 161107, 0:32 GMT ] 
Post subject:  
I don't really understand the behaviour of the MieAssymetry parameter. Got to look into the code. The backscattering is not really increasing when it's negative value grows... F. 
Author:  chris [ Fri, 161107, 0:45 GMT ] 
Post subject:  
t00fri wrote: Good...
I wonder how to simplify the adjustments of the various colorrelated parameters. Perhaps it would be easier to use my H S V > RGB routine (galaxy.cpp) with the constraint of 1/lambda^4 RGBlambda ratios. What one typically wants is to modify the Value=V, and the Hue=H. It may be the easier approach to reality. Normally one wants to keep the Saturation=S rather constant. While I didn't have the time to compare the definitions of your various Mie parameters in scattersim with those previously used in Celestia, the question is how similiar they are at this time? It rather seems their definition is NOT identical. I think that the Rayleigh and Mie parameters in scattersim are differ from Celestia's by a factor of 4*PI. Scattersim should probably be modified. In Celestia, the Rayleigh and Mie values represent the fraction of light lost to outscattering per kilometer at h=0 (sea level.) In scattersim, these values K/lambda^4, where K is the constant molecular density at sea level. The attenuation due to outscattering is 4*PI*K/lambda^4. I think that attenuation is the more intuitive quantity to use. I don't think that it's appropriate to use HSV here, since we're not describing a color but attenuation as a function of wavelength (albeit with just three wavelength samples.) We should be able to calculate correct values for Earth's atmosphere. Nishita gives K as: 2*pi^2*(n^2  1)^2 / (3*Ns) where n is the index of refraction of air, and Ns is the molecular number density of the standard atmosphere. If you try this, keep in mind that both scattersim and Celestia want attenuation coefficients in units of km^1, not meters^1. Chris 
Author:  chris [ Fri, 161107, 0:48 GMT ] 
Post subject:  
t00fri wrote: Warming up a bit with 'scattersim' for Titan...
Here are the modified parameters: Code: Radius 2575 SurfaceRed 0.5 SurfaceGreen 0.5 SurfaceBlue 0.5 RayleighScaleHeight 0 RayleighRed 0.00106 RayleighGreen 0.0018 RayleighBlue 0.00323 MieScaleHeight 220.0 Mie 0.00005 MieAsymmetry 0.15 AbsorbScaleHeight 60 AbsorbRed 0.0035 AbsorbGreen 0.0075 AbsorbBlue 0.025 The Raleigh ratios have not been changed in order to retain 1/lambda^4 scaling. Hmmm . . . I don't think that the Rayleigh scale height should be zerosurely the molecular nitrogen in Titan's atmosphere is responsible for some Rayleigh scattering. Chris 
Author:  t00fri [ Fri, 161107, 1:05 GMT ] 
Post subject:  
chris wrote: I think that the Rayleigh and Mie parameters in scattersim are differ from Celestia's by a factor of 4*PI. Scattersim should probably be modified. In Celestia, the Rayleigh and Mie values represent the fraction of light lost to outscattering per kilometer at h=0 (sea level.) In scattersim, these values K/lambda^4, where K is the constant molecular density at sea level. The attenuation due to outscattering is 4*PI*K/lambda^4. I think that attenuation is the more intuitive quantity to use. Aha! That's what I mostly figured out qualitatively. Quote: I don't think that it's appropriate to use HSV here, since we're not describing a color but attenuation as a function of wavelength (albeit with just three wavelength samples.)
We should be able to calculate correct values for Earth's atmosphere. Nishita gives K as: 2*pi^2*(n^2  1)^2 / (3*Ns) where n is the index of refraction of air, and Ns is the molecular number density of the standard atmosphere. If you try this, keep in mind that both scattersim and Celestia want attenuation coefficients in units of km^1, not meters^1. Chris Yes for Earth we can calculate it, but for Titan and Venus I don't think we can. F. 
Author:  t00fri [ Fri, 161107, 1:10 GMT ] 
Post subject:  
chris wrote: t00fri wrote: Warming up a bit with 'scattersim' for Titan... Here are the modified parameters: Code: Radius 2575 SurfaceRed 0.5 SurfaceGreen 0.5 SurfaceBlue 0.5 RayleighScaleHeight 0 RayleighRed 0.00106 RayleighGreen 0.0018 RayleighBlue 0.00323 MieScaleHeight 220.0 Mie 0.00005 MieAsymmetry 0.15 AbsorbScaleHeight 60 AbsorbRed 0.0035 AbsorbGreen 0.0075 AbsorbBlue 0.025 The Raleigh ratios have not been changed in order to retain 1/lambda^4 scaling. Hmmm . . . I don't think that the Rayleigh scale height should be zerosurely the molecular nitrogen in Titan's atmosphere is responsible for some Rayleigh scattering. Chris Of course, the height should be nonzero. But if I set a nonzero value, a sharp colored ring appears around the scale height, which is obviously incorrect. So I got to see what's in the code. If I set the scale height 12 it's still OK. But bigger values produce that artefact. F. 
Author:  chris [ Fri, 161107, 22:56 GMT ] 
Post subject:  
t00fri wrote: Of course, the height should be nonzero. But if I set a nonzero value, a sharp colored ring appears around the scale height, which is obviously incorrect. So I got to see what's in the code. If I set the scale height 12 it's still OK. But bigger values produce that artefact.
I'd like to see an image of this phenomenon along with the parameter set you used to produce it. There could be bugs in the code, but I'm confident enough in it that I think what you're seeing might be realistic. Chris 
Author:  t00fri [ Fri, 161107, 23:18 GMT ] 
Post subject:  
chris wrote: t00fri wrote: Of course, the height should be nonzero. But if I set a nonzero value, a sharp colored ring appears around the scale height, which is obviously incorrect. So I got to see what's in the code. If I set the scale height 12 it's still OK. But bigger values produce that artefact. I'd like to see an image of this phenomenon along with the parameter set you used to produce it. There could be bugs in the code, but I'm confident enough in it that I think what you're seeing might be realistic. Chris OK here it is. Same parameters as previous titan image, except RayleighScaleHeight = 100.0 instead of = 0, previously. Bye Fridger 
Page 4 of 7  All times are UTC 
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ 