Blender V5.3
workbench::shadow Namespace Reference

Namespaces

namespace  rt
namespace  visibility

Classes

struct  VertIn
struct  VertOut
struct  GeomOut
struct  Constants
struct  Resources
struct  GeometryShaderEmulator
struct  FragOut

Functions

void vert_main (const Resources &srt, const draw::Resource &res, const int vert_id, const int inst_index, float4 &out_position)
void vert_main_caps (const Resources &srt, const draw::Resource &res, const int vert_id, const int inst_index, float4 &out_position)
void frag_main ()
void frag_debug (const Resources &srt, const bool front_facing, FragOut &frag_out)

Variables

PipelineGraphic pass_manifold_no_caps (vert_main, frag_main, Constants{.double_manifold=false,.shadow_pass=true})
PipelineGraphic pass_no_manifold_no_caps (vert_main, frag_main, Constants{.double_manifold=true,.shadow_pass=true})
PipelineGraphic fail_manifold_caps (vert_main_caps, frag_main, Constants{.double_manifold=false,.shadow_pass=false})
PipelineGraphic fail_manifold_no_caps (vert_main, frag_main, Constants{.double_manifold=false,.shadow_pass=false})
PipelineGraphic fail_no_manifold_caps (vert_main_caps, frag_main, Constants{.double_manifold=true,.shadow_pass=false})
PipelineGraphic fail_no_manifold_no_caps (vert_main, frag_main, Constants{.double_manifold=true,.shadow_pass=false})
PipelineGraphic pass_manifold_no_caps_debug (vert_main, frag_debug, Constants{.double_manifold=false,.shadow_pass=true})
PipelineGraphic pass_no_manifold_no_caps_debug (vert_main, frag_debug, Constants{.double_manifold=true,.shadow_pass=true})
PipelineGraphic fail_manifold_caps_debug (vert_main_caps, frag_debug, Constants{.double_manifold=false,.shadow_pass=false})
PipelineGraphic fail_manifold_no_caps_debug (vert_main, frag_debug, Constants{.double_manifold=false,.shadow_pass=false})
PipelineGraphic fail_no_manifold_caps_debug (vert_main_caps, frag_debug, Constants{.double_manifold=true,.shadow_pass=false})
PipelineGraphic fail_no_manifold_no_caps_debug (vert_main, frag_debug, Constants{.double_manifold=true,.shadow_pass=false})

Detailed Description

Extrude shadow casters along their silhouette edge. Manifold meshes only generate one quad per silhouette edge. Non-Manifold meshes generate one quad on their non manifold edges (border edges) and two quad on their silhouette edge (non-border edges) which we consider "manifold".

This shader uses line adjacency primitive to know the geometric normals of neighbor faces. A quad is generated if the faces on each sides of the edge are not facing the light the same way.

This vertex shader emulates a geometry shader. The draw call generate enough triangle for one or two quads per input primitive. Each vertex shader invocation reads the whole input primitive and execute the vertex shader code on each of the input primitive's vertices.

Function Documentation

◆ frag_debug()

void workbench::shadow::frag_debug ( const Resources & srt,
const bool front_facing,
FragOut & frag_out )

Definition at line 402 of file workbench_shadow.bsl.hh.

References frag_debug(), front_facing, out, resource_table, and static_branch.

Referenced by frag_debug().

◆ frag_main()

void workbench::shadow::frag_main ( )

Definition at line 391 of file workbench_shadow.bsl.hh.

References frag_main().

Referenced by frag_main().

◆ vert_main()

void workbench::shadow::vert_main ( const Resources & srt,
const draw::Resource & res,
const int vert_id,
const int inst_index,
float4 & out_position )

◆ vert_main_caps()

void workbench::shadow::vert_main_caps ( const Resources & srt,
const draw::Resource & res,
const int vert_id,
const int inst_index,
float4 & out_position )

Variable Documentation

◆ fail_manifold_caps

PipelineGraphic workbench::shadow::fail_manifold_caps(vert_main_caps, frag_main, Constants{.double_manifold=false,.shadow_pass=false}) ( vert_main_caps ,
frag_main ,
Constants{.double_manifold=false,.shadow_pass=false}  )

◆ fail_manifold_caps_debug

PipelineGraphic workbench::shadow::fail_manifold_caps_debug(vert_main_caps, frag_debug, Constants{.double_manifold=false,.shadow_pass=false}) ( vert_main_caps ,
frag_debug ,
Constants{.double_manifold=false,.shadow_pass=false}  )

◆ fail_manifold_no_caps

PipelineGraphic workbench::shadow::fail_manifold_no_caps(vert_main, frag_main, Constants{.double_manifold=false,.shadow_pass=false}) ( vert_main ,
frag_main ,
Constants{.double_manifold=false,.shadow_pass=false}  )

◆ fail_manifold_no_caps_debug

PipelineGraphic workbench::shadow::fail_manifold_no_caps_debug(vert_main, frag_debug, Constants{.double_manifold=false,.shadow_pass=false}) ( vert_main ,
frag_debug ,
Constants{.double_manifold=false,.shadow_pass=false}  )

◆ fail_no_manifold_caps

PipelineGraphic workbench::shadow::fail_no_manifold_caps(vert_main_caps, frag_main, Constants{.double_manifold=true,.shadow_pass=false}) ( vert_main_caps ,
frag_main ,
Constants{.double_manifold=true,.shadow_pass=false}  )

◆ fail_no_manifold_caps_debug

PipelineGraphic workbench::shadow::fail_no_manifold_caps_debug(vert_main_caps, frag_debug, Constants{.double_manifold=true,.shadow_pass=false}) ( vert_main_caps ,
frag_debug ,
Constants{.double_manifold=true,.shadow_pass=false}  )

◆ fail_no_manifold_no_caps

PipelineGraphic workbench::shadow::fail_no_manifold_no_caps(vert_main, frag_main, Constants{.double_manifold=true,.shadow_pass=false}) ( vert_main ,
frag_main ,
Constants{.double_manifold=true,.shadow_pass=false}  )

◆ fail_no_manifold_no_caps_debug

PipelineGraphic workbench::shadow::fail_no_manifold_no_caps_debug(vert_main, frag_debug, Constants{.double_manifold=true,.shadow_pass=false}) ( vert_main ,
frag_debug ,
Constants{.double_manifold=true,.shadow_pass=false}  )

◆ pass_manifold_no_caps

PipelineGraphic workbench::shadow::pass_manifold_no_caps(vert_main, frag_main, Constants{.double_manifold=false,.shadow_pass=true}) ( vert_main ,
frag_main ,
Constants{.double_manifold=false,.shadow_pass=true}  )

◆ pass_manifold_no_caps_debug

PipelineGraphic workbench::shadow::pass_manifold_no_caps_debug(vert_main, frag_debug, Constants{.double_manifold=false,.shadow_pass=true}) ( vert_main ,
frag_debug ,
Constants{.double_manifold=false,.shadow_pass=true}  )

◆ pass_no_manifold_no_caps

PipelineGraphic workbench::shadow::pass_no_manifold_no_caps(vert_main, frag_main, Constants{.double_manifold=true,.shadow_pass=true}) ( vert_main ,
frag_main ,
Constants{.double_manifold=true,.shadow_pass=true}  )

◆ pass_no_manifold_no_caps_debug

PipelineGraphic workbench::shadow::pass_no_manifold_no_caps_debug(vert_main, frag_debug, Constants{.double_manifold=true,.shadow_pass=true}) ( vert_main ,
frag_debug ,
Constants{.double_manifold=true,.shadow_pass=true}  )