Cosmonium: A 3D astronomy and space exploration program

Exactly like that, you put the code in the modules directory and you put a reference in the yaml file, like the model actually. Here is a zip with everything included, you can extract it in the extra directory and it should be loaded when you start the app :

Note that you need the latest snapshot of the development branch.

That’s like any other objects, you can select them by pressing the Tab key then enter their name, then press G to go to them, or use the wheel to navigate to it. You can go to the help menu, you have the list of all the navigation shortcuts you can use.
Beware that you could end up upside down or under the surface (I still have to work on that), but you can orbit the camera around the object easily.

Yes, I’m working on adding spacecrafts and ships. The cockpit is used to attach elements to the node holding the camera when you’re inside the spacecraft (But there is still lots of work to do :slight_smile: )

thanks for your help but it’s not work for me, i extract zip files in data file
cosmonium\data\curiosity.yaml
cosmonium\data\models
cosmonium\data\modules

when i start cosmonium, cosmonium not load curiosity.yaml
I’m in windows 10, i use develop branch and i pull this branch.

data directory is extra directory ?

The data directory is not scanned recursively, to load add-ons you have to put them in the user extra directory, on Windows it should be C:\Users\AppData\Local\cosmonium\extra
You could also add them in data/extra in the Cosmonium directory (as the directory was empty it was not present in the git repository, I added a README.md inside it now).

thank you very much, it works!

I dont’ undestand how add heightmap for Mars
i download Mars_MGS_MOLA_DEM_mosaic_global_463m heightmap jpg:

i copy this image in data/solar-system/mars/textures
i edit data/solar-system/mars/mars.yaml like this:
system:

system:
    name: Mars System
    orbit: mars
    children:
        - planet:
            name: Mars
            radius: 3396.2
            ellipticity: 0.00589
            albedo: 0.150
            point-color: [1, 0.75, 0.7]
            surfaces:
                - category: visible
                  appearance:
                      texture: textures/mars-surface-vanvliet/mars-surface-vanvliet.ctx
                      normalmap: textures/mars-normal-vanvliet/mars-normal-vanvliet.ctx
                      attribution: vanvliet
            rotation: mars
            heightmap:
               type: texture
               max-height: 65535
               interpolator: bspline
               data:
                 type: ctx
                 root: textures/Mars_MGS_MOLA_DEM_mosaic_global_463m.jpg
                 ext: png
                 size: 1024
        - moon:
            name: Phobos
            radius: 27
            albedo: 0.071
            surfaces:
                - category: visible
                  shape:
                      type: mesh
                      model: phobos-thomas.ply
                      attribution: [thomas, frieger]
                      create-uv: true
                  appearance:
                      texture: textures/phobos-bw-stooke.png
                      attribution: stooke
                  lighting-model: oren-nayar
                - category: topographic
                  appearance:
                      texture: textures/phobos-topographic-thomas.jpg
                      attribution: thomas
                  lighting-model: flat
            orbit: phobos
            rotation: phobos
        - moon:
            name: Deimos
            radius: 15
            albedo: 0.068
            surfaces:
                - category: visible
                  shape:
                      type: mesh
                      model: deimos-thomas.ply
                      attribution: [thomas, frieger]
                      create-uv: true
                  appearance:
                      texture: textures/deimos-bw-stooke.png
                  lighting-model: oren-nayar
            orbit: deimos
            rotation: deimos

can i use extra folder for add heightmap to mars ? or i must edit original mars.yaml file ?

You can use the extra folder to add a new surface to an existing body, but you can not reference the texture of another surface, which means you have to copy the texture to the extra directory. I should find a way to be able to link textures from other surfaces.

It can not work because your heightmap is a texture and you are using as the root directory of a virtual texture. You should simply set data to your file. Also, you should comment out the normalmap from the appearance, because it will conflict with the normals generated using the heightmap.

For reference, here is the full heightmap : https://www.dropbox.com/s/214ufko7s6us324/Mars_MGS_MOLA_DEM_mosaic_global_463m.zip?dl=0

And here is the modified mars.yaml I’m using : https://www.dropbox.com/s/xenr5c88azcdr1m/mars.zip?dl=0

i replace mars.yaml with your file and add Mars_MGS_MOLA_DEM_mosaic_global_463m folder in /data/solar-system/mars/textures but i have an error when i go to Mars:
File “cosmonium\cosmonium\heightmap.py”, line 121, in copy_from
self.lod = heightmap_patch.lod
AttributeError: ‘NoneType’ object has no attribute ‘lod’

I can reprocduce your problem, the actual error is a few line before in the log :

 File textures/Mars_MGS_MOLA_DEM_mosaic_global_463m/level0/tx_1_0.png not found

That means you haven’t copied the heightmap virtual texture at the right place or with the wrong name.

Now the app you display an error to the user and use a default value for the heightmap instead of crashing like that… So many things to do, so few time :slight_smile:

I thank you for the api you added, I can do almost anything I want.
I was able to put an interactive lunar base.
I hope your program will meet with success, the possibilities of modding are enormous.

Thank you for the feedback, it’s nice to know I’m going in the right direction and what I’m doing is useful :slight_smile:

After more than a year, here is a new version of Cosmonium, v0.2.0 ! What started as a simple bugfix release ended up with tons of new features (and bugfixes too :slight_smile: )

