Blender V5.3
workbench::dof Namespace Reference

Classes

struct  DepthOfField
struct  Prepare
struct  PrepareOut
struct  DownSample
struct  DownSampleOut
struct  Blur1
struct  Blur1Out
struct  Blur2
struct  Blur2Out
struct  Resolve
struct  ResolveOut

Functions

void vert (const int vert_id, float4 &position)
float2 dof_encode_coc (float near, float far)
float dof_decode_coc (float2 cocs)
float dof_decode_signed_coc (float2 cocs)
float4 sum_weighted (float4 val0, float4 val1, float4 val2, float4 val3, float4 weights)
void prepare (DepthOfField &dof, Prepare &srt, draw::View &views, PrepareOut &out, const float4 frag_co)
void downsample (DownSample &srt, DownSampleOut &out, const float4 frag_co)
void blur1 (DepthOfField &dof, Blur1 &srt, Blur1Out &out, const float4 frag_co)
void s2 (float4 &a, float4 &b)
void mn3 (float4 &a, float4 &b, float4 &c)
void mx3 (float4 &a, float4 &b, float4 &c)
void mnmx3 (float4 &a, float4 &b, float4 &c)
void mnmx4 (float4 &a, float4 &b, float4 &c, float4 &d)
void mnmx5 (float4 &a, float4 &b, float4 &c, float4 &d, float4 &e)
void mnmx6 (float4 &a, float4 &b, float4 &c, float4 &d, float4 &e, float4 &f)
void blur2 (Blur2 &srt, Blur2Out &out, const float4 frag_co)
void resolve (DepthOfField &dof, Resolve &srt, draw::View &views, ResolveOut &out, const float4 frag_co)

Variables

static constexpr int dof_sample_count = 49

Detailed Description

Separable Hexagonal Bokeh Blur by Colin Barré-Brisebois https://colinbarrebrisebois.com/2017/04/18/hexagonal-bokeh-blur-revisited-part-1-basic-3-pass-version/ Converted and adapted from HLSL to GLSL by Clément Foucault

Function Documentation

◆ blur1()

void workbench::dof::blur1 ( DepthOfField & dof,
Blur1 & srt,
Blur1Out & out,
const float4 frag_co )

◆ blur2()

void workbench::dof::blur2 ( Blur2 & srt,
Blur2Out & out,
const float4 frag_co )

◆ dof_decode_coc()

float workbench::dof::dof_decode_coc ( float2 cocs)

Definition at line 32 of file workbench_fx_dof.bsl.hh.

References dof_decode_coc(), max, MAX_COC_SIZE, float2::x, and float2::y.

Referenced by blur1(), blur2(), and dof_decode_coc().

◆ dof_decode_signed_coc()

float workbench::dof::dof_decode_signed_coc ( float2 cocs)

Definition at line 36 of file workbench_fx_dof.bsl.hh.

References dof_decode_signed_coc(), MAX_COC_SIZE, float2::x, and float2::y.

Referenced by blur1(), and dof_decode_signed_coc().

◆ dof_encode_coc()

float2 workbench::dof::dof_encode_coc ( float near,
float far )

Definition at line 28 of file workbench_fx_dof.bsl.hh.

References dof_encode_coc(), and MAX_COC_SIZE.

Referenced by dof_encode_coc(), downsample(), and prepare().

◆ downsample()

void workbench::dof::downsample ( DownSample & srt,
DownSampleOut & out,
const float4 frag_co )

◆ mn3()

void workbench::dof::mn3 ( float4 & a,
float4 & b,
float4 & c )

Definition at line 289 of file workbench_fx_dof.bsl.hh.

References b, force_inline, mn3(), and s2().

Referenced by mn3(), mnmx5(), and mnmx6().

◆ mnmx3()

void workbench::dof::mnmx3 ( float4 & a,
float4 & b,
float4 & c )

Definition at line 301 of file workbench_fx_dof.bsl.hh.

References b, force_inline, mnmx3(), mx3(), and s2().

Referenced by blur2(), and mnmx3().

◆ mnmx4()

void workbench::dof::mnmx4 ( float4 & a,
float4 & b,
float4 & c,
float4 & d )

Definition at line 307 of file workbench_fx_dof.bsl.hh.

References b, force_inline, mnmx4(), and s2().

Referenced by blur2(), and mnmx4().

◆ mnmx5()

void workbench::dof::mnmx5 ( float4 & a,
float4 & b,
float4 & c,
float4 & d,
float4 & e )

Definition at line 315 of file workbench_fx_dof.bsl.hh.

References b, force_inline, mn3(), mnmx5(), mx3(), and s2().

Referenced by blur2(), and mnmx5().

◆ mnmx6()

void workbench::dof::mnmx6 ( float4 & a,
float4 & b,
float4 & c,
float4 & d,
float4 & e,
float4 & f )

Definition at line 323 of file workbench_fx_dof.bsl.hh.

References b, force_inline, mn3(), mnmx6(), mx3(), and s2().

Referenced by blur2(), and mnmx6().

◆ mx3()

void workbench::dof::mx3 ( float4 & a,
float4 & b,
float4 & c )

Definition at line 295 of file workbench_fx_dof.bsl.hh.

References b, force_inline, mx3(), and s2().

Referenced by mnmx3(), mnmx5(), mnmx6(), and mx3().

◆ prepare()

◆ resolve()

void workbench::dof::resolve ( DepthOfField & dof,
Resolve & srt,
draw::View & views,
ResolveOut & out,
const float4 frag_co )

◆ s2()

void workbench::dof::s2 ( float4 & a,
float4 & b )

Definition at line 282 of file workbench_fx_dof.bsl.hh.

References b, force_inline, max, min, and s2().

Referenced by mn3(), mnmx3(), mnmx4(), mnmx5(), mnmx6(), mx3(), and s2().

◆ sum_weighted()

float4 workbench::dof::sum_weighted ( float4 val0,
float4 val1,
float4 val2,
float4 val3,
float4 weights )

Definition at line 41 of file workbench_fx_dof.bsl.hh.

References safe_rcp(), and sum_weighted().

Referenced by downsample(), prepare(), and sum_weighted().

◆ vert()

void workbench::dof::vert ( const int vert_id,
float4 & position )

Definition at line 21 of file workbench_fx_dof.bsl.hh.

References fullscreen_vertex(), position, vert(), and vertex_id.

Referenced by vert().

Variable Documentation

◆ dof_sample_count

int workbench::dof::dof_sample_count = 49
staticconstexpr

--------------— STEP 2 ---------------— Blur vertically and diagonally. Outputs vertical blur and combined blur in MRT

Definition at line 198 of file workbench_fx_dof.bsl.hh.

Referenced by blur1().