Logarithmic Z-Buffering in Universe Sandbox ²
Aug 19th
The Z-Fighting Problem
Z-fighting is a graphical issue which occurs when a game tries to draw two layers at the same depth.
The results vary — sometimes one layer can appear to poke through another or they will flicker back and forth as they “fight” over which one should be drawn in front and which one in back.

Z-fighting demonstration from Wikipedia article
From the Teapot to the Milky Way
If you’re a gamer, you’ve probably seen z-fighting before. But this issue mostly affects games which are working with very large camera distances. For example, open-world games may try to draw mountains and clouds in the distance, but because they both are designated as “very far away,” they fight over which is drawn in front.
Universe Sandbox ² handles camera distances on a scale even larger than this. The camera may be a few meters away from a teapot, and lightyears away from a galaxy. And somewhere in between there may be a whole bunch of planets. The issue here would be distinguishing which planet should be drawn in front when, relatively, they’re much closer to each other than they are to either the teapot or the galaxy.
Log-Z
This is where logarithmic z-buffering comes in. In non-technical terms, log-z is a programming technique which opens up more “options” at which layers can be drawn. For example, instead of all planets being grouped together at depth 5, they can be drawn at 5 as well as 5.1 and 5.2 and so on. And with their own personal space, they no longer fight!
Here’s a great interactive example of logarithmic versus standard z-buffering: http://threejs.org/examples/webgl_camera_logarithmicdepthbuffer.html
Using this technique in Universe Sandbox ² has been a long time coming — its implementation had been held up by a bug in Unity (the engine we use for development), which has now been fixed.
It won’t be an obvious change for users, but now that Georg has added it in, we’re ready to move forward with a whole bunch of other visual improvements as well, not to mention the small performance increase we expect.
Thanks, Georg! Now there’ll be no more of this:

You can buy Universe Sandbox ² now for instant access to the alpha via our website: universesandbox.com/2
Universe Sandbox ² will be on Steam Early Access later this summer.
Listen to an Inteview with Dan, Creator of Universe Sandbox, on The Zachtronics Podcast
Aug 17th

Dan sits down for an interview with Zach on The Zachtronics Podcast, a series which explores indie game development.
They start out by talking about the humble beginnings of Universe Sandbox a long time ago as Dan’s personal project throughout middle school and high school. Then they get into discussions about the ideas and passions driving the current development, the limitations which present interesting problems and require creative solutions, and the future of Universe Sandbox ².
Listen to the full interview at the Zachtronics website: The Zachtronics Podcast: Episode #4
Simulating the World of Game of Thrones in Universe Sandbox ²
Jul 17th
An Unpredictably Long Winter is Coming
Fans of George R. R. Martin’s fantasy series A Song of Ice and Fire or the television series, Game of Thrones, know well the often repeated warning, “Winter is coming.”
For those living on the continent of Westeros in this fantasy world, summers can be long, and so can the winters. But some winters are especially cold and last for several years, while others are relatively mild and short.
What causes this variance in seasons? Martin doesn’t offer an explanation, so we’re free to speculate.
One research paper (“Winter is coming”) proposes that perhaps there’s a natural explanation: Westeros is on a circumbinary planet, meaning its orbit extends around a binary star system.
Simulating Westeros in Universe Sandbox ²
The paper may be tongue-in-cheek, but that doesn’t mean we can’t use its parameters to try simulating it in Universe Sandbox ². Like the paper, we were unable to find stable orbital parameters that would create the level of unpredictability discussed in the books or the show.
We could, however, create a system that has variable winter and summer intensities on regular predictable intervals with a large northern polar ice region. Though our results didn’t exactly match those in the paper, we managed to recreate similar seasonal patterns to what the authors describe in their paper.
If you own Universe Sandbox ², you can see this simulation for yourself in Alpha 15: Home -> Open -> Fiction -> Lands of Ice & Fire | Game of Thrones.
To open the temperature graph, open the Westeros planet’s Properties, select the Climate tab, hover over the Surface Temperature icon and click the Graph button.
If you don’t own Universe Sandbox ², you can buy it now to get instant access to the alpha via Steam code: http://universesandbox.com/2
Universe Sandbox ² Alpha 15.2 | The Pluto Encounter Update
Jul 10th
If you already own Universe Sandbox ², just run Steam to update to the latest version.
Or you can buy Universe Sandbox ² here:
http://universesandbox.com/buy/
New Horizons
We’ve just released Alpha 15.2, which features a simulation of NASA’s New Horizons trip past Pluto and its moons. The spacecraft will be closest to the icy dwarf planet next Tuesday, July 14th. You can find the simulation in Home -> Open.
We will be updating Pluto’s and its moons’ textures as data is received from the New Horizons spacecraft.
If you keep the simulation running to 2019, you will see New Horizons approach its second target, 2014 MU69 (or PT1), an object with a diameter of 30-45 km orbiting in the Kuiper belt. New Horizons will likely be closer to PT1 than our simulation reflects, though, as NASA will be using a portion of its remaining fuel to get closer to its target.
You can also check out NASA’s own New Horizons simulation.
Recent Updates & Changes
In this update we’ve also made it possible to draw trails relative to a body and made additional tweaks and fixes.
In Alpha 15.1, released on June 26th, we updated the look of Ceres based on the latest photos from NASA, added a random asteroid feature, new moons of Pluto, pulsar jets, and improved the look of brown dwarfs. We also re-introduced the ability to customize launch bodies: Hover over bodies in the Add panel then press a number key to assign the body to that launch slot.
Alpha 15 Now Available
Jun 29th
Universe Sandbox ² is now easier to use and explore, faster than ever before, and alive with the sound of music.
This is the biggest update yet for Universe Sandbox ².
Run Steam to update or buy Universe Sandbox ² now for instant access to Alpha 15.
Redesigned User Interface
We redesigned the user interface for a cleaner, more intuitive experience. There’s a new layout, a whole new set of icons, cursors, and fonts, a brand new Home menu with generated thumbnails for previewing simulations, and a lot more. The interface is constantly being improved, but we’re very happy with the direction it is now heading.
Improved Performance
We rewrote physics from the bottom-up for much better performance. Physics also now runs asynchronously from other components, which means that even if it is busy with a ton of calculations, the user interface and camera should still be completely responsive.
New Dynamic Soundtrack

Universe Sandbox ² now features a soundtrack which responds to actions and events in the simulation. Collide two planets and listen to the music swell. Music by Ryan Macoubrie.
And A Lot More
- Magnetic Fields
- Pulsars
- Custom Keybindings
- Light pulses
- Fireworks
- Improvements & bug fixes
- Full list of What’s New
Alpha 15 took longer than we expected, but we think it’s well worth the wait. We’re excited to hear what you think:
Signup to be notified every time there’s an update for Universe Sandbox ²
New UI Screenshot & Alpha 15 Update
May 7th
User Interface Improvements
In the screenshot above you can see the improved Open, Add, and Properties panels. (Although you won’t usually have all 3 open simultaneously.)
The design will still change a bit as we continue development, but it’s a good representation of the direction we’re heading: unified icon styles, minimalistic design, better spacing, and a more intuitive organization of controls and settings.
One of our favorite new additions is the thumbnails in the Open panel, which provide a much more representative and inviting preview of the available simulations.
The biggest change? We’ve moved most of the actions you’ll need for exploring and interacting with a sim to a bottom bar. We pride ourselves on the amount of customizable options, but they’re only as useful as they are easy to find and adjust.
What else have we been working on since Alpha 14?
- Getting our newest team member up to speed
- A big welcome to astrophysicist Jenn Seiler!
- Jenn is currently working on improving volatile loss rates and implementing magnetic fields (look for these in future updates)
- Refactored physics and performance optimizations (see previous post)
- Transitioning to GIT for our source control
- This will help us maintain a monthly update schedule, as we can now develop features on the side without affecting the main project, then merge them in when they’re ready
- Improved graphics settings and options
- First steps in integrating backend visual improvements
- New tech which lets users heat up one side of a body (coming post-Alpha 15)
We’re working hard to get everything working again for Alpha 15. Keep your eyes peeled. We look forward to hearing what everyone thinks.
If you don’t own Universe Sandbox ², you can get instant access to the alpha through our website: universesandbox.com/2
Happy Earth Day!
Apr 22nd
First observed in 1970, Earth Day now gathers over 1 billion people in 192 countries every year on April 22 to celebrate our planet and raise awareness of the issues it faces. According to Earth Day Network, that makes it the largest civic observance in the world.
The growth of this movement toward the care and appreciation for our planet is evident all around us. Environmental awareness is no longer reserved for activists and radicals. “Going green” and “reducing your footprint” have become familiar, if not trendy, concepts.
But despite this, human-caused climate change continues to take us further down the road toward inevitable crisis. It’s a bleak forecast, but one that we, as individuals, nations, and a global community, must confront if we want to create the necessary changes.
Earth in Universe Sandbox ²
In Universe Sandbox ², we’ve added a simple climate simulation for Earth. We hope it helps in understanding how our climate works, and how fragile our planet is.
Here are a few things you can try in Universe Sandbox ²:
-
Simulate Future Climate Scenarios
- We’ve included the ability to simulate scenarios based on data from the most recent IPCC report
- We recommend trying the Climate Scenarios activity (Home -> Main tab)
- You’ll learn how to use the different models and graph Earth’s temperature over time
- Learn more about simulating these scenarios in our previous blog post
-
Tidally lock the Earth to the Sun
- Select Earth (in the default Solar System sim)
- In Earth’s properties window, click the “Motion” tab
- Scroll down and click “Tidally Lock”
- Now one side of the planet will always face the Sun
- And the other side of the planet will begin to freeze over
- Tidal locking is why there’s a “dark side of the moon.” From here on Earth, we can only ever see the same side
-
Turn Earth into a Comet or a Snowball

- Try moving the Earth closer to the sun to turn it into a comet.
- Or move the Earth out past Mars and watch it freeze over. (Load the sim “Earths Next to Sun” to see multiple Earths at various distances from the Sun)
If you don’t own Universe Sandbox ², you can get instant access to the alpha through our website: universesandbox.com/2
Alpha 15 Preview: Performance Boosts & UI Changes
Apr 6th
We’ve been working hard on Alpha 15. It’s coming, slowly but surely.
In our last post, we talked about the upcoming performance improvements. Because of this substantial physics rewrite, it’s taking some time to fully integrate the changes and restore everything to working condition. But the results are worth it; we’re seeing some big performance boosts.
We’ve also made some major changes to the UI. It’s still a work-in-progress, but we’re very excited about its direction.
The changes to the UI have made it easier to control the simulation and explore some features which were previously buried under layers of menus. Realistic physics and data make up the engine that powers Universe Sandbox ², but the key to revealing the wonders of our universe lies within the ability to interact, manipulate, and experiment. For us, this means making it easy to answer the question, “What would happen if I chucked the Earth at the Sun?”
Keep your eyes peeled for Alpha 15.
If you don’t own Universe Sandbox ², you can get instant access to the alpha on our website: universesandbox.com/2.
More Performance Improvements in Universe Sandbox ²
Mar 20th

The last few alpha updates of Universe Sandbox ² have each included changes in the physics code to improve performance on a wide range of hardware. But never assume that Thomas, our numerical physics developer, is done with optimization; there’s always more performance that can be squeezed out.
That being said, sometimes it’s not worth trying to squeeze out the last drop; sometimes it’s better to start fresh. Thomas explains in his video description: “The core NBody physics was rewritten from the ground up to give back some of the raw computation speed, which had been lost under layer upon layer of C# sugar coating.”
If all goes well, this could mean that the physics-side of Universe Sandbox ² will run much faster than it does now. In addition, it will be running asynchronously, which essentially means that even if physics is bogged down with thousands of calculations, the user interface should still be responsive.
Check out Thomas’s video below for a demonstration of how powerful the new system is. 50 000 particles around Saturn would normally have brought this simulation to a halt, but now it runs very smoothly:
https://www.youtube.com/watch?v=pxh5FUmRQyU
From the description:
Note that the slight stuttering, primarily at the beginning, is caused by the screen recording.
This demonstration shows the performance on an Intel i7 CPU running the rewritten C# engine on Mono. The rewrite will let us quickly add support for native code using SSE as well as native code running C++AMP on CPU or GPU, plus still OpenCL.
Full implementation may take a bit, but we’re very excited to see it up and running in Universe Sandbox ². When it’s ready, we’ll be sure to let you know.
Get instant access to the alpha and a pre-order of the final Universe Sandbox ²: universesandbox.com/2
Alpha 14 Now Available
Feb 27th
A long list of bug fixes, first pass on total fragmentation, re-enabled exploder tool, better performance for slower machines, and further improvements to the user interface.
Run Steam to update or buy Universe Sandbox ² now: universesandbox.com.
Our last update introduced a lot of new features, and took a bit longer than we expected. So for Alpha 14 we returned to our monthly release schedule and focused on fixing bugs. Some of these bugs have been around for a few versions, and others were introduced with last update’s big changes.
Total fragmentation is disabled by default as it’s still a work-in-progress, but you can enable it in Simulation settings (gear icon on the left). It can best be seen with the re-enabled exploder tool. Select Powers on the left, then select Exploder, then click on a body to make it instantly explode. This is also a work-in-progress; better transitions are on the way.

We also made improvements to collision and gravity calculations when running CPU mode. This means better performance for older hardware which can’t run OpenCl mode.
We revamped tooltips for smarter placement and increased visibility. We also made the Launch Body toolbar customizable, so now you can set the hotkeys to launch any body you choose.
For a full list of bug fixes and improvements in Alpha 14, check out the What’s New.
And as always, we’d love to hear your feedback:










