Page MenuHome

Cycles: Add Scatter Direct and Scatter Indirect passes

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

Diff Detail

rB Blender

Event Timeline

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".


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


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.


Sure, I just went for the internal name now.


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.


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.


Rename this label to Volume.


Rename to VOLUME.


Rename to volume.


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


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

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


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.