Page 1 of 2
Creating a 3D Mars Model from USGS ISIS3 Data
Posted: 03.06.2021, 19:05
by CM1215
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?
Posted: 03.06.2021, 19:18
by Art Blos
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.
Posted: 03.06.2021, 19:22
by SevenSpheres
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.
Posted: 03.06.2021, 19:28
by CM1215
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.
Posted: 03.06.2021, 19:39
by Art Blos
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.
Posted: 03.06.2021, 21:43
by cartrite
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.
Posted: 04.06.2021, 00:12
by CM1215
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.
Posted: 04.06.2021, 00:59
by cartrite
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.
Posted: 04.06.2021, 01:53
by CM1215
cartrite wrote:That file is part of Isis3 data/base folder. It's in the public domain.
How exactly do I access this file?
Posted: 04.06.2021, 08:59
by cartrite
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 GDAL
gdal.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.
Posted: 04.06.2021, 13:49
by CM1215
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?
Posted: 04.06.2021, 19:41
by cartrite
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.
Posted: 05.06.2021, 15:06
by CM1215
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?
Posted: 05.06.2021, 16:26
by cartrite
Gdal should recognize. Cub files and export it 16 bit signed integer file. A dem.
Posted: 05.06.2021, 22:26
by CM1215
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?
Posted: 06.06.2021, 01:27
by cartrite
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.
Posted: 06.06.2021, 02:38
by CM1215
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
Posted: 07.06.2021, 13:18
by CM1215
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?
Posted: 08.06.2021, 10:43
by cartrite
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.
Posted: 08.06.2021, 14:45
by CM1215
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?