Creating a 3D Mars Model from USGS ISIS3 Data

All about models for Celestia. How-to, programs, work in progress...
Avatar
Topic author
CM1215 M
Posts: 219
Joined: 30.08.2017
Age: 19
With us: 3 years 9 months
Location: Ohio, U. S. A.

Creating a 3D Mars Model from USGS ISIS3 Data

Post #1by CM1215 » 03.06.2021, 19:05

NOTE: The thread according to the current topic title starts with cartrite's first reply (post #6).

Hello,

I am currently trying to apply a high-definition texture (32k) to a 3d model in Celestia, since VTs are incompatible with models. However, upon attempting to render the model with the texture applied, Celestia freezes and crashes. As such, I was wondering if there was a variant of Celestia available that could support single textures of 32k resolution and render them without crashing.

Does anyone have any information concerning such a variant?
Last edited by CM1215 on 10.06.2021, 14:31, edited 2 times in total.
CM1215: Celestial master in learning.

Avatar
Art Blos M
Moderator
Posts: 945
Joined: 31.08.2017
Age: 28
With us: 3 years 9 months
Location: Volgodonsk, Rostov Oblast, Russia

Post #2by Art Blos » 03.06.2021, 19:18

We have long ago discovered the limiting resolution of monolithic textures in conjunction with models - 8k (8192 x 4096 px).
At 16k either emergency shutdown or black hole effect.

I think it’s a matter of memory limitation. Perhaps, on especially powerful computers, everything could work.
Founder and head of the project "Celestia Origin"

Avatar
SevenSpheres
Moderator
Posts: 579
Joined: 08.10.2019
With us: 1 year 8 months

Post #3by SevenSpheres » 03.06.2021, 19:22

This is not a limitation of Celestia, but of your computer/graphics card. Most(?) graphics systems have a maximum texture size of 8K-16K. You can check your max texture size within Celestia by going to Help -> OpenGL Info.
My Addons: viewtopic.php?f=23&t=19978 • Contributing to development as much as I can occasionally • Discord server admin
PC specs: HP desktop, Windows 10 Home 64-bit, Intel Core i7-7700 (3.60 GHz), 16 GB RAM, 1 TB HDD + 128 GB SSD, Intel HD Graphics 630
Celestia versions: 1.5.1, 1.6.1, 1.6.2 (primary), 1.7.0 (latest build + some older ones)

Avatar
Topic author
CM1215 M
Posts: 219
Joined: 30.08.2017
Age: 19
With us: 3 years 9 months
Location: Ohio, U. S. A.

Post #4by CM1215 » 03.06.2021, 19:28

Art Blos wrote:We have long ago discovered the limiting resolution of monolithic textures in conjunction with models - 8k (8192 x 4096 px).

On the computer I'm using, the limit appears to be 16k rather than 8k. On my home computer (to which I currently do not have access), the limit is much higher, almost but not quite 32k. After a long freeze it will successfully render a 28k normal map on a mesh.

SevenSpheres wrote:This is not a limitation of Celestia, but of your computer/graphics card. Most(?) graphics systems have a maximum texture size of 8K-16K. You can check your max texture size within Celestia by going to Help -> OpenGL Info.

Thank you, good to know. This makes sense, since my home computer is quite a bit more powerful than the laptop I'm currently using. Acording to the OpenGL info here, my max texture size is 16k as expected.
CM1215: Celestial master in learning.

Avatar
Art Blos M
Moderator
Posts: 945
Joined: 31.08.2017
Age: 28
With us: 3 years 9 months
Location: Volgodonsk, Rostov Oblast, Russia

Post #5by Art Blos » 03.06.2021, 19:39

CM1215 wrote:On the computer I'm using, the limit appears to be 16k rather than 8k. On my home computer (to which I currently do not have access), the limit is much higher, almost but not quite 32k. After a long freeze it will successfully render a 28k normal map on a mesh.
My information is most relevant for most modern computers (the limit was determined on several computers of different capacities available).

I warn you that if the goal is to create an addon for a mass user, then your idea is meaningless.
But if everything is done for a personal use, then buy a powerful video card and more RAM.
Founder and head of the project "Celestia Origin"

Avatar
cartrite
Posts: 1827
Joined: 15.09.2005
With us: 15 years 9 months
Location: Pocono Mountains, Pennsylvania, USA

Post #6by cartrite » 03.06.2021, 21:43