The engine

The engine itself got many bugfixes and improvements, notably the most time consuming functions are now ported to C++, which gives a huge performance boost.
Basic support for object control with scripting is added. It’s now possible to add a cockpit on your screen or even a full ship and follow it around.
Procedural generation got some attention too, glitches and seams are mostly gone now, several more noise sources and functions are available. Rings can also be procedurally generated now.

Rendering

The rendering engine got PBR support for the rendering of the glTF models.
The atmospheric scattering has been improved too and is much more realistic (though not yet perfect), it provides atmospheric extinction on all the objects seen through an atmosphere.

Eclipse shadows now also support non-spherical objects; object self shadowing is also improved with configurable bias and PCF filtering.
Stereoscopic rendering is available, full VR support is for the next release though.
As a proof of concept, there is also a volumetric raymarching engine, it can already be used to generate diffuse and emission nebulae.

User interface

The use interface has been greatly improved, thanks to the work of @Epihaius, @Moguri @Thaumaturge, @wolf. Using their libraries, you can now edit some of the parameters of the bodies and see the changes in real time! The application parameters can be edited from a window instead of modifying a hidden yaml file. You can also open a embedded browser to get more information about most of the object you see. And lastly, you have a file selector to load scripts or to select the screenshot directory.

It’s now also possible to select point-like objects with the mouse. There is internationalization support (with French now available).

Astronomy

Well, that’s the purpose of this app after all :slight_smile: The orbits and rotation models of all the main planets and moons of the solar system are now using accurate theories. This means their position and orientation should be much more realistic. The eclipses and transits in the app are now occurring at the correct time and with the right configuration.

Missing moons and newly discovered objects have been added.

Next steps

For the next release, I plan to redo the core engine and port more of the time consuming code, like the geometry generation, to C++; and make it more robust. This will allow adding many more stars and objects!
The rendering will get improvements with Bruneton atmospheric scattering, environment map, proper exposure correction, VR support, …

The new installers and binaries for Windows, Mac and Linux are available here. And for the curious, see the changelog for much more details.

4 Likes

This looks really impressive! It seems that you’ve improved upon the last version greatly! :slight_smile:

(And I’m glad that my contributions have been of service. ^_^)

1 Like

This is really impressive! The ISS screenshot deserves to be on the Panda3D’s website imho. :slight_smile: If you want to extend your l10n to italian, I am available. Gratz!

1 Like

Congratulations on the new release :slight_smile: !

But it looks like a file (shuttle_controls.egg.pz) is missing (at least from the Windows installer), as reported here:

t’en fais pas, ça arrive :wink: .

1 Like

Thank you all for you kind words and support !

All the DirectGui contribs are incredibly useful, it allowed me to test and modify parameters and things in app in real time instead of continuously modify config files and restart the app. You can’t imagine how much time I saved thanks to you :slight_smile:

Thank you ! And any contribution is always warmly welcome :slight_smile:

Saperlipopette, je me suis fait eu ! The file is indeed missing :frowning: It’s actually coming from the Panda3D distribution, and if you have Panda3D installed at a usual place the app gets it from there and hide the bug… I guess a bug fix release is in order :slight_smile:

1 Like

Ah, that’s excellent to read! :slight_smile:

Do you have any python script examples that show how to start the engine with given bodies/objects/reference frame and control the objects’+camera positions and attitude in that frame?
Je cherche un petit outil de visualisation pour de la dynamique orbitale et ce serait avec plaisir que j’utiliserais ton joli travail :slight_smile:

1 Like

You can use the --default option on the command line to specify the target object at start up, or configure it in the cosmonium.yaml config file (see the syntax in the wiki page.

It’s possible to attach a controller script to bodies/object and so program their trajectory and attitude (I see I still have to document it in the wiki though…)

Lastly, it’s not possible for a script to take control of the camera yet, but it’s an easy change: the camera code use the same interface as the object controllers so I think I can fix that quickly :slight_smile:

It’s a pleasure! We can continue in PM if you want and discuss more in detail what the app should do for your use case (et basculer en français si tu veux :stuck_out_tongue: )

A new bugfix release, V0.2.1, is now available. It fixes the infamous crash occurring when opening the editor or the preference window, a couple of issues with shadows, and some performance issues.

It also contains Italian translation (many thanks to @flavio), a more sleek layout for the editors (many thanks also to @Epihaius), support of overlap for the heightmap (this remove normal seams between the patches), better data interpolation and filtering to remove surface artefacts, additional command for cel script, improved camera and navigation control, basic plugin support, preliminary SDK to control the engine, etc.

Here is a LEM on the Apollo 15 landing site with Mons Hadley in the background. This is using the Lunar Orbiter DEM to render the elevation

(Surface self-shadowing is still missing, also higher definition DEM should be stacked to have accurate depiction of the terrain around the LEM, and detail map could be used to make the surface more dusty but that’s for another release :stuck_out_tongue: )

The next step is to rewrite the core of the engine and separate the astronomy, simulation and rendering aspects (and port the simulation part entirely to C++). This should make the engine scalable and more efficient. Once done, the rendering could then be improved to have better realism.

As usual the binaries can be downloaded from here and the full changelog is available there :slight_smile:

6 Likes

@eldee, very nice!
Thank you for development!

1 Like