Commonly Ignored Features #2: Contrasty HDR Lighting

Update 2016: This method is pretty much just wrong. See this post instead.

At the time Cycles came out in Alpha, I was playing around with HDR lighting in Blender internal. I found BI to be annoyingly slow and impossible to get that magic one-click lighting that all the non-blender websites had promised HDR could do.

You might remember some fool using this in some tutorial...

You might remember some fool using this in some tutorial…

So when Cycles showed up, I figured the day was saved and all my problems would magically disappear.

Well most of them did, but HDR lighting still looked flat and boring, lacking the shadows from the sun even in simplest of outdoor images.

hdr_bad

However, a couple years (has it really been that long?) later and I can now tell you where that magick one-click-lighting button is!

hdr_good

Well its not technically a button… but a single node connection:

hdr_nodes

All you need to do is connect the image to the Strength input of the Background shader and it’ll use those awesome bright pixels of the sun as the strength, meaning the sun is actually brighter than all the other white things! Hence the awesome shadows and realistic lighting.

The Multiply node is there to control the strength of the light, I increased it to 2.0 since it was a little dark, but it could probably even go higher since the shadows are a bit dark here.

Update:

Don’t forget that we’re working with nodes here people! Anything’s possible!

hdr_joined

On the left is the plain setup with the HDR plugged just into the colour.
The middle is with the node setup above, the image plugged into the strength too (brightened with a multiple math node)
And the right one is with some extra adjustments:

hdr_nodes

Notice that the colour hasn’t been altered at all.
The Multiple math node is just to brighten it up, but the orange mix node mixes that strength value with white, effectively decreasing it’s contrast and making the shadows less harsh (thanks to Sir Reyn for the great idea!)

Now the blue mix node is where it gets a little more technical: The Light Path node gives us access to the different sorts of light rays. It’s common to see people use the Is Camera Ray to make something look a certain way to the camera, but behave differently for the rest of the scene – for example making a glass object look like glass to the camera, but the rest of the scene perceives it as plain old transparency, thus eliminating caustics.
Here we’re adding the Is Camera and Is Glossy rays (making sure to Clamp them so as to keep the result between 0 and 1 and continue energy conservation) and using that as the Fac of a mix between the strength driven by the image and a consistent strength (in this case of 5.0 since that’s what is bright enough for this HDR). So to the camera and in reflections (the glossy ray), the environment looks exactly as it did before we started messing with the strength, but it still lights the scene nicely.

Hope that isn’t too confusing for ya :)

Also remember to enable Multiple Importance Sample and choose Non-Color Data for the environment texture.

 

PS: For those of you who have been hiding in a cave the last few years, Reyn’s blog is a great one to follow! A true artist he is :)

Progressive Animation Render Addon and Image Stacking

I remember when Cycles first came out, people loved the progressive rendering, where it shows you the whole image and gets clearer and clearer the longer you wait. But one of the first things people asked was “Can you render an animation progressively too?“. The answer was no. Until now that is.

I’ve created an addon that allows you to do exactly that.

proganim

(Download it!)

It’ll render each frame of the animation to its own folder (like path/to/render/frame_15/image.jpg), and then repeat the whole animation render again using a different seed, which means that there’ll be a different noise pattern. Then you can hit the Merge Seeds button and it’ll gather all the different images for each frame, average the pixel values and make a nice clean animation.

Continue Reading…

Commonly Ignored Features #1: Multiple importance sample

For lamps and materials it’s on by default, so most people tend to ignore it. In certain cases it can help to turn it off, but most of the time what you really want to do is turn it on for Environment lighting.

MIS

From the wiki (which I wrote ;) ):

Multiple Importance Sample: Enabling this will sample the background texture such that lighter parts are favoured, producing less noise in the render. It is almost always a good idea to enable this when using an image texture to light the scene, otherwise noise can take a very long time to converge.

If you’re skeptical about the Importance of this (see what I did there?), check out this comparison:

 

MIS off vs on

Both images were rendered for 25 seconds, the left did 1500 samples in that time, the right only 1000 but clearly produced a cleaner image.

If you’re using a particularly high res HDR, try increasing the Map Resolution, still keeping in squares of 2 (256, 512, 1024…). It’ll probably produce less noise, but at the cost of memory and render speed. Just play with it and see what gives the least noise for the render time.

Cube of Doom

Batteries not included

Batteries not included

Another little personal project. A doodle of sorts. It has no purpose.

It’s an old model from a blendernerd tutorial (fixed up a bit), re-shaded and textured with, yes, Cycles.

In highschool we had a subject called Engineering and Graphics Design which we all had to take for the first two years. I caught on really quickly (this was pre-blender-obsession) and enjoyed it a whole lot. Why I didn’t take it further? I don’t know. I suppose I would be an entirely different person now if I had taken it instead of IT or Art, so I think I’m glad. One of my best friends took it so I got to see what they all did there anyways, and it didn’t look like much fun. Anyways, this image reminds me of those days because we would always draw from an isometric point of view (an orthographic camera where the X and Y axis are symmetrical… I think)

It’s a 1080p image and well suited to be a desktop background even if I say so myself :)

Suzanne’s Revenge!

Rwar!

Rwar!

Not what you were expecting? Didn’t think so ;)

A while back I did a collaboration with the amazing Chris Kuhn for the sole purpose of fun and releasing the files on BlendSwap. We made a pirate ship. We decided early on what the ship would be called, but other than that we weren’t even sure what style to do it in.

All we knew was that Chris would do the modeling and I would do the texturing and rendering. However, the one thing I did want to model was the prow of the ship (the bit in the front that’s usually some kind of statue).

After much thought, I it might be fun to make it a one eye’d T-Rex. So I did! I sculpted him and textured him… and then realized that he has nothing to do with the ship’s name. So one last minute decision later and a certain familiar monkey is sitting up there instead.

I’m not upset that this guy didn’t get up there, he doesn’t really fit in, but I just thought I’d share him anyways so that he doesn’t get lonely on my hard drive :) Here’s the finished ship if you haven’t seen it (and download it!)

(yeah the ocean is crap)

(yeah the ocean is crap)

I’ve got a bunch of other slightly abandoned projects I’ll be posting soon, so stay tuned!

And as always, rendered with cycles ;)

Ray Depth

Thomas Dinges’ GSoC has shown some pretty awesome results for us Cycles fans, my favourites so far being the Wavelength converter and Separate/Combine HSV nodes (finally right?), but those are fairly simple additions.

The real magic comes in with the Ray Depth output of the Light Path node. The potential of this is pretty awesome, allowing control of what is shown or calculated on which light bounces. This could be used to get rid of some pesky fire flies, reduce noise from having many sources of light, or simply to have some fun:

2013-07-18_21-13-12Here is a slightly orangy sphere, but on the first light bounce it becomes really pink, and on the third suddenly it’s green!

Pointless yeah, but like I said, potential!

After some initial tests, it seems it doesn’t really give all that much of a speed up in render time (in fact in some cases it was slightly slower, but only slightly), but used properly I think it could help reduce noise quite significantly. For example, in a well lit room with a thousand candles: the candles don’t really need any of their light to bounce, direct light only would be fine. But any other sources of light probably still need a couple bounces to fill the whole room.

When it’s merged to trunk, expect another post with some proper documentation on how and where to use it :)

If you’re super eager to use it right now, just use a Math node on Greater Than or Less Than (depending on the use) to get a mask of how many bounces are needed – for example have a mix shader with Glossy on top and a Diffuse on the bottom with the Ray Depth and a Greater Than 1.9 to have a glossy material that is seen as a diffuse one after two bounces (It’ll look pretty much the same, but with potentially less fireflies). And yeah Thomas agrees that we need an “Equal To” mode in the Math node ;)