Searching for the perfect place to call home. Not that it would matter, since I haven't been saving the seeds. It's nice to think that maybe someday I could fly my ship right down through one of these atmospheres, pitch a tent and spend a year exploring. It will be a happy day when I finally do implement seamless landing. Maybe in a year or two 🙂

Procedural Planet

Procedural Planet

Procedural Planet

Procedural Planet (Home?)

I think the last one is my favorite 🙂

I think Earth-like planets are pretty much done for now. Still need to fix the distortion in those clouds, though. Maybe add a little variation to the clouds as well.


A while ago I said I wasn't going to get caught up in planets. I lied. Oh well :/

Better scattering, better surface functions, better storage of textures (using cubemaps now instead of cylindrical maps for less distortion), better clouds, and finally some "real" bumpmapping via dynamic heightmap marching. Overall, pretty big improvement in visual appeal! Still needs more interesting/detailed color.

New Procedural Planets


Too addicted to these things. Trying for a bit of a sharper look now.

Procedural Volumetric Nebula (Clouds?)


Naturally, I can't leave well enough alone!  Attempt IV was pretty cool, but it obviously lacked volume.  No surprises there: it was 2D.  Here's my first attempt at volumetric light inside of the same type of nebula as shown in the previous post.  I'm sure it will get better over time, but already you can notice a much better sense of volume, softness/cloudiness, and of light transport.  Light is correctly modeled using emissitivity and absorption as it passes through the nebula. I'd say this is a pretty good amount of nebula-related progress for 2 days!!

Procedural Volumetric Nebula

Procedural Volumetric Nebula

Procedural Volumetric Nebula

This method is about as expensive as the current LT nebulae...but it looks way better...so I think it's safe to say this will be replacing them soon 🙂 I am very happy with these, and I think I would quite enjoy seeing them in the background!  All the parameters - softness, brightness, feature size, absorption, wavelength-dependence of scattering, etc. are all easily-tweakable to get a lot of different styles.

Oh, and looks like we also get clouds for free! 🙂

Procedural Volumetric Clouds

Procedural Volumetric Clouds


Tonight, I feel like I have closed a chapter in my life.  For almost three years, I have been trying, on and off, to understand nebulae.  In particular, I've been trying to generate them procedurally.  If you look back over the log, you'll find several attempts:

2010 ~ http://joshparnell.com/blog/2010/08/14/procedural-nebulae/

2010 ~ http://joshparnell.com/blog/2010/08/25/procedural-nebulae-ii/

2011 ~ http://joshparnell.com/blog/2011/07/24/procedural-nebulae-2/

2012 ~ http://joshparnell.com/blog/2012/01/19/procedural-nebulae-3/

2012 ~ http://joshparnell.com/blog/2012/02/24/procedural-nebulae-revisited/

2013 ~ http://joshparnell.com/blog/2013/01/14/procedural-nebulae-iii/

Arguably, I've been getting better over the years.  As my understanding of math improves, so does my ability to craft these lovely things.  Although 2013's nebulae are significantly better than the rest (and, arguably, some of the better procedural nebulae out there on the web), let's face it, they still don't look like nebulae.  But tonight, tonight I think that I have discovered the secret of nebulae.  After three years, I finally feel that I understand these things.  And I'm proud to say that my nebulae...finally look like nebulae.


Procedural Nebulae, Three Years Later


In yet another attempt to drive the lesson of simplicity into my mind, the universe has shown me that nebulae - in my opinion, some of the most gorgeous and complex objects out there - are actually simple. The image above was produced by 31 lines of code, which is far, far less than any of my previous attempts. The code that actually defines the nebulae itself is about 20 lines. Dead simple.



The last one was after a half-day (morning) of work, now here's after a full day.  Better scattering, better surface, and a bad attempt at clouds (they'll get better).  Definitely the best so far! 🙂


Real-time Procedural Planet with Atmospheric Scattering


I swore that I wouldn't go to bed until I made a good-looking planet in ShaderToy.  No complexity, no frills, no BS...just finding out what makes a planet look good.  LT planets look pretty bad IMO.

Thankfully, I was successful.  Not to say that this is the best-looking planet ever, or anything, but it's a definite improvement over my previous works.  AND, I finally implemented "the real deal" atmospheric scattering, instead of the cheap hacks I've been using up to this point.  It took many hours of staring at O'Neil's GPU gems article.  In the end, I was able to simplify his implementation to about 13 lines and achieve good results.  It's nice to finally have this technique under my belt 🙂

Real-time Planet with Atmospheric Scattering


Not sure yet if this level of quality will be achievable in-game yet...but given that it's running at 60FPS in just a pixel shader, I would say it will probably be fine 🙂


Pretty happy with how this came out. Do not congratulate me, I am not the one who created a universe in which 29 lines of simple code can create such beauty. It is not my work.



Click to view it evolving in real time.  Click here for full-size still.


It's difficult to grasp the fact that elegant simplicity can produce infinitely complex beauty. But this is a fact of our universe...incredible.

A one-line equation is at the heart of this beauty.


It is easy to lose oneself in such things.

(PS - My last visit to fractals looked like this. It is comforting to know that I am making progress.)


It's surprisingly hard to find clean and simple code to do this, but it's surprisingly easy to do. Here it is, if anyone has ever wanted to write their own sound files in c++.


My code formatting in this blog is horrible, hence linking it as a separate file. Now all you do is call writeWAVData like this:

writeWAVData("mySound.wav", mySampleBuffer, mySampleBufferSize, 44100, 1);

Which would write a 44.1khz mono wav ("CD quality"). mySampleBuffer should be an array of signed shorts for 16-bit sound, floats for 32-bit, unsigned chars for 8-bit. Since the function is templatized, it automatically detects the format and takes care of the relevant fields in the WAV header.

Oh, and this only works on a little-endian machine, since WAV is expected to be little...but that probably doesn't matter to anyone these days, right?

Enjoy...I guess?