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

So hey, buddy!
Do you think this will ever be incorporated into an official Blender update at some point?

In dear need of an OS X build here :wink:

Ha Lucas you rock !
Its amazing what you add each time to Cycles, that transparant mode is ‘again’ a super! addition to cycles.
This would make placing objects on flat surfaces in camera tracked scenes a lot easier, no doubt this is usefull.
Great for architectural work, or demos of ‘to be’, build things inside real scenes.
It was pretty complex to do this before, as i done it a few times.

I see your braches as master, those are the ones i use

Really awesome!!!
By the way, i noticed that tha shadow catcher and the AS they don’t work well toghether, in fact AS totally ignore the Shadow catcher as you can clearly see in this image:


Here also! :slight_smile:

This is just an experiment of mine, I’m not too sure whether it will be useful in practise.

what! man! we’ve been dying for a shadow catcher, i’ll try asap, thank you.

i get this error compiling with the patch @ 2.74 tag, windows 8.1 x64, mingw64:

intern\opencolorio\ocio_impl_glsl.cc: In member function ‘virtual bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState**, OCI
O_ConstProcessorRcPtr__**, OCIO_CurveMappingSettings*, float, float, float, bool)’:
intern\opencolorio\ocio_impl_glsl.cc:258:38: error: ‘fabsf’ was not declared in this scope
intern\opencolorio\ocio_impl_glsl.cc:419:99: error: ‘powf’ was not declared in this scope
intern\opencolorio\ocio_impl_glsl.cc:423:81: error: ‘powf’ was not declared in this scope

I know there is plans to get a shadow catcher in trunk, but this is fantastic. I have created so many workarounds to get transparent shadows in cycles, this will be super useful. THANKS!

At this point, the devs. may risk seeing a massive insurrection against them from the community if they don’t accept the majority of these patches. Think of people abandoning Cycles (or even Blender) en-masse and a major drop in development fund money.

Not that I expect to be one of them, but you know how a lot of people online are.

In the meantime, Lukas still needs to address Sergey’s code comments for the Hilbert tile order and the Light portals (and flag him down for another go-around with the adaptive sampling patch).

Taking bets?

The light portal is pretty amazing, you can get the camera obscura effect through small hole in pretty reasonable time.

i7 3770K @3.5Ghz, render time 11 min 07 seconds with adaptive sampling and max samples at 2000:

Great stuff, especially the shadow catcher! I can’t seem to find the hilbert’s curve pattern though. And the addaptive sampling sometimes even gives me longer render times on CPU. Does anyone know why this is?
Thank you for these awesome features:)

What does a shadow catcher do?

Also, I think I understand that the portal help find light sources or something so that less overall samples are needed, right?

Adaptive sampling is a game changer. Great job!

Ok, I REALLY NEED that shadow catcher node. What are the odds of a mac version showing up… like… today? :slight_smile:

Hey Lukas,

Is there any chance to add a include and exclude list for compositing and better scene control? What I mean is like you could make the floor object exclude glossy and shadows from other specified items. Currently you can make a certain object stop receiving shadows, gloss, diffuse and such but it is per scene level not per object.

Apart from that shadow caster is awesome.


Hello again, i tried to compile blender on mac with the patch, but i am getting some errors while applying the patch. Blender compiles fine, when not applying the patch. To compile blender, i was following de online tutorial from the docs.
Thank you!
Here are the messages that i get when trying to apply the patch:

I7:blender giorgio$ patch -p1 < extras.diff
patching file intern/cycles/blender/addon/properties.py
patching file intern/cycles/blender/addon/ui.py
Hunk #3 succeeded at 762 (offset 9 lines).
Hunk #4 succeeded at 788 (offset 9 lines).
patching file intern/cycles/blender/blender_object.cpp
patching file intern/cycles/blender/blender_session.cpp
Hunk #1 succeeded at 136 with fuzz 1.
Hunk #5 FAILED at 403.
1 out of 7 hunks FAILED – saving rejects to file intern/cycles/blender/blender_session.cpp.rej
patching file intern/cycles/blender/blender_session.h
patching file intern/cycles/blender/blender_shader.cpp
Hunk #1 FAILED at 321.
1 out of 1 hunk FAILED – saving rejects to file intern/cycles/blender/blender_shader.cpp.rej
patching file intern/cycles/blender/blender_sync.cpp
patching file intern/cycles/device/device_cpu.cpp
Hunk #2 FAILED at 200.
Hunk #3 succeeded at 244 (offset 2 lines).
Hunk #4 succeeded at 275 (offset 2 lines).
Hunk #5 succeeded at 354 (offset 2 lines).
1 out of 5 hunks FAILED – saving rejects to file intern/cycles/device/device_cpu.cpp.rej
patching file intern/cycles/device/device_cuda.cpp
Hunk #6 FAILED at 969.
1 out of 6 hunks FAILED – saving rejects to file intern/cycles/device/device_cuda.cpp.rej
patching file intern/cycles/device/device_opencl.cpp
Hunk #3 succeeded at 913 (offset 3 lines).
Hunk #4 succeeded at 934 (offset 3 lines).
Hunk #5 succeeded at 1072 (offset 3 lines).
patching file intern/cycles/device/device_task.h
patching file intern/cycles/kernel/kernel.cl
patching file intern/cycles/kernel/kernel.cu
patching file intern/cycles/kernel/kernel_compat_opencl.h
patching file intern/cycles/kernel/kernel_debug.h
patching file intern/cycles/kernel/kernel_emission.h
patching file intern/cycles/kernel/kernel_light.h
patching file intern/cycles/kernel/kernel_passes.h
patching file intern/cycles/kernel/kernel_path.h
patching file intern/cycles/kernel/kernel_path_surface.h
patching file intern/cycles/kernel/kernel_shader.h
Hunk #1 succeeded at 779 (offset -2 lines).
patching file intern/cycles/kernel/kernel_types.h
patching file intern/cycles/kernel/osl/background.cpp
patching file intern/cycles/kernel/osl/osl_closures.cpp
patching file intern/cycles/kernel/osl/osl_closures.h
patching file intern/cycles/kernel/osl/osl_shader.cpp
patching file intern/cycles/kernel/shaders/stdosl.h
patching file intern/cycles/kernel/svm/svm.h
patching file intern/cycles/kernel/svm/svm_closure.h
patching file intern/cycles/kernel/svm/svm_types.h
patching file intern/cycles/render/buffers.cpp
patching file intern/cycles/render/buffers.h
patching file intern/cycles/render/film.cpp
patching file intern/cycles/render/light.cpp
Hunk #1 succeeded at 129 (offset 1 line).
Hunk #2 succeeded at 155 (offset 1 line).
Hunk #3 succeeded at 295 (offset 1 line).
Hunk #4 succeeded at 378 (offset 1 line).
Hunk #5 succeeded at 400 (offset 1 line).
Hunk #6 succeeded at 538 (offset 38 lines).
Hunk #7 succeeded at 598 (offset 38 lines).
Hunk #8 succeeded at 619 (offset 38 lines).
Hunk #9 succeeded at 648 (offset 38 lines).
Hunk #10 succeeded at 666 (offset 38 lines).
Hunk #11 succeeded at 686 (offset 38 lines).
patching file intern/cycles/render/light.h
patching file intern/cycles/render/nodes.cpp
patching file intern/cycles/render/nodes.h
patching file intern/cycles/render/session.cpp
patching file intern/cycles/render/session.h
patching file intern/cycles/render/tile.cpp
Hunk #1 FAILED at 17.
Hunk #2 succeeded at 85 (offset 1 line).
Hunk #3 succeeded at 105 (offset 1 line).
Hunk #4 succeeded at 147 (offset 1 line).
Hunk #5 succeeded at 169 (offset 1 line).
Hunk #6 succeeded at 197 (offset 1 line).
Hunk #7 succeeded at 211 (offset 1 line).
Hunk #8 succeeded at 224 (offset 1 line).
Hunk #9 succeeded at 251 (offset 1 line).
Hunk #10 succeeded at 270 with fuzz 2 (offset 1 line).
Hunk #11 succeeded at 311 (offset 1 line).
Hunk #12 succeeded at 335 (offset 1 line).
1 out of 12 hunks FAILED – saving rejects to file intern/cycles/render/tile.cpp.rej
patching file intern/cycles/render/tile.h
patching file intern/cycles/util/CMakeLists.txt
patching file intern/cycles/util/util_color.h
patching file intern/cycles/util/util_hilbert.h
patching file intern/cycles/util/util_importance.cpp
patching file intern/cycles/util/util_importance.h
patching file intern/cycles/util/util_list.h
patching file intern/opencolorio/fallback_impl.cc
Hunk #1 succeeded at 433 (offset 13 lines).
patching file intern/opencolorio/gpu_shader_display_transform.glsl
patching file intern/opencolorio/ocio_capi.cc
Hunk #1 succeeded at 329 (offset 5 lines).
patching file intern/opencolorio/ocio_capi.h
Hunk #1 succeeded at 191 (offset 2 lines).
patching file intern/opencolorio/ocio_impl.h
Hunk #1 succeeded at 109 (offset 2 lines).
Hunk #2 succeeded at 199 (offset 4 lines).
Hunk #3 succeeded at 290 (offset 6 lines).
patching file intern/opencolorio/ocio_impl_glsl.cc
patching file release/scripts/startup/nodeitems_builtins.py
patching file source/blender/blenkernel/BKE_node.h
Hunk #1 succeeded at 783 (offset -4 lines).
patching file source/blender/blenkernel/intern/colortools.c
patching file source/blender/blenkernel/intern/node.c
patching file source/blender/editors/interface/interface_templates.c
Hunk #1 succeeded at 3619 (offset -3 lines).
patching file source/blender/imbuf/intern/colormanagement.c
Hunk #1 succeeded at 105 (offset 5 lines).
Hunk #2 succeeded at 125 (offset 5 lines).
Hunk #3 succeeded at 206 (offset 5 lines).
Hunk #4 succeeded at 218 (offset 5 lines).
Hunk #5 succeeded at 226 (offset 5 lines).
Hunk #6 succeeded at 243 (offset 5 lines).
Hunk #7 succeeded at 286 (offset 5 lines).
Hunk #8 succeeded at 306 (offset 5 lines).
Hunk #9 succeeded at 367 (offset 5 lines).
Hunk #10 succeeded at 385 (offset 5 lines).
Hunk #11 succeeded at 409 (offset 5 lines).
Hunk #12 succeeded at 428 (offset 5 lines).
Hunk #13 succeeded at 718 (offset 8 lines).
Hunk #14 succeeded at 781 (offset 8 lines).
Hunk #15 succeeded at 800 (offset 8 lines).
Hunk #16 succeeded at 940 (offset 8 lines).
Hunk #17 succeeded at 958 (offset 8 lines).
Hunk #18 succeeded at 1097 (offset 8 lines).
Hunk #19 succeeded at 1553 (offset 36 lines).
Hunk #20 succeeded at 2905 (offset 36 lines).
Hunk #21 succeeded at 2912 (offset 36 lines).
Hunk #22 succeeded at 2943 (offset 36 lines).
Hunk #23 succeeded at 2958 (offset 36 lines).
Hunk #24 succeeded at 2973 (offset 36 lines).
Hunk #25 succeeded at 2995 (offset 36 lines).
Hunk #26 succeeded at 3014 (offset 36 lines).
Hunk #27 succeeded at 3154 (offset 36 lines).
Hunk #28 succeeded at 3194 (offset 36 lines).
Hunk #29 succeeded at 3243 (offset 36 lines).
patching file source/blender/makesdna/DNA_color_types.h
Hunk #1 succeeded at 168 (offset -1 lines).
patching file source/blender/makesrna/intern/rna_color.c
Hunk #1 succeeded at 1141 (offset 1 line).
patching file source/blender/makesrna/intern/rna_render.c
patching file source/blender/nodes/CMakeLists.txt
patching file source/blender/nodes/NOD_shader.h
patching file source/blender/nodes/NOD_static_types.h
patching file source/blender/nodes/shader/nodes/node_shader_shadow_catcher.c
patching file source/blender/render/extern/include/RE_pipeline.h
patching file source/blender/render/intern/source/render_result.c
I7:blender giorgio$

4 Portals, 2 minutes on CPU both, Sky Background lit.


Did a quick test scene to see how portals would work with an interior space lit by a sunlamp.

I don’t know if it’s the way things are supposed to work, but the use of a portal over the opening reduced the amount of convergence for indirect illumination caused by the sunlamp, I was hoping at least for portals to also help with illumination from lamps and surfaces outside coming into the interior space and not just the environment (as it’s not the source of the majority of long term noise).

I’m afraid the usefulness of portals is then geared toward more specific setups if you can’t shine any light through windows or anything if you want faster times.

EDIT: Okay, building the sunlight into the environment itself doesn’t seem to help either, as the implementation as of now does not seem to take environmental MIS into account so as to allow the portal to give an overall benefit, instead it winds up reducing convergence even though the weaker lighting from the environment overall converges better.

Portals aren’t supposed to help Sun lamp, they “teleport” the ray to the Environment.

it renders only a shadow without the need to use passes remove the background and make the shadow transparent so you can composite it over a backplate.

here you see a car in keyshot and the shadow below it is transparent and the backplate is just a background image