I used to create meshes of Mars. The ones I never published were rather large. I was able to split the meshes into "tiles". As in virtual textures. The cmod file format allowed me to assign a single texture to each "model tile". The model file had 4 meshes. So if I wanted a 32k texture to cover the planet, I was able to have 4 separate meshes on one model with 4 separate textures each at 8192 X 16384. Pole to pole. But it was impossibly SLOW in loading.
AMD A4-9125 RADEON R3, 4 COMPUTE CORES 2C+2G 2.30 GHz AMD Radeon(TM) R3 Graphics Running on Windows 10 and OpenSuse 15.2

Avatar
Topic author
CM1215 M
Posts: 219
Joined: 30.08.2017
Age: 19
With us: 3 years 9 months
Location: Ohio, U. S. A.

Post #7by CM1215 » 04.06.2021, 00:12

cartrite wrote:I used to create meshes of Mars. The ones I never published were rather large. I was able to split the meshes into "tiles". As in virtual textures. The cmod file format allowed me to assign a single texture to each "model tile". The model file had 4 meshes. So if I wanted a 32k texture to cover the planet, I was able to have 4 separate meshes on one model with 4 separate textures each at 8192 X 16384. Pole to pole. But it was impossibly SLOW in loading.

That's interesting, since a mesh of Mars was what I was working with also. How detailed is your model, and would you be willing to publish it as a single file (not separated into tiles or separate meshes, if that's available)?

No matter how slow it loads in, I'm mildly sure I'll be able to handle it for the improved appearance of Mars.
CM1215: Celestial master in learning.

Avatar
cartrite
Posts: 1827
Joined: 15.09.2005
With us: 15 years 9 months
Location: Pocono Mountains, Pennsylvania, USA

Post #8by cartrite » 04.06.2021, 00:59

Code: Select all

molaMarsPlanetaryRadius0005.cub
That file is part of Isis3 data/base folder. It's in the public domain. It's from USGS AstroGeology. I can't remember it's size but it is quite large. It is the topographic map used for processing Mars images. There is also a program that I think is part of Celestia that will change a topo map into a cmod. Chris Laurel wrote it along with Fridger Schemp. I think it's part of the tools folder. The file above is in a x / y grid which can be sectioned. The missing part of the puzzle will probably be GDAL. gdal.org This is the software I used to map and link textures to models of Mars.

The textures I mapped to the mola topo were from the MRO CTX camera. 12 meters per pixel. I never did get it completed but I'm thinking about giving it another go. Not quite ready yet. Need a better computer. This one isn't too bad but I do need to increase the ram. It's only got 4 gb now but it can handle 16.
AMD A4-9125 RADEON R3, 4 COMPUTE CORES 2C+2G 2.30 GHz AMD Radeon(TM) R3 Graphics Running on Windows 10 and OpenSuse 15.2

Avatar
Topic author
CM1215 M
Posts: 219
Joined: 30.08.2017
Age: 19
With us: 3 years 9 months
Location: Ohio, U. S. A.

Post #9by CM1215 » 04.06.2021, 01:53

cartrite wrote:That file is part of Isis3 data/base folder. It's in the public domain.
How exactly do I access this file?
CM1215: Celestial master in learning.

Avatar
cartrite
Posts: 1827
Joined: 15.09.2005
With us: 15 years 9 months
Location: Pocono Mountains, Pennsylvania, USA

Post #10by cartrite » 04.06.2021, 08:59

I installed ISIS. https://github.com/USGS-Astrogeology/ISIS3#installation You probably don't need install it though. Scroll down the page until you see
Partial Download of ISIS Base Data
But this file will be in .cub format which still is a raw elevation model with a large header. I would recommend installing ISIS though. Then you can use isis2raw to process the file into sections and qview to see what your doing.

But you say you already have a model. I thought you wanted to texture it with a 32k texture. If you look into GDALgdal.org, I think that is the software that could map your texture to your model. Create 4 textures at 16384x8192, and map one to -180 0 long 90 0 lat another to, 0 180 long 90 0 lat, etc. GDAL should be able to use .cub formats also if you decide to download ISIS base data. In the base folder is a dem folder with many elevation models of Earth, Mars, the Moon, asteroids, etc.
AMD A4-9125 RADEON R3, 4 COMPUTE CORES 2C+2G 2.30 GHz AMD Radeon(TM) R3 Graphics Running on Windows 10 and OpenSuse 15.2

Avatar
Topic author
CM1215 M
Posts: 219
Joined: 30.08.2017
Age: 19
With us: 3 years 9 months
Location: Ohio, U. S. A.

Post #11by CM1215 » 04.06.2021, 13:49

I'm currently trying to install ISIS, but Anaconda is failing to find the ISIS package in the usgs-astrogeology channel. I've followed all the instructions so far, except I wasn't sure how to open up a bash prompt, so instead I simply opened Anaconda's own command prompt.

Added after 2 hours 38 minutes:
It's appearing that I need to install ISIS on a Linux or Mac system, and that it won't work on the Windows 10 system I'm currently using. Is the .cub file that you mentioned something that can be uploaded for me to download, or is it only accessible via ISIS?
CM1215: Celestial master in learning.

Avatar
cartrite
Posts: 1827
Joined: 15.09.2005
With us: 15 years 9 months
Location: Pocono Mountains, Pennsylvania, USA

Post #12by cartrite » 04.06.2021, 19:41

http://planetarygis.blogspot.com/2017/07/isis3-on-windows-10-bash.html You can try that page wsl. Then keep in mind that to get the folder with the dems you need rsync. I'm not sure if that can be run on windows either. There is another option that you could consider. VMWARE. That would let you run a linux version in a virtual machine. To just get the files,

Code: Select all

rsync -azv --delete --partial isisdist.astrogeology.usgs.gov::isisdata/data/base .


But I'll repeat, what were you try to attach the 32k texture too? If you have a model, I suggest downloading GDAL. There is mention of windows binaries. Then you can map your textures to your model.

Also another option. I use external usb hard drives. With my former laptop I needed this because the internal hard drive failed years ago. So I installed linux on a usb drive. They are quit cheap. I got a 4 TiB drive form Walmarts a couple of months ago for $100. Then you could install any linux version you want. Warning though. Linux will take over booting your computer. I use Suse Leap 15.2 and the Grub bootloader never gave me any problems. Also keep in mind, There is HCL. Hardware compatibility list. Make sure your hardware is supported by whatever linux version you choose.
AMD A4-9125 RADEON R3, 4 COMPUTE CORES 2C+2G 2.30 GHz AMD Radeon(TM) R3 Graphics Running on Windows 10 and OpenSuse 15.2

Avatar
Topic author
CM1215 M
Posts: 219
Joined: 30.08.2017
Age: 19
With us: 3 years 9 months
Location: Ohio, U. S. A.

Post #13by CM1215 » 05.06.2021, 15:06

When I get the .cub file, what do I do with it? How to I get from the .cub file to a usable model that can be textured?
CM1215: Celestial master in learning.

Avatar
cartrite
Posts: 1827
Joined: 15.09.2005
With us: 15 years 9 months
Location: Pocono Mountains, Pennsylvania, USA

Post #14by cartrite » 05.06.2021, 16:26

Gdal should recognize. Cub files and export it 16 bit signed integer file. A dem.
AMD A4-9125 RADEON R3, 4 COMPUTE CORES 2C+2G 2.30 GHz AMD Radeon(TM) R3 Graphics Running on Windows 10 and OpenSuse 15.2

Avatar
Topic author
CM1215 M
Posts: 219
Joined: 30.08.2017
Age: 19
With us: 3 years 9 months
Location: Ohio, U. S. A.

Post #15by CM1215 » 05.06.2021, 22:26

Ok, so I successfully got a Ubuntu VM working on my laptop, and was able to install ISIS3 via Anaconda in the VM. I downloaded the base data (including the molaMarsPlanetaryRadius0005.cub file) and installed GDAL (also in the VM) in order to work with the .cub file. Now, what do I need to do? What commands do I need to use in order to properly use GDAL to work with the .cub file in question?
CM1215: Celestial master in learning.

Avatar
cartrite
Posts: 1827
Joined: 15.09.2005
With us: 15 years 9 months
Location: Pocono Mountains, Pennsylvania, USA

Post #16by cartrite » 06.06.2021, 01:27

I found out something today that will make this difficult. All the info I need to help you are on drives / computers that are in storage and not accessible to me at the moment. The software I wrote or modified to do this are not available. I would have needed to access CelestilalMatters forum to jog my memory. That was shut down for a while now.

First, you probably need an x-system desktop installed to use ISIS. Gdal can run on Windows. I use a different version of linux and I need a x based desktop to run ISIS programs. The version of GDAL I always used is command-line based so I would write scripts to accomplish what I needed. You may need one too. Second, get to know the software. GDAL and ISIS. These software suites are powerful and you can do some incredible things with them. If you got ISIS properly installed and configured, run catlab and save to a text-file. Run qview and look at the files in the dem folder. Look at the documentation. I ran catlab on the file, This is a part of what you'll see.
Object = IsisCube
Object = Core
StartByte = 65537
Format = Tile
TileSamples = 128
TileLines = 128

Group = Dimensions
Samples = 46082
Lines = 23042
Bands = 1
End_Group

Group = Pixels
Type = SignedWord
ByteOrder = Lsb
Base = 3396000.0
Multiplier = 1.0
End_Group
End_Object

Group = Mapping
ProjectionName = SimpleCylindrical
CenterLongitude = 180.0000000
TargetName = Mars
EquatorialRadius = 3396190.0 <meters>
PolarRadius = 3376200.0 <meters>
LatitudeType = Planetocentric
LongitudeDirection = PositiveEast
LongitudeDomain = 360
UpperLeftCornerX = -10669909.2276 <meters>
UpperLeftCornerY = 5335186.1556 <meters>
PixelResolution = 463.0836 <meters/pixel>
Scale = 127.99999292419 <pixels/degree>
End_Group
End_Object
That's a start.
Basically you'll need to scale that file down to a reasonable size, crop it into sections, crop your texture into sections, map the cropped sections to the cropped textures and convert the raster format it is in to a sphere. It will take a considerable effort. Not trivial. That's a lot of work. I've done it before and still can't completely remember how I did it without my old computers.
AMD A4-9125 RADEON R3, 4 COMPUTE CORES 2C+2G 2.30 GHz AMD Radeon(TM) R3 Graphics Running on Windows 10 and OpenSuse 15.2

Avatar
Topic author
CM1215 M
Posts: 219
Joined: 30.08.2017
Age: 19
With us: 3 years 9 months
Location: Ohio, U. S. A.

Post #17by CM1215 » 06.06.2021, 02:38

Is this situation made any less difficult by the fact that I found a large Mars height map (46080x23040 px) on the USGS website?

https://astrogeology.usgs.gov/search/map/Mars/GlobalSurveyor/MOLA/Mars_MGS_MOLA_DEM_mosaic_global_463m
CM1215: Celestial master in learning.

Avatar
Topic author
CM1215 M
Posts: 219
Joined: 30.08.2017
Age: 19
With us: 3 years 9 months
Location: Ohio, U. S. A.

Post #18by CM1215 » 07.06.2021, 13:18

cartrite wrote:There is also a program that I think is part of Celestia that will change a topo map into a cmod. Chris Laurel wrote it along with Fridger Schemp. I think it's part of the tools folder.
What is this program called, and do you happen to have a build of it available?
CM1215: Celestial master in learning.

Avatar
cartrite
Posts: 1827
Joined: 15.09.2005
With us: 15 years 9 months
Location: Pocono Mountains, Pennsylvania, USA

Post #19by cartrite » 08.06.2021, 10:43

I'm not sure. I know Fridger and Chris were using it but I can't remember what it was called. There was long discussion on the subject but most of it was on the CelestiaMatters forum. That was closed down for some time now. I think it may be cmodsphere or txt2cmod.

Added after 1 hour 32 minutes:
Yes that dem would work. You should probably scale it down though. Then crop to four separate tiles. Then the same with your texture. Then assign the textures to the four models.

Added after 30 minutes 33 seconds:
I am downloading the file and I will take a look at it. It is in tif format which may be geotif. You may need to convert it to raw signed int 16bit.

Added after 1 hour 3 minutes:
I wouldn't recommend getting that file. I would use the ISIS cub.
AMD A4-9125 RADEON R3, 4 COMPUTE CORES 2C+2G 2.30 GHz AMD Radeon(TM) R3 Graphics Running on Windows 10 and OpenSuse 15.2

Avatar
Topic author
CM1215 M
Posts: 219
Joined: 30.08.2017
Age: 19
With us: 3 years 9 months
Location: Ohio, U. S. A.

Post #20by CM1215 » 08.06.2021, 14:45

cartrite wrote:I wouldn't recommend getting that file. I would use the ISIS cub.
Out of curiosity, why? What is the difference between the .tif file and the ISIS .cub file, apart from the apparent 180-degree offset?

Also, after searching, I found that the program in question was indeed cmodsphere. I am attempting to compile it now. How would one use this to create not one but four different models that together form the entirety of Mars? Furthermore, would the separation of Mars into four models still allow me to apply a normalmap to give the mesh more detail?
CM1215: Celestial master in learning.


Return to “Modelling”

Who is online