Example: Rendering The Milky Way Galaxy On iOS Devices Using OpenGL ES

I’ve mentioned some excellent beginner tutorials on using OpenGL ES, here’s an advanced example on using OpenGL ES using a different approach to render the Milky Way galaxy.

The Milky Way contains over 200 billion stars and here’s an example from Hanno Rein that uses some interesting techniques to render this overwhelmingly large structure.

The example uses a background texture map, a dust map for determining the depth of each point, and uses point sprites to create the 3D points altogether with some custom vertex and fragment shaders.

Here’s a few images showing the example in action:
Milky Way Galaxy-1

Milky Way Galaxy-2Milky Way Galaxy-3

As the readme states:

This is an example project to show how to render a Galaxy in OpenGL on the iPhone. To simulate interstellar dust realistically with unsorted point sprites in OpenGL, I’ve implemented a GPU based ray tracing algorithm.

You can find the OpenGLMilkyWay example on Github here.

You can find this example in use in Hanno’s impressive ExoPlanet app.

There’s a PDF included in the Github repository providing some slides explaining a bit more into the techniques used for this impressive example.

DeliciousTwitterFacebookRedditLinkedInEmail

Original article: Example: Rendering The Milky Way Galaxy On iOS Devices Using OpenGL ES

©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Leave a Reply

Your email address will not be published. Required fields are marked *