Tag Archives: procedural nebulae

Procedural Nebulae V

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

Procedural Nebulae IV

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.

:)

Sometimes...

...the computer can still surprise me, even after all this time.  And the surprises keep getting better.  Tonight I stumbled on a really lovely system, had to take a while to just roam around and bask in the stars :)

 

A Nice Star System

 

*whispers to computer* thank you, that was really nice, but I hope someday you will surprise me with a whole universe...? :)

Procedural Nebulae III

What an exciting night. If you search the tag "procedural nebulae" on this blog, you'll find no shortage of posts. Indeed, I've been fascinated with nebulae for as long as I've been a graphics programmer, and have been trying to crack them procedurally for as long as I've known about procedural generation. My attempts have always been spirited, but lackluster. For Limit Theory, I once again revisited the topic, starting from scratch and trying to come up with some new ways to attack the problem. The solution was fairly good, and certainly my best so far (well, not counting the path-traced nebula, which was cheating). But, as you can see from the screenshots, they really don't look that much like nebulae. I've been quite "content" with this solution...at least, content enough to ship the game with it. But not truly satisfied.

Tonight, I am truly satisfied. I allotted a few hours for revisiting the nebula code, just to see if I could push the quality a little further. With a few new creative ideas and a wee bit heavier math (but not much), I've succeeded. They aren't perfect, and, of course, they're still obviously not real. But they are far more real than any of my previous work, and I would be more than happy if this was the algorithm that shipped with the game.

The nice thing is that I've only just started to explore the possibilities of this new approach, so I'm sure I'll be able to push it even a bit further than this with a few more hours of tweaking! :)

Results: Grand Prize!

Well, that was a productive quarter...managed to get grand prize at the 2012 Stanford Rendering Competition! Here was the final render:

The rendering depicts a spaceship emerging from a thick nebula and asteroid field. A sun-like star lights the nebula from behind.

In summary, the primary technical challenge of the rendering was the nebula. The nebula is rendered using full volumetric path tracing, including multiple scattering and wavelength-dependent scattering. This is probably the first time I've ever tried to do something like this without using hacks. I ended up writing a renderer in CUDA specifically for this purpose, so the final render was rather fast considering the complexity of the scene. I was really pleased with the results!

As for the scene geometry, it's all procedural, written in a procedural modeling language that I developed specifically for the project. The language helped me quickly prototype geometric ideas, and was invaluable in exploring the (procedural) possibilities! I'll definitely talk more about the language in time, and I suspect that it will be making frequent appearances in my real-time work.

In the coming days, I'll post some details on the project (and date the posts appropriately), so as to fill in that void of postless time over the past two months!

Procedural Nebulae Revisited

Here we go again. Last time I tried nebulas, it was with fake, 2D noise functions. Now, I'm exploring the volumetric approach. So far, success has been fantastic. I'm running the whole nebula simulation on the GPU, so the generator is fast (< 1 second), even with a million+ particles. The nebula also renders at 60 FPS, which is nice, as I can actively explore it, unlike with previous attempts. Everything is shaping up really nicely, and the XDX Engine is getting plenty of new features along the way. Still need to play with colors, molecular clouds, and lighting in general.

Exciting! :)

Procedural Nebulae

As a follow-up to the last post, I just couldn't wait to see what I could do in terms of procedural nebulae with the particle system. The initial results aren't jaw-dropping, but they do beat previous attempts by a fair amount. The particle-sim nebulae definitely have a more volumetric feel to them (not surprising, considering that they are volumetric, unlike the 2D-noise-based previous attempts).

I actually did a bit of cheating in this shot: I've composited the original screenshot with several blurred version of itself. In principle, this is easy enough to do on the GPU with textures. I just didn't want to go write that code in the simulator, since I want to keep it as a real-time application. There's still a long way to go in the procedural nebula department, but I believe this represents a step in the right direction.