Blender  V3.3
Functions
workbench_shadow.c File Reference
#include "DRW_render.h"
#include "BKE_object.h"
#include "BLI_math.h"
#include "workbench_engine.h"
#include "workbench_private.h"

Go to the source code of this file.

Functions

static void compute_parallel_lines_nor_and_dist (const float v1[2], const float v2[2], const float v3[2], float r_line[4])
 
static void workbench_shadow_update (WORKBENCH_PrivateData *wpd)
 
void workbench_shadow_data_update (WORKBENCH_PrivateData *wpd, WORKBENCH_UBO_World *wd)
 
void workbench_shadow_cache_init (WORKBENCH_Data *data)
 
static const BoundBoxworkbench_shadow_object_shadow_bbox_get (WORKBENCH_PrivateData *wpd, Object *ob, WORKBENCH_ObjectData *oed)
 
static bool workbench_shadow_object_cast_visible_shadow (WORKBENCH_PrivateData *wpd, Object *ob, WORKBENCH_ObjectData *oed)
 
static float workbench_shadow_object_shadow_distance (WORKBENCH_PrivateData *wpd, Object *ob, WORKBENCH_ObjectData *oed)
 
static bool workbench_shadow_camera_in_object_shadow (WORKBENCH_PrivateData *wpd, Object *ob, WORKBENCH_ObjectData *oed)
 
static void workbench_init_object_data (DrawData *dd)
 
void workbench_shadow_cache_populate (WORKBENCH_Data *data, Object *ob, const bool has_transp_mat)
 

Detailed Description

Shadow:

Use stencil shadow buffer to cast a sharp shadow over opaque surfaces.

After the main pre-pass we render shadow volumes using custom depth & stencil states to set the stencil of shadowed area to anything but 0.

Then the shading pass will shade the areas with stencil not equal 0 differently.

Definition in file workbench_shadow.c.

Function Documentation

◆ compute_parallel_lines_nor_and_dist()

static void compute_parallel_lines_nor_and_dist ( const float  v1[2],
const float  v2[2],
const float  v3[2],
float  r_line[4] 
)
static

Definition at line 26 of file workbench_shadow.c.

References dot_v2v2(), sub_v2_v2v2(), SWAP, v1, and v2.

Referenced by workbench_shadow_update().

◆ workbench_init_object_data()

static void workbench_init_object_data ( DrawData dd)
static

Definition at line 286 of file workbench_shadow.c.

References data.

Referenced by workbench_shadow_cache_populate().

◆ workbench_shadow_cache_init()

void workbench_shadow_cache_init ( WORKBENCH_Data data)

◆ workbench_shadow_cache_populate()

void workbench_shadow_cache_populate ( WORKBENCH_Data data,
Object ob,
const bool  has_transp_mat 
)

◆ workbench_shadow_camera_in_object_shadow()

static bool workbench_shadow_camera_in_object_shadow ( WORKBENCH_PrivateData wpd,
Object ob,
WORKBENCH_ObjectData oed 
)
static

◆ workbench_shadow_data_update()

void workbench_shadow_data_update ( WORKBENCH_PrivateData wpd,
WORKBENCH_UBO_World wd 
)

◆ workbench_shadow_object_cast_visible_shadow()

static bool workbench_shadow_object_cast_visible_shadow ( WORKBENCH_PrivateData wpd,
Object ob,
WORKBENCH_ObjectData oed 
)
static

◆ workbench_shadow_object_shadow_bbox_get()

static const BoundBox* workbench_shadow_object_shadow_bbox_get ( WORKBENCH_PrivateData wpd,
Object ob,
WORKBENCH_ObjectData oed 
)
static

◆ workbench_shadow_object_shadow_distance()

static float workbench_shadow_object_shadow_distance ( WORKBENCH_PrivateData wpd,
Object ob,
WORKBENCH_ObjectData oed 
)
static

◆ workbench_shadow_update()

static void workbench_shadow_update ( WORKBENCH_PrivateData wpd)
static