10110111 / CalcMySky

Simulator of light scattering by planetary atmospheres
GNU General Public License v3.0
29 stars 7 forks source link

Failed to load ShowMySky library #1

Closed tsurezuregusa closed 2 years ago

tsurezuregusa commented 2 years ago

Greetings,

I tried compiling this. The CalcMySky component seems to work fine with the example file, but ShowMySky gives this error: Failed to load ShowMySky library. The window appears but it is black aside from the settings sliders. This is on debian stable.

I found your post to stackexchange, and would like to generate similar samples of sky colors with different parameters.

10110111 commented 2 years ago

How did you install it? Or did you run ShowMySky from the build directory? In the latter case (or if your install prefix is non-standard) you need to add the library directory to LD_LIBRARY_PATH.

10110111 commented 2 years ago

For example, after building on a new machine I can run from the build directory as follows (while being in the build directory):

export LD_LIBRARY_PATH=$PWD/ShowMySky
./ShowMySky/showmysky ~/path/to/files
tsurezuregusa commented 2 years ago

I am sorry. I was not thinking. I had not noticed that make install failed when I tried earlier. It works.

May I ask about how to change the atmosphere parameters for different star temperatures? I suppose took screenshots to make those images?

10110111 commented 2 years ago

Temperature of the sun can be changed via Solar spectrum box, choosing Black body and then the temperature in the spinbox that appears. Adjust exposure to compensate for changing brightness (it's not done automatically, to make brightness changes obvious). You'll need to have run calcmysky with --radiance option, otherwise the textures generated will only contain luminance and chromaticity, which is insufficient for this calculation.

The parameters of the atmosphere itself are changed in the .atmo file that you feed to calcmysky. I haven't yet documented the syntax, but I hope the file structure is easy to understand intuitively. In particular, density can be altered by editing the number density field in the Scatterer "molecules" section (it's just a GLSL snippet that'll go into the shader). Multiply the coefficient of the exp by 0.25 or 10 and you get the leftmost or the rightmost column, respectively.

Don't forget to re-run calcmysky to update the model if you change the .atmo file. Also, for these particular calculations you can save time by passing --no-eds-tex parameter to avoid long calculation of eclipsed double scattering textures.

Note also that the table in the post you linked to was generated without any ozone or aerosols, so to reproduce it you'll need to remove these sections.

As for screenshots, I did take them, but then, to shape them into the small horizontal patches, I did a bit of mechanical manipulation using ImageMagick. In particular, for each screenshot I cut a vertical line corresponding to 0° azimuth, rotated it to make it horizontal and then just replicated it vertically.

tsurezuregusa commented 2 years ago

Thank you very much for the detailed instructions. I will try this tomorrow. Is the float in the density fields some kind of gas coefficient? Would it be simple to change this for a cloudy sky with Mie scattering or different composition of nitrogen/oxygen for Rayleigh?

10110111 commented 2 years ago

The floats are what they are named: scale height describes the rate of decay of density with altitude, total ozone amount describes the total ozone column (see Dobson unit), etc.

To change composition of nitrogen/oxygen you'll have to alter the cross section at 1 μm wavelength (see cross section at 1 um field).

Cloudy skies are problematic, because clouds are usually non-homogeneous in latitude & longitude, while the model used here depends crucially on spherical symmetry of the atmosphere. But homogeneous cloud layers can be simulated by providing the appropriate aerosol density profile (procedurally, by altering the GLSL snippet). E.g. add a bump of aerosol density around some altitude.

If you do this, don't forget to check the number of points for radial integration (see radial integration points and transmittance integration points fields). These parameters are currently chosen as sufficient for the atmosphere described in this file. For less smooth altitude profiles you may need to increase them.

tsurezuregusa commented 2 years ago

Thank you again. The detailed instructions are very helpful. I will need to learn more about the physics to adjust these.

I have one more question if you do not mind.

Did you adjust the exposure for different star temperature based on some calculation?

Edit: I see there is Earth-Sun distance in the setting. I suppose you changed this.

10110111 commented 2 years ago

No, I just used the exposure manipulator to manually achieve the case when colors are not clipped and yet not too dark.

Screenshot - 010222 - 12:56:48

tsurezuregusa commented 2 years ago

It seems that Earth-Sun distance does not change the brightness. Is there a way to systematically control the brightness?

10110111 commented 2 years ago

I've pushed an update to read Earth-Sun distance from the settings file when calculating blackbody spectrum. But you won't be able to make the Sun much closer (0.5 AU is minimum), because the calculations rely on the angular size being small enough.

tsurezuregusa commented 2 years ago

This is very helpful! Thank you very much! In the weekend I will try to make the series of images.

tsurezuregusa commented 2 years ago

I was able to spend more time on this, and the results are beautiful! Thank you for making this and your help!

I notice that the maximum temperature for the black body is fixed at 9999K. Is there a reason for this? I changed the code to allow up to O class, and the colors look consistent with what I expect.

Also, is there a logic for the exposure number? Why did you set the default to -4.20 and what does 0 signify?

10110111 commented 2 years ago

I notice that the maximum temperature for the black body is fixed at 9999K. Is there a reason for this?

I simply didn't expect the need for higher temperature :) Also, this would require extension of the exposure slider scale, which seemed unnecessary.

Also, is there a logic for the exposure number? Why did you set the default to -4.20 and what does 0 signify?

The colors are calculated in XYZ color space, where Y is in cd/m², and then converted to sRGB. Exposure is a multiplier for Y that makes the final RGB triplet hopefully fit in the [0..1] range. The -4.2 is the default because it works well for the sample.atmo atmosphere with the default state of the manipulators.

If you set log₁₀(exposure) to 0, then clipping will happen at about 0.5 cd/m² in the scene.