Proof of Concept: Make the internal depth drawing of external engines optional
Changes PlannedPublic

Authored by Germano Cavalcante (mano-wii) on Oct 11 2017, 7:21 PM.

Details

Summary

Currently in blender 2.8, to adapt the Cycles engine with the elements in view3d (grid, lamps, outline, wire ...), the depth of all objects are drawn in draw_manager.c

However this solution is appropriate for external render_engines that only pass RGBA values. If an engine also informs the Z-buffer, the depth pass in the draw_manager should be ignored.

Therefore, it is convenient for the depth of the draw_manager to be toggleable.

So this patch proposes to separate the depth of the external_engine.c thus making a new internal engine called depth_only_engine.

This other internal engine is added when the new bool bf_use_internal_depth is True.

This solution only solves the visual aspect of an external render engine. The selection continues using the internal geometry of each object.

Diff Detail

Here is a basic example of a render engine that does not need an internal depth:

Would rather have this as a pass for the existing basic engine.

Note this raises an issue that currently (as far as I know) we can't configure draw managers when instancing.

Ability to instance a draw manager with only certain passes seems reasonable IMHO.

Germano Cavalcante (mano-wii) planned changes to this revision.Dec 20 2017, 2:27 PM