Wednesday, May 30, 2012

Honestly

Part of me will be very, very sad when I end up not submitting this image for the competition.



It's an incredible image.  Really.  But it leaves out so much of what I've been working on...and there's really not much to it.  But wow, it's so good!

Tuesday, May 29, 2012

Nice

This one's pretty cool :)



But I really need to figure out how to get rid of the jaggies on the edge of the beam :/

Monday, May 28, 2012

Scene Mockup

Gas week is over.  It came and went with much frustration and little satisfaction.  The fact is, volume rendering is hard.  Especially when you're path tracing it and trying to account for every subtle detail, including wavelength-dependent multiple scattering (which you've really got to do to get nebulae right).

I didn't get everything accomplished that I wanted to during gas week, but that's ok, because I failed softly.  This entire project was designed to be soft-failable, meaning that every component should look good enough by itself to be an entire project, just in case the whole composition doesn't come together.

Surprisingly, though, the composition is starting to come together, even if the gas isn't everything that I wanted it to be.  Here's my first mockup of all of the elements pulled together:


It's obviously very rough.  The cool parts of the ship are occluded (while the lame part is naked and visible).  The asteroid texture is too fake.  The sun isn't positioned correctly, so the color composition doesn't work very well.  The beam is too fake and doesn't scatter enough.  The debris is unconvincing.  There's only one asteroid (thankfully, that one's easily fixed).

But for everything that this image does incorrectly, I think there's at least one thing that it does correctly.  The wavelength-dependent scattering looks good, and you can see the subtle color gradient caused by red scattering with a lower probability than green.  The gas looks surprisingly nice in the background, with nebulous puffs and dark patches clearly visible.  The asteroid geometry is high-quality and detailed (even though I left out craters).  The metal on the ship looks metal-ish, so that metallic Fresnel approximation is working.

I've got a long way to go, and I will probably never be satisfied.  But that's good.  The point was to push myself, and I've done that - to the extreme.  The next two weeks will be even more extreme, but I'm hopeful.

Saturday, May 26, 2012

Nebula Rendering

So much for dialing it back.  I've decided to try a full-on reflection nebula render, and plop the scene right in the middle.  Rendering a nebula is definitely challenging, and it's required an immense amount of tweaking and experimentation to get decent (still not great) results.  Here's what I have so far:


Notice the nice color gradients as a result of wavelength-dependent scattering (it's particularly noticeable on that band of thick gas in the upper-left corner).

Features still aren't as well-defined as I'd like them to be, but I'm definitely making progress.

Wednesday, May 23, 2012

Dial it Back

All the renders I've posted recently have been really cool.  Unfortunately, I fear that they're a bit too far on the fictional side - the large clumps of gas are just a bit too much.

I've decided to go with a thinner, smokier look.  I need to make sure that I don't mask all the other elements.  I've worked so hard to make good ships, asteroids, and textures...it would be a shame if they were all engulfed in big puffs of smoke.  Balancing the scene composition such that every element gets its fair share of attention will be incredibly difficult, but I'm hopeful!


Voronoi Gas

Switching back to Worley noise for now...I think it's crisper than value/Perlin.  I'm also experimenting with thresholding to get more defined features.  I'm also starting to like this green/orange color composition more than cyan/orange!


Gas

Wavelength-dependent scattering, better light as well.  Looks more natural I think.


More Gas

Added turbulence for wispiness.  Also implemented the Henyey-Greenstein scattering function, which seem to provide more realistic scattering. The effect of the blue beam on the gas is much more pronounced now, since the scattering is no longer isotropic.

Here's an example of the beam cutting through a thick volume:


Now, inside an infinite volume:


Unfortunately, the previous image seems over-saturated, possibly a result of bad MLT luminance estimation.  Finally, here's a pretty good one:


The clouds are starting to look really great.  Unfortunately, it looks like you can't even see the asteroids in that last shot (there are actually 100 of them nearby...I guess the gas is just really thick).  Scene composition with this thick gas will be difficult, but it'll be a huge payoff if I can get it right.  That gas looks far better than what I ever imagined I would be able to achieve!

Tuesday, May 22, 2012

Wow

Gas week...oh gas week...


Through the Clouds

Wow...gas week is going really well so far :)  I'm having great success even with very simple density functions.  Here's a simple fractal Worley noise modulated by a low-frequency value noise mask:


Those clouds look real to me!!!  Although, something about the way the color bleeds into them bothers me...it seems too saturated, but I can't rationalize why.  I mean, it makes sense...it should be saturated, because there's really intense light coming from behind.  Maybe the sun is just too orange.

I hope I can manage this same quality with the final shot.  Even just overlaying a ship and asteroid field on this shot seems like it would be epic!

Nice

For some reason, I really like this shot.  Even though it's totally implausible to have hanging smoke in a perfect waffle pattern, the image looks quite real to me.


Monday, May 21, 2012

Oh My...

You can use printf natively in cards that support CUDA architecture 2.0 and above.  Yes, INSIDE A KERNEL.


I think the awesomeness of this statement speaks for itself.

3D Texture

The first major step of gas week has been accomplished!  The 3D texture density lookup works perfectly, as does the texture generation kernel.


I must say, I'm impressed with the speed!  I had serious concerns about the overhead of a 3D texture lookup in the participating media raymarcher.  However, the hit seems completely reasonable.  Of course, I haven't tried super-high-resolution fields yet, but I'm not sure that will be necessary, given that even this 8x8x8 grid looks good enough with linear interpolation.

End of Week 2

Texture week came and went, and I must say that I'm pleased with the results.  I accomplished everything on the week's list, minus one thing: bump/normal mapping.  But I knew that one would be a stretch.  In the end, however, it wasn't the challenge of it that deterred me, but rather the fact that I like the smooth look of my ships right now.

Gas week is upon us, and I'm excited for all that is to come!  This is the last planned week of serious technical work - after gas week is over, most of the work will be tweaking the scene, final touch-ups, and rendering!

Ship Auditions

Yesterday I rewired some of the path tracer's global memory usage so that it can handle scene updates without having to recompile/restart.  This means that I can change the Welder program, save it, and have the tracer recompile the scene and start rendering without ever having to restart it!  Today, I added some small features: the ability to convert the current render into LDR and save it, as well as the ability to pass global environment variables to a Welder program on startup.

These all seem like moderately dumb/easy things.  But what do you get when you couple them all together?  Automated ship production!  I can program the tracer to automatically re-execute the Welder program after a certain amount of render time, causing the scene to rebuild.  But, using the environment variables, I can increment a seed value so that the program doesn't produce the same result.  Finally, I can save the previous render to a file.  The tracer can then recompile the scene data and start rendering the new scene!

This means that I can automate the rendering of "previews" of many ships, making the task of finding the right seed value easier. Tonight I set the program to give each ship a 1-minute rendertime.  It blazed through about 45 ships before I decided that I needed to go to bed (I can hear the birds again...).

Here are some of my favorites from the night:









Man, this is a cool way to explore the possibilities!  I'm also impressed with these one-minute renders...definitely not bad quality for sixty seconds!  Oh MLT...how I love you.

Sunday, May 20, 2012

Up Close

Another up-close, high-res shot.  I think this may be the one...don't want to jump the gun, but I really like this ship from this angle.  Throw on some guns, windows, and the emblem, and I think this could look really good :)



But.  Nothing's final yet.  I'll keep my eyes open for better ships.

Logo

I really like this ship.  Perfect balance of cleanliness and complexity, if you ask me.  The texture's satisfying.  Not perfect, but good enough, I think.  I also slapped on a logo: the Flanders emblem.  I grew up in Flanders, the Northern part of Beglium.  I always thought it was a cool emblem!  Definitely adds  a nice touch.


Cleaner

Texture week is almost over.  I've done a pretty good job with textures, but ships are still lacking.  They were too cluttered and unstructured before.  I'm trying to overhaul the ship-building algorithm right now to get a cleaner look.  I really won't be able to tell how the textures fit until I get a ship that I really like.

So far the overhaul is going well, but I'm far from the perfect ship.  Still, they're a little cleaner than before:


As this shot shows, it seems that I've traded complexity for cleanliness.  I'd like to get both in the same ship!

Interesting Idea

Right now it looks a little to cheesy, but I think it's a cool idea.  After all, why would you mine an asteroid that didn't have anything in it?



Asteroid Texturing

Is pretty much solved.


Now I think I should stop putting off ship texturing...

Cool Scene

Ah...texture week's almost over...I should be working on textures...but gas is just so much fun!  Here's a shot of several elements thrown together:


Not bad for a five-minute render!  Interestingly, this looks very much like a nice piece of scifi concept art when you throw a median filter on top:


Note that the gas density function is really crappy and periodic, which explains the patterns in the gas.  This coming week will be dedicated to fixing that! :)

Saturday, May 19, 2012

The Beast

Sure wouldn't want to meet this guy in a dark corner of space...


I really love that metal.  The Fresnel effect makes such an enormous difference!

Now, I'd like to finder a cleaner ship that still looks good.  This one's just a bit too cluttered.  Textures are coming along nicely, but still probably far from done.

Edit: Here's a version with a glossy room.  Yayyy glossy!


No Smoothing...

Looks like there's just no way to get around the fact that smooth normals can cause problems :/ I may have to drop them, at least for the ship.  Here's the same image using the actual analytic normals:


It would be nice if I could set it up to do analytic normals for the ship and interpolated normals for the asteroids...

Fresnel Metal

It's always depressing to me when I hear birds chirping before I go to bed.  Tonight is, unfortunately, one of those nights.  But for my troubles I have been rewarded!

I finally implemented a Fresnel-like term in the tracer.  I really want to get a nice metallic look for the spaceship (I mean, that's pretty much an essential!).  To that end, I implemented a metallic Fresnel approximation from this paper: http://sirkan.iit.bme.hu/~szirmay/fresnel.pdf.  It actually looks really nice!


My ship is finally starting to remind me of those first few renders that I did in PBRT ages ago.  Yay, that means I'm getting close to PBRT's quality!

Except for those horrendous black edges.  Don't mind those.  I'll have to look into it...I'm sure they're just bad mesh normals.  Rawr.

Friday, May 18, 2012

Don't Stretch It

One of the most annoying yet easy-to-make mistakes when it comes to drawing rendertargets to the screen is accidentally invoking filtering.  Even the slightest difference between the rendertarget size/placement and the viewport size/placement can cause stretching, which will invoke the minifaction or magnification texture filter.  If you've set them to "linear," which is a reasonable thing to do, the result is effectively a 2x2 box blur over your whole image.  Nice.  You've just halved the effective resolution.  In the case of D3D9, it's even worse, because you're not safe even if you've got the size right: the texel-to-pixel half-offset madness can still cause the same effect.

Up until a few minutes ago, my path tracer was suffering from this problem.  I noticed it immediately when I switched from GL to CUDA, but figured it might be a CUDA-specific thing and decided to wait until a later time to debug it.  But it occurred to me today that it might be my good old friend texture filtering!  And indeed it was.  Changing the filtering to nearest-neighbor fixed it immediately.  My images now look significantly sharper at edges and high-frequency details.  Here's a comparison:



The latter is correct.

In conclusion: if you think your image looks blurred, texture filtering is probably the culprit!

Thursday, May 17, 2012

Scattering Study

I should be working on textures right now.  But I'm not!  Now that I've got a material system in place, there's just too much fun to be had elsewhere :D  For example...arbitrarily-shaped emitters!  And you know what that means...I can finally make the mining beam.  To that end, I've been doing some scattering studies tonight.

Here's a beam cutting through sinusoidal clouds of gas:


Here's the same beam with twice the luminosity:


I really love the way the multiple scattering saturates the nearby gas with color.  That's exactly the effect that I'm looking for!  I'm still wondering if this scattering is exactly correct....I'm a little concerned about the visible silhouettes of the two beams through the gas on the top layer.  Maybe that's correct, but it looks a little odd to me.

And, just for fun, here's an awesome-colored beam of the same intensity as the last one:


Wednesday, May 16, 2012

Better Field

Texture really makes a difference on those asteroids.  Dare I say it?  I think the images are actually starting to look good...!


More Texture

I know that ship texture's a disaster...but don't count me out yet, texture week has only just begun! :D


Getting Somewhere

Tonight I implemented texture atlas generation, integrated a basic material system into Welder, and hooked it up to the GPU tracer, making all the necessary memory arrangements.  I also attached material flags to each triangle, so that materials can be specified on a per-triangle basis.  Pretty awesome rate of accomplishments for tonight!

Here's a little reward for my efforts.  Nothing fantastic, but at least it's starting to look vaguely spacey:


Tuesday, May 15, 2012

Texture

Ouch...that thing's pretty ugly (I just chose a random seed, didn't even bother checking to see if it looked good before rendering).

But make no mistake...it's textured ;)


Texture atlas transfer from host to device is working.  Sampling in the device is working.  Long way to go before texture week is over, but I've got a nice head start!

Monday, May 14, 2012

End of Week 1

My goal for last week was to finish the scene-building algorithms (i.e., the creative part of the project).  I'd say I did a pretty good job!  Sure, my ships aren't perfect, but they're still pretty compelling...I think.  It's hard to tell without texture, but I think they're going to work nicely.  There's also a good deal of variance among them, so I succeeded in designing a procedural algorithm rather than hand-modeling them.  Things on the asteroid front are pretty much perfect!  Of course, we knew they wouldn't be very challenging.  Still, I went farther than I needed to, and I think the quality shows.

At the beginning of the week I had pretty much nothing; now I have a full-featured programming language designed for PCG, as well as several nice algorithms written in said language.  I have my scene.  I have asteroids, I have a ship, and I have guns.  This week begins the texturing work.  I'll finally implement texturing in the tracer, and start integrating texturing/materials into Welder so that I can paint my scene.

Here's a pretty nice ship navigating last night's asteroid field:


And another nice ship:


Sunday, May 13, 2012

Better Field

Gaussian distributions fix everything, right? :)


No more instancing, each asteroid is unique.  I can accomplish this large of a scene by making the asteroid quality proportional to the size.  That way, tris aren't wasted on small asteroids, but large ones maintain high detail.

Instance Instance Instance Instance ...

Nothing saves time like instancing.  In this case, I mean instancing in the Welder sense, not actual scene geometry instancing.  It resulted in a pretty cool field (of only 300k tris!):


The very sad thing is that, while posting this, I realized why the small asteroids look somewhat axis-aligned.  I scaled after I rotated.  Facepalm.

Well, expect at least one more image tonight...

Asteroid Field

I'm back to working on asteroids tonight.  Here's a simple field of them.  Unfortunately, you can't see the detail so well, since I had to turn down the quality to allow generation of a whole field in a reasonable amount of time.


I'm now using value noise as a basis for the coarse shape of the roids, then traditional Worley noise for the finer details.  There's also a cratering pre-pass, but the craters aren't very visible in this shot.

Saturday, May 12, 2012

Nice Ship

I really like this one.  I'm playing around with post-deformations, and it's amazing what a little non-linear deformation will do to please the eye.  Just looks so much better than straight lines everywhere!