Planet Rendering - Source code now available

Posted by

There was some interest on my last post to release the source for my planet rendering demo. Well, the long wait is over! But first, I have here a Java Applet version of my code that you can play with right now, even if you're not interested in the source code:


Your browser is not Java enabled.

If you don't see anything, then make sure Java is enabled in your browser. Usage is fairly simple:

  1. Choose a template from the drop down ("Gas Giant", "Inferno" etc) then click "Load" to load it and render an initial image.
  2. Click "Refresh" to generate a new planet with a new seed.
  3. You may find that changing the background from "Transparent" to "Black" makes the planet a bit easier to see (particularly ones with a complicated atmosphere)
  4. You can edit the XML on the right to adjust parameters, click "Refresh" to generate a new image from the XML.

Most importantly, have fun and experiment - the error-checking isn't great, so if you input invalid XML (or something) you'll just see nothing happens when you click "Refresh". Sorry!

Source Code

The source code for the applet and stand-alone application (as well as the library itself) is now available as a GitHub repository, which you can access here:

https://github.com/codeka/planet-render

Feel free to use the code however you like, it's licensed with the MIT license. I'd love to hear about any projects you have that use my code, though :-)

I suggest you follow my series of posts on rendering the planets, starting from "Part 1 - Diffuse Lighting", to get an idea of how the code all fits together.

blog comments powered by Disqus