PUTTING LIFE on MARS: Using Computer Graphics to Render a Living Mars
Total Page:16
File Type:pdf, Size:1020Kb
InSight: RIVIER ACADEMIC JOURNAL, VOLUME 9, NUMBER 1, SPRING 2013 PUTTING LIFE ON MARS: Using Computer Graphics to Render a Living Mars Kevin M. Gill ‘11G* Senior Software Engineer, Thunderhead.com, Manchester, NH Keywords: Computer Graphics, Mars, Life, Planetary Science, OpenGL Abstract This article describes the software, algorithms & decisions that went into the development of the Living Mars image project. This includes topics related to computer graphics, software development, astronomy, & planetary science. The purpose of the project was to create a visualization of the planet Mars as could look with a living biosphere. This makes no distinction as to whether this biosphere would represent an ancient or future, possibly terraformed planet. 1 Background Mars, named for the Roman god of war. Ancient civilizations have forever associated the planet with fear, war, and destruction. It is the color of blood, and “one of a handful of planets visible to the naked eye, and the only one of marked color, so the planet demanded attention (Pyle, 2012).” Ever since man has noticed it, there have been dreams and visions of life on Mars, from Giovanni Schiaparelli and Percival Lowell describing channels and canals to Robert A. Heinlein’s science fiction. Lowell, in particular famous for fantastic writings of Mars, asked “are physical forces alone at work there, or has evolution begotten something more complex, something not unakin to what we know on Earth as life?” (Lowell, 1895) Even more recent discoveries by NASA’s Curiosity rover have found proof that liquid water once flowed billions of years ago positing an environment that could have served host to life (Brown, 2013). The planet lies in the so called “Goldilocks Zone” were solar radiation from the sun is at a point to make liquid water possible. That zone is not the only factor affecting the possibly of water, however. The Martian atmosphere today is only about a tenth of Earth’s, and with the lower pressure, any liquid water can only exist for a moment before boiling and evaporating into the air. Conversely, on Venus, also in the Goldilocks Zone, the atmosphere is a crushing nine hundred pounds per square inch and runaway carbon dioxide greenhouse gasses make for an extremely hot environment. There is evidence of water on Mars, even today in trace amounts. Findings of neutral PH clays have pointed to likely ancient stream beds and planetary scientists have also found ancient dry rivers cut into the terrain. With the evidence of flowing water, people’s imaginations have been running wild, not the least of which was mine. 2 Introduction Late in 2012, I downloaded the dataset created by the Mars Orbiter Laser Altimeter (MOLA) instrument that is aboard the Mars Global Surveyor (MGS) spacecraft. This instrument was tasked with mapping the Martian surface from orbit and send home altimetry data which can then be used to generate elevation models. It is this data that is used to generate a lot of the computer graphics simulations of the planet seen in print and television. Copyright © 2013 by Rivier University. All rights reserved. 1 ISSN 1559-9388 (online version), ISSN 1559-9396 (CD-ROM version). Kevin M. Gill I had been using this data to test an open-source digital elevation modeling application that I have been writing called jDem846, or Java Digital Elevation Modeler, 8/4/2006 (my son’s birthday). Testing with this data allowed me to make comparisons and fine tune the rendering when creating visualization of different planets, namely Earth and Mars, and to make sure the relative terrain features are scaled correctly given the different size, flattening, etc, of the planets. It also allowed me to create interesting scientifically backed visualizations that I would be able to share out on social media and other places. I was watching a documentary on Mars one weekend afternoon with my son and it struck me to not show Mars how it is, but rather how it could have been or could one day be. What if instead of red, what if it was blue, like our own? It would have received a much different legacy and name than those it enjoys today. Perhaps instead of Mars, it would have been called Neptune, the Roman god of water and seas, long before the planet that currently bears the name would have been discovered. I knew how to use my software to render a planet and some basic clouds, but had not yet created hand drawn textures (I am no artist by any stretch of the imagination) nor had I done atmospheres. Both were beyond the scope of what I had been writing the application to do. This project would require more time and changes to my code base than spent actually putting together the model of Mars. In planning the model, I determined what I would need to go into the model. I started with the MOLA altimetry data which allowed me correctly represent the terrain features of Mars. Then was to use that to create a texture map on which I could paint a virtual biosphere, oceans, deserts, and all the features one finds on a habitable planet like ours. I would need a way to render global clouds in a visu- ally appealing way. If one has clouds, one likely has an atmosphere which means light scattering, a halo, and the appearance of gradual thickening (or opacity) of the gasses when viewed from smaller angles. 2.1 About the Software jDem846 is an open-source software project that provides an interface for creating digital elevation models for GIS (Geographic Information Systems) and scientific consumption. It provides a highly configurable and extensible set of rendering and visualization algorithms in an effort to support a broad range of geographic applications. In addition, a rich API is exposed via a scripting interface which allows users to inject logic and extend models beyond the out-of-box functionality of the program. With a focus on highly detailed models and management of Figure 1: jDem846 Screenshot massive input datasets, it is not optimized for high performance rendering in terms of execution time. Rendering is done using an off-screen buffer (onscreen rendering is not yet supported, but possible), primarily due to the desire to support a broad range of client applications ranging from the desktop to clusters and server-side processes. It does not seek to provide competition to other professional GIS packages such as Google Earth or NASA WorldWind. It specializes in the creation of single-frame images; however rendering for video 2 PUTTING LIFE ON MARS consumption has been achieved. Scripting is available using Groovy, Scala, or JavaScript, though the two former options are slated for removal. The software is written in Java and uses the Eclipse Rich Client Platform for the user interface. By design, the core library is stand-alone to the user interface and can be integrated into other client application frameworks. Originally started as a project at Rivier University’s Master’s level Professional Seminar course when it was written in C & C++, it has gone through a number of ports, rewrites and other changes. Models are rendered using OpenGL for hardware acceleration, but a software rendering engine is available for systems where OpenGL may not be available. A major consideration within the core library is the management of massive data sources. It is not uncommon to be required to generate models with input datasets that exceed tens or hundreds of gigabytes which can very quickly overwhelm available memory for both the Java Virtual Machine (JVM) and the computer. Thus the software provides mechanisms for the efficient retrieval and caching of data in a way that will not result in excessive CPU overhead and expensive disk IO. The software currently supports several input formats in varying degrees of completeness. A basic raster data infrastructure was created for supporting a high number of custom formats and is currently the base of the two existing raster formats that are supported. Raster Data Formats: GridFloat; Gridded 32 bit IEEE floating point values BIL16Int; Gridded 16 bit signed integers Custom defined rasters using specifications: o Width o Height o Number of bands o Header Size (bytes) o Data Type (# bytes) . Byte (1) . Unsigned Short Integer (2) . Signed Short Integer (2) . Unsigned Integer (4) . Signed Integer (4) . 32 Bit IEEE Floating Point (4) . 64 Bit IEEE Floating Point Double Precision (8) . C-Type Signed Short Integer (2) . C-Type Signed Integer (4) . C-Type 32 Bit IEEE Floating Point (4) . C-Type 64 Bit IEEE Floating Point Double Precision (8) o Byte Order . Little Endian . Big Endian o Coordinates 3 Kevin M. Gill . North, South, East, West o Grid Resolution . Latitude, Longitude o No-Data Value Constant Image Formats: JPEG PNG Shape Formats: ESRI ShapeFile 2.2 Scope On a large rotating object such as Mars and Earth, ocean level is set by a balance of gravity and centrifugal forces. According to scientists (Fraczek, 2010), the seas are controlled first by gravity, which pulls the water towards the center of the planet, and by centrifugal forces generated by the rotation of the planet as it moves along its orbit. These centrifugal forces work to pull the water out and towards the plane of rotation. If we had no centrifugal forces working against gravity (if the planet did not rotate) the oceans would all flow towards the poles. This would happen due to the true shape of Earth and Mars: They are not perfect spheres; they are oblate spheroids. Being an oblate spheroid, there is a certain degree of polar flattening and as a result of that flattening the distance from the surface of the planet to the center is shorter at the poles than it is on the equator.