Cycles: Add Scatter Direct and Scatter Indirect passes
ClosedPublic

Authored by Lukas Stockner (lukasstockner97) on Oct 29 2017, 3:26 PM.

Diff Detail

Repository
rB Blender
Brecht Van Lommel (brecht) requested changes to this revision.Oct 29 2017, 4:10 PM

Perhaps we could put all light passes (those setting use_light_pass) in the same category? Seems a bit less random than "component".

intern/cycles/blender/addon/properties.py
1192

Can we rename this to volume instead? Surfaces scatter light as well, so it's a bit ambiguous.

intern/cycles/blender/blender_sync.cpp
481

I don't think we should set the pass category in this Blender specific code, wen can set the category from the pass type in Pass::add(). We already have a big switch on all the pass types there to set the number of components, exposure, etc, so we could set the category there as well.

This revision now requires changes to proceed.Oct 29 2017, 4:10 PM

Splitting by use_light_pass makes sense, yeah. Maybe also add a separate category for debug passes? Not really needed right now, though.

intern/cycles/blender/addon/properties.py
1192

Sure, I just went for the internal name now.

intern/cycles/blender/blender_sync.cpp
481

Sounds reasonable, but then we need some alternative way to unambiguously tell Pass::add() which pass to add since just a single PassType is not enough.

We can postpone splitting debug passes until it's needed.

intern/cycles/blender/blender_sync.cpp
481

We could make all the PASS_ enum values no longer a bitmask. Then we do have to switch to (1 << PASS_*) and (1 << (PASS_* - 32)) in a bunch of places, or add PASS_MASK_* enums.

Okay, here's the better approach - no categories needed, the PASS_ enum now just stores indices and a macro turns them into bitflags.

Brecht Van Lommel (brecht) requested changes to this revision.Nov 16 2017, 5:20 PM

Looks good, just some nitpicky stuff.

intern/cycles/blender/addon/ui.py
529

Rename this label to Volume.

intern/cycles/kernel/kernel_types.h
412–413

Rename to VOLUME.

1219

Rename to volume.

intern/cycles/render/film.cpp
120–137

Personally I don't think using a macro here makes things simpler, would prefer to keep old code.

319

Use PASSMASK(pass.type).

This revision now requires changes to proceed.Nov 16 2017, 5:20 PM

Removed film.cpp macro and renamed the pass to Volume.

However, PASSMASK() in its current form can't really be used in film.cpp since it only works for PASS_* enum values - I could split it up into one macro that generates the mask and one that does the enum name concatenation, but I'm not sure whether that's worth it for only one instance.

Forgot to register the pass in engine.py

Looks good to commit, just one label needs to change still.

intern/cycles/blender/addon/ui.py
529

Still need to rename this.

This revision is now accepted and ready to land.Nov 17 2017, 4:10 PM
This revision was automatically updated to reflect the committed changes.