Experimental 2.74 Cycles build with Adaptive, Tonemapping, Portals and Shadowcatcher!

Update: There’s a 2.76 build on page 12!

Now that 2.74 is released, it’s probably time to post a new build with all the experimental features I’ve been coding in the last time. However, since each feature has its own thread, I’m just creating a new post here :smiley:

It’s based on the 2.74 release commit, with Adaptive Sampling (D808), Tonemapping (D947), Light Portals (D1133), Hilbert Curve Sampling (D1166) and a Shadowcatcher (not submitted yet) on top of it.

Quick summary of the features:

Adaptive sampling:
Automatically stops tiles from rendering once they’ve reached a certain quality level.
Important: The “regular” sample limit still applies (if you want to diable it, just set the samples to something like 1000000)!
The settings panel only appears in Experimental mode. “Adaptive distribution” should be enabled for bigger tiles (roughy 32x32 and above). The Confidence slider sets the quality (80 is pretty conservative, 60 should also be quite clean). Map interval can remain at 25, you should only lower it for Branched Path Tracing (it sets how often the error estimate is updated, and since BPT needs fewer AA samples than regular PT, it should also be lowered).

Tonemapping:
Reduces the dynamic range of the image, often used if certain parts of the scene are too bright.
The setting is called “white value”, it’s found under the color management settings in the scene tab. It sets the brightness that will be mapped down to brightness 1, in stops (just like the exposure). 0 means no tonemapping. Tonemapping is applied between exposure and gamma control.

Light portals:
Portals reduce noise when rendering interiors with background/HDRI lighting. The resulting image should be the same, but with portals it will require less samples (although each sample will take slightly longer).
To add a portal, add a Area Lamp and check “Is Portal”. This will disable the lamp and use it as a portal instead. Note that portals are unidirectional and will only be used in the direcction into which the area lamp points.
Portals should be used to cover the main areas where background light enters your interior. Less portals are better, so for example, two windows next to each other should be covered with only one portal.

Hilbert curve:
Adds a new tile sampling pattern. Hilbert curve will render slightly faster than Center, and IMO it looks awesome :smiley:

Shadowcatcher:
This is just an experiment of mine, I’m not too sure whether it will be useful in practise. Anyways, to use it, set your plane/whatever to use the “ShadowCatcher” BSDF and activate Film Transparency. Also, to account for shadows from the background/HDRI, you must enable Multiple Importance Sampling for it.
Also, there currently is a bug if you plug the ShadowCatcher into a Mix Shader with a Factor that’s not either zero or one. This means that mixing based on i.e. “Is Camera Ray” works, but a 50-50 mix of ShadowCatcher and diffuse won’t.

Enough talking, here’s the build:
https://dl.orangedox.com/k0Ldp5YZIJcbBPV9E0/blender-2.74-win64-AS-TM-P-SC.zip
CUDA works, this time the sm_52 kernels should also be included.
I can only build for Win64 (no Mac here, and I’m too stupid for static linking on Linux;)), so if anyone could build for Mac/Linux, that’s be awesome! Here’s the patch, apply it to the v2.74 tag (commit 000dfc03):
http://www.pasteall.org/57621/diff

Thank you very much for the build! Looking forward to test it!

Downloading now, can’t wait, thanks Lukas!

SUPER :), great Job, THANKS !!!

WOW :slight_smile: Shadowcatcher is working!!! A small problem I see is if the corners of the shadow catcher are inside the view the edges are not transparent but… Man… :smiley: great work!.. just need to scale everything. Big Thanks for the build! Great work !! Tasty Easter Egg ! :smiley:

Wish you all the best lukas!

Got the same as @Piet when boundary of catcher is in camera view. Also you confirm viewport rendering is ignoring shadow catcher?

Anyways, quick example! Thanks Lukas!
https://db.tt/y1OnSNv2

Oops, yes, the boundary is indeed visible. It’s a quick fix, thanks for reporting.
Regarding viewport: Yes, it’s expected to not work. It might be possible, but it won’t be as easy as for F12 renders.

Glorious!!! Thanks much for this!

I didnt test everything, but the portal stuff is so awesome!!!

Great!!!
Many thanks Lukas

Portals, ShadowCatcher, Adaptivity and ToneMapping. Thank you very much Lukas! You seem to be one of the very few people in the blender community who truly know what Cycles is missing to succeed.

I am wondering. Does the shadow catcher correctly camera project directly visible background on top of the shadow catcher geometry so it shows up correct in reflections on contact areas?

Cycles is getting better and better each time. AWESOME!!

Well, not really, I just read forum posts :wink: Seriously, though, I’m quite a noob when it comes to using Blender, I just implement stuff that lots of people seem to miss. There already way a 9-page thread about Tonemapping before I started to implement it… Also, many ideas (Tonemapping, Portals and an upcoming surprise (if I ever get it to work properly ;))) were suggested by marcoG_ita, so he’s the one who knows what’s missing :smiley:

The current behaviour is: For camera rays, alpha is set to the ratio between received light and received light when not considering occlusion. For non-camera rays, it works just like a white diffuse shader. For controlling the received reflection on the model, you should mix the ShadowCatcher with another BSDF based on the “Is Camera Ray” input. Reasonable choices are either a Transparent BSDF to get lighting from the background behind it or a colored diffuse BSDF (for example, if you want to composite it onto a red floor, a red Diffuse BSDF will give realistic bounce light on the model). Of course, you can also get crazy and add stuff like an Emission Shader :smiley:

Ho Great Lukas…i’m so excited to try it…Thanks you so much.

Thanks Lukas!! Now just some good soul to build it for OS X, never succeed doing it myself…

Thanks a lot Lukas for all these useful features!

Wow Adaptive protals and SHADOW CATCHERS !!! This is amazing!

Hey Lukas, just a few things about adaptive sampling.

1). Currently you have it so the engine falls back to using Sobol when you have so much as just the adaptive sampling checkbox ticked. If you prefer to render with CMJ instead, I would instead have it just use Sobol when the adaptive distribution checkbox is also set (because CMJ has some advantages over Sobol in terms of noise reduction).

2). When using the adaptive distribution, is there a way to increase the distance over which samples are remapped, I ask because the limited distance now seems to reduce the effectiveness of larger tiles and allows the sampler to get ‘stuck’ on certain tiles just because it has one or two fireflies somewhere in it.

3). I have noticed before in test scenes that the overall pattern of which tiles render when stays relatively unchanged throughout the entire render (even after areas are perceived as converged by the naked eye). Are things supposed to work like that?

Aaaaaamazing! portal are great just as AS and everything else. I don’t fully understood how AS works. Map update rate it’s like the minimum amount of samples that it will surely be calculated? And the confidence is how much the will be closer to the usual samples value? it would be great to see number info about how many samples are actually calculated in the end…i think it could help the user understand how the feature works!
Thanks a lot any way

I’m starting to think that you could make the remapping distance into a value that increases when the average error of a tile decreases or when the total contrast between error values in a tile increases. This could also be increased to start with for large tile values (like if someone wanted to use the GPU).

That way, a single firefly won’t jam up progress by not letting the sampler leave the tile in question, as the tile converges, nearly every sample in the entire tile then would be remapped to the flrefly so as to smash it quickly and allow the thread to do another tile.