Blender V2.61 - r43446
|
#include <math.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_group_types.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
#include "BKE_global.h"
#include "BKE_scene.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_jitter.h"
#include "BLI_memarena.h"
#include "BLI_rand.h"
#include "BLI_utildefines.h"
#include "PIL_time.h"
#include "renderpipeline.h"
#include "render_types.h"
#include "renderdatabase.h"
#include "rendercore.h"
#include "shadbuf.h"
#include "shading.h"
#include "zbuf.h"
Go to the source code of this file.
Classes | |
struct | Boxf |
struct | ISBBranch |
struct | BSPFace |
Defines | |
#define | RCOMP 0 |
#define | GCOMP 1 |
#define | BCOMP 2 |
#define | ACOMP 3 |
#define | BSPMAX_SAMPLE 128 |
#define | BSPMAX_DEPTH 32 |
Typedefs | |
typedef struct Boxf | Boxf |
typedef struct ISBBranch | ISBBranch |
typedef struct BSPFace | BSPFace |
Functions | |
static void | copy_to_ztile (int *rectz, int size, int x1, int y1, int tile, char *r1) |
static float * | give_jitter_tab (int samp) |
static void | make_jitter_weight_tab (Render *re, ShadBuf *shb, short filtertype) |
static int | verg_deepsample (const void *poin1, const void *poin2) |
static int | compress_deepsamples (DeepSample *dsample, int tot, float epsilon) |
static float | deep_alpha (Render *re, int obinr, int facenr, int strand) |
static void | compress_deepshadowbuf (Render *re, ShadBuf *shb, APixstr *apixbuf, APixstrand *apixbufstrand) |
static void | compress_shadowbuf (ShadBuf *shb, int *rectz, int square) |
static void | shadowbuf_autoclip (Render *re, LampRen *lar) |
static void | makeflatshadowbuf (Render *re, LampRen *lar, float *jitbuf) |
static void | makedeepshadowbuf (Render *re, LampRen *lar, float *jitbuf) |
void | makeshadowbuf (Render *re, LampRen *lar) |
static void * | do_shadow_thread (void *re_v) |
static int | thread_break (void *UNUSED(arg)) |
void | threaded_makeshadowbufs (Render *re) |
void | freeshadowbuf (LampRen *lar) |
static int | firstreadshadbuf (ShadBuf *shb, ShadSampleBuf *shsample, int **rz, int xs, int ys, int nr) |
static float | readdeepvisibility (DeepSample *dsample, int tot, int z, int bias, float *biast) |
static float | readdeepshadowbuf (ShadBuf *shb, ShadSampleBuf *shsample, int bias, int xs, int ys, int zs) |
static float | readshadowbuf (ShadBuf *shb, ShadSampleBuf *shsample, int bias, int xs, int ys, int zs) |
static void | shadowbuf_project_co (float *x, float *y, float *z, ShadBuf *shb, const float co[3]) |
float | testshadowbuf (Render *re, ShadBuf *shb, const float co[3], const float dxco[3], const float dyco[3], float inp, float mat_bias) |
static float | readshadowbuf_halo (ShadBuf *shb, ShadSampleBuf *shsample, int xs, int ys, int zs) |
float | shadow_halo (LampRen *lar, const float p1[3], const float p2[3]) |
static void | init_box (Boxf *box) |
static void | bound_boxf (Boxf *box, const float v1[3]) |
static void | bound_rectf (rctf *box, const float v1[2]) |
static void | isb_bsp_split_init (ISBBranch *root, MemArena *mem, int level) |
static void | isb_bsp_split (ISBBranch *root, MemArena *mem) |
static int | isb_bsp_insert (ISBBranch *root, MemArena *memarena, ISBSample *sample) |
static void | bspface_init_strand (BSPFace *face) |
static int | point_behind_strand (const float p[3], BSPFace *face) |
static int | point_behind_tria2d (const float p[3], const float v1[3], const float v2[3], const float v3[3]) |
static void | isb_bsp_face_inside (ISBBranch *bspn, BSPFace *face) |
static void | isb_bsp_recalc_box (ISBBranch *root) |
static void | isb_bsp_test_strand (ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2, float *v3, float *v4) |
static void | isb_bsp_test_face (ZSpan *zspan, int obi, int zvlnr, float *v1, float *v2, float *v3, float *v4) |
static int | testclip_minmax (const float ho[4], const float minmax[4]) |
static void | isb_bsp_fillfaces (Render *re, LampRen *lar, ISBBranch *root) |
static int | viewpixel_to_lampbuf (ShadBuf *shb, ObjectInstanceRen *obi, VlakRen *vlr, float x, float y, float co_r[3]) |
static void | isb_add_shadfac (ISBShadfacA **isbsapp, MemArena *mem, int obi, int facenr, short shadfac, short samples) |
static int | isb_add_samples (RenderPart *pa, ISBBranch *root, MemArena *memarena, ISBSample **samplebuf) |
static void | isb_make_buffer (RenderPart *pa, LampRen *lar) |
static ISBSampleA * | isb_alloc_sample_transp (ISBSampleA **isbsa, MemArena *mem) |
static int | isb_add_samples_transp (RenderPart *pa, ISBBranch *root, MemArena *memarena, ISBSampleA ***samplebuf) |
static void | isb_make_buffer_transp (RenderPart *pa, APixstr *apixbuf, LampRen *lar) |
float | ISB_getshadow (ShadeInput *shi, ShadBuf *shb) |
void | ISB_create (RenderPart *pa, APixstr *apixbuf) |
void | ISB_free (RenderPart *pa) |
Variables | |
struct Render | R |
static volatile int | g_break = 0 |
Definition in file shadbuf.c.
#define ACOMP 3 |
Definition at line 73 of file shadbuf.c.
Referenced by compress_shadowbuf(), readshadowbuf(), and readshadowbuf_halo().
#define BCOMP 2 |
Definition at line 72 of file shadbuf.c.
Referenced by compress_shadowbuf(), readshadowbuf(), and readshadowbuf_halo().
#define BSPMAX_DEPTH 32 |
Definition at line 1430 of file shadbuf.c.
Referenced by isb_bsp_insert().
#define BSPMAX_SAMPLE 128 |
Definition at line 1429 of file shadbuf.c.
Referenced by isb_bsp_insert(), isb_bsp_split(), and isb_bsp_split_init().
#define GCOMP 1 |
Definition at line 71 of file shadbuf.c.
Referenced by compress_shadowbuf(), readshadowbuf(), and readshadowbuf_halo().
static void bound_boxf | ( | Boxf * | box, |
const float | v1[3] | ||
) | [static] |
Definition at line 1472 of file shadbuf.c.
References Boxf::xmax, Boxf::xmin, Boxf::ymax, Boxf::ymin, Boxf::zmax, and Boxf::zmin.
Referenced by isb_bsp_recalc_box(), isb_bsp_test_face(), and isb_bsp_test_strand().
static void bound_rectf | ( | rctf * | box, |
const float | v1[2] | ||
) | [static] |
Definition at line 1483 of file shadbuf.c.
References rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by isb_make_buffer(), and isb_make_buffer_transp().
static void bspface_init_strand | ( | BSPFace * | face | ) | [static] |
Definition at line 1643 of file shadbuf.c.
References copy_v3_v3(), BSPFace::len, len_v2v2(), mid_v3_v3v3(), BSPFace::radline, BSPFace::radline_end, BSPFace::rc, sqrt(), BSPFace::v1, BSPFace::v2, BSPFace::v3, BSPFace::v4, BSPFace::vec1, and BSPFace::vec2.
Referenced by isb_bsp_test_strand().
static int compress_deepsamples | ( | DeepSample * | dsample, |
int | tot, | ||
float | epsilon | ||
) | [static] |
Definition at line 185 of file shadbuf.c.
References div, KDL::epsilon, fabs(), max, MAX2, min, MIN2, DeepSample::v, and DeepSample::z.
Referenced by compress_deepshadowbuf().
static void compress_deepshadowbuf | ( | Render * | re, |
ShadBuf * | shb, | ||
APixstr * | apixbuf, | ||
APixstrand * | apixbufstrand | ||
) | [static] |
Definition at line 303 of file shadbuf.c.
References BLI_addtail(), ShadBuf::buffers, compress_deepsamples(), ShadBuf::compressthresh, deep_alpha(), ShadSampleBuf::deepbuf, APixstrand::mask, APixstr::mask, MEM_callocN(), MEM_freeN(), MEM_mallocN(), APixstrand::next, APixstr::next, NULL, APixstrand::obi, APixstr::obi, APixstrand::p, APixstr::p, RE_MAX_OSA, ShadBuf::size, size(), ShadSampleBuf::totbuf, ShadBuf::totbuf, DeepSample::v, verg_deepsample(), APixstrand::z, APixstr::z, and DeepSample::z.
Referenced by makedeepshadowbuf().
static void compress_shadowbuf | ( | ShadBuf * | shb, |
int * | rectz, | ||
int | square | ||
) | [static] |
Definition at line 502 of file shadbuf.c.
References ACOMP, BCOMP, BLI_addtail(), ShadBuf::buffers, ShadSampleBuf::cbuf, copy_to_ztile(), GCOMP, MEM_callocN(), MEM_freeN(), MEM_mallocN(), ShadBuf::size, size(), sqrt(), and ShadSampleBuf::zbuf.
Referenced by makeflatshadowbuf().
static void copy_to_ztile | ( | int * | rectz, |
int | size, | ||
int | x1, | ||
int | y1, | ||
int | tile, | ||
char * | r1 | ||
) | [static] |
static float deep_alpha | ( | Render * | re, |
int | obinr, | ||
int | facenr, | ||
int | strand | ||
) | [static] |
Definition at line 286 of file shadbuf.c.
References StrandRen::buffer, StrandBuffer::ma, VlakRen::mat, Render::objectinstance, ObjectInstanceRen::obr, RE_findOrAddStrand(), RE_findOrAddVlak(), RE_QUAD_MASK, and Material::shad_alpha.
Referenced by compress_deepshadowbuf().
static void* do_shadow_thread | ( | void * | re_v | ) | [static] |
Definition at line 807 of file shadbuf.c.
References BLI_lock_thread(), BLI_unlock_thread(), ListBase::first, Render::lampren, LOCK_CUSTOM1, makeshadowbuf(), LampRen::next, NULL, LampRen::shb, Render::tbh, Render::test_break, LampRen::thread_assigned, and LampRen::thread_ready.
Referenced by threaded_makeshadowbufs().
static int firstreadshadbuf | ( | ShadBuf * | shb, |
ShadSampleBuf * | shsample, | ||
int ** | rz, | ||
int | xs, | ||
int | ys, | ||
int | nr | ||
) | [static] |
Definition at line 943 of file shadbuf.c.
References ShadSampleBuf::cbuf, ShadSampleBuf::deepbuf, ShadBuf::size, and ShadSampleBuf::zbuf.
Referenced by testshadowbuf().
void freeshadowbuf | ( | LampRen * | lar | ) |
Definition at line 904 of file shadbuf.c.
References BLI_freelistN(), ShadBuf::buffers, ShadSampleBuf::cbuf, ShadSampleBuf::deepbuf, ListBase::first, MEM_freeN(), ShadSampleBuf::next, NULL, LampRen::shb, ShadBuf::size, ShadSampleBuf::totbuf, ShadBuf::weight, and ShadSampleBuf::zbuf.
Referenced by RE_Database_Free().
static float* give_jitter_tab | ( | int | samp | ) | [static] |
Definition at line 125 of file shadbuf.c.
References BLI_initjit(), and jit.
Referenced by makeshadowbuf().
static void init_box | ( | Boxf * | box | ) | [static] |
Definition at line 1461 of file shadbuf.c.
References Boxf::xmax, Boxf::xmin, Boxf::ymax, Boxf::ymin, Boxf::zmax, and Boxf::zmin.
Referenced by isb_bsp_recalc_box(), isb_bsp_test_face(), and isb_bsp_test_strand().
static int isb_add_samples | ( | RenderPart * | pa, |
ISBBranch * | root, | ||
MemArena * | memarena, | ||
ISBSample ** | samplebuf | ||
) | [static] |
Definition at line 2154 of file shadbuf.c.
References BLI_array_randomize(), isb_bsp_insert(), MEM_freeN(), MEM_mallocN(), R, RenderPart::rectx, and RenderPart::recty.
Referenced by isb_make_buffer().
static int isb_add_samples_transp | ( | RenderPart * | pa, |
ISBBranch * | root, | ||
MemArena * | memarena, | ||
ISBSampleA *** | samplebuf | ||
) | [static] |
Definition at line 2358 of file shadbuf.c.
References BLI_array_randomize(), isb_bsp_insert(), MEM_freeN(), MEM_mallocN(), R, RenderPart::rectx, and RenderPart::recty.
Referenced by isb_make_buffer_transp().
static void isb_add_shadfac | ( | ISBShadfacA ** | isbsapp, |
MemArena * | mem, | ||
int | obi, | ||
int | facenr, | ||
short | shadfac, | ||
short | samples | ||
) | [static] |
Definition at line 2130 of file shadbuf.c.
References BLI_memarena_alloc(), NULL, R, and RE_QUAD_OFFS.
Referenced by isb_make_buffer(), and isb_make_buffer_transp().
static ISBSampleA* isb_alloc_sample_transp | ( | ISBSampleA ** | isbsa, |
MemArena * | mem | ||
) | [static] |
Definition at line 2343 of file shadbuf.c.
References BLI_memarena_alloc(), and NULL.
Referenced by isb_make_buffer_transp().
Definition at line 1781 of file shadbuf.c.
References BLI_in_rctf(), BLI_isect_rctf(), ISBBranch::box, BSPFace::box, ISBBranch::divider, BSPFace::facenr, ISBSample::facenr, ISBBranch::full, ISBBranch::index, BSPFace::is_full, ISBBranch::left, NULL, BSPFace::obi, ISBSample::obi, point_behind_strand(), point_behind_tria2d(), ISBBranch::right, ISBBranch::samples, BSPFace::shad_alpha, ISBSample::shadfac, ISBBranch::totsamp, BSPFace::type, BSPFace::v1, BSPFace::v2, BSPFace::v3, BSPFace::v4, Boxf::xmax, Boxf::xmin, Boxf::ymax, Boxf::ymin, ISBSample::zco, Boxf::zmax, and Boxf::zmin.
Referenced by isb_bsp_test_face(), and isb_bsp_test_strand().
Definition at line 1946 of file shadbuf.c.
References ISBBranch::box, Render::clipcrop, VertRen::co, copy_m4_m4(), VlakRen::ec, ListBase::first, VlakRen::flag, ObjectInstanceRen::flag, i, Render::instancetable, isb_bsp_recalc_box(), isb_bsp_test_face(), isb_bsp_test_strand(), LA_LAYER, LA_LAYER_SHADOW, ObjectInstanceRen::lay, LampRen::lay, MA_SHADBUF, MA_TYPE_WIRE, VlakRen::mat, ObjectInstanceRen::mat, Material::material_type, Material::mode, LampRen::mode, mult_m4_m4m4(), ObjectInstanceRen::next, NULL, ObjectInstanceRen::obr, ShadBuf::persmat, projectvert(), R_STRAND, R_TRANSFORMED, ZSpan::rectz, Material::shad_alpha, ZSpan::shad_alpha, LampRen::shb, ShadBuf::size, size(), testclip(), testclip_minmax(), ObjectRen::totvlak, VlakRen::v1, VlakRen::v2, VlakRen::v3, VlakRen::v4, VlakTableNode::vlak, ObjectRen::vlaknodes, Boxf::xmax, Boxf::xmin, Boxf::ymax, Boxf::ymin, zbuf_alloc_span(), zbuf_free_span(), zbufclip(), zbufclip4(), zbufclipwire(), ZSpan::zbuffunc, ZSpan::zmulx, ZSpan::zmuly, ZSpan::zofsx, and ZSpan::zofsy.
Referenced by isb_make_buffer(), and isb_make_buffer_transp().
Definition at line 1603 of file shadbuf.c.
References BSPMAX_DEPTH, BSPMAX_SAMPLE, ISBBranch::divider, i, ISBBranch::index, isb_bsp_split(), ISBBranch::left, ISBBranch::right, MakeCursor::root, ISBBranch::samples, ISBBranch::totsamp, and ISBSample::zco.
Referenced by isb_add_samples(), and isb_add_samples_transp().
static void isb_bsp_recalc_box | ( | ISBBranch * | root | ) | [static] |
Definition at line 1852 of file shadbuf.c.
References bound_boxf(), ISBBranch::box, init_box(), ISBBranch::left, ISBBranch::right, ISBBranch::samples, ISBBranch::totsamp, and ISBSample::zco.
Referenced by isb_bsp_fillfaces().
Definition at line 1535 of file shadbuf.c.
References BLI_memarena_alloc(), ISBBranch::box, BSPMAX_SAMPLE, ISBBranch::divider, i, ISBBranch::index, ISBBranch::left, left(), NULL, ISBBranch::right, ISBBranch::samples, ISBBranch::totsamp, Boxf::xmax, Boxf::xmin, Boxf::ymax, Boxf::ymin, and ISBSample::zco.
Referenced by isb_bsp_insert().
Definition at line 1493 of file shadbuf.c.
References BLI_memarena_alloc(), ISBBranch::box, BSPMAX_SAMPLE, ISBBranch::divider, i, ISBBranch::index, ISBBranch::left, left(), ISBBranch::right, ISBBranch::samples, Boxf::xmax, Boxf::xmin, Boxf::ymax, and Boxf::ymin.
Referenced by isb_make_buffer(), and isb_make_buffer_transp().
static void isb_bsp_test_face | ( | ZSpan * | zspan, |
int | obi, | ||
int | zvlnr, | ||
float * | v1, | ||
float * | v2, | ||
float * | v3, | ||
float * | v4 | ||
) | [static] |
Definition at line 1902 of file shadbuf.c.
References bound_boxf(), BSPFace::box, BSPFace::facenr, init_box(), BSPFace::is_full, isb_bsp_face_inside(), BSPFace::obi, R, RE_QUAD_OFFS, ZSpan::rectz, BSPFace::shad_alpha, ZSpan::shad_alpha, BSPFace::type, BSPFace::v1, BSPFace::v2, BSPFace::v3, and BSPFace::v4.
Referenced by isb_bsp_fillfaces().
static void isb_bsp_test_strand | ( | ZSpan * | zspan, |
int | obi, | ||
int | zvlnr, | ||
float * | v1, | ||
float * | v2, | ||
float * | v3, | ||
float * | v4 | ||
) | [static] |
Definition at line 1868 of file shadbuf.c.
References bound_boxf(), BSPFace::box, bspface_init_strand(), BSPFace::facenr, init_box(), BSPFace::is_full, isb_bsp_face_inside(), BSPFace::obi, R, R_STRAND, RE_QUAD_OFFS, ZSpan::rectz, BSPFace::shad_alpha, ZSpan::shad_alpha, BSPFace::type, BSPFace::v1, BSPFace::v2, BSPFace::v3, and BSPFace::v4.
Referenced by isb_bsp_fillfaces().
void ISB_create | ( | RenderPart * | pa, |
APixstr * | apixbuf | ||
) |
Definition at line 2587 of file shadbuf.c.
References LampRen::buftype, isb_make_buffer(), isb_make_buffer_transp(), ShadBuf::isb_result, LA_SHADBUF_IRREGULAR, LA_SPOT, GroupObject::lampren, MEM_callocN(), GroupObject::next, R, LampRen::shb, RenderPart::thread, and LampRen::type.
Referenced by shadeDA_tile(), zbuffer_transp_shade(), zbufshade_sss_tile(), and zbufshade_tile().
void ISB_free | ( | RenderPart * | pa | ) |
Definition at line 2610 of file shadbuf.c.
References BLI_memarena_free(), LampRen::buftype, ShadBuf::isb_result, LA_SHADBUF_IRREGULAR, LA_SPOT, GroupObject::lampren, MEM_freeN(), ISBData::memarena, GroupObject::next, NULL, R, ISBData::shadfaca, ISBData::shadfacs, LampRen::shb, RenderPart::thread, and LampRen::type.
Referenced by shadeDA_tile(), zbuffer_transp_shade(), zbufshade_sss_tile(), and zbufshade_tile().
float ISB_getshadow | ( | ShadeInput * | shi, |
ShadBuf * | shb | ||
) |
Definition at line 2549 of file shadbuf.c.
References ShadeInput::depth, ShadeInput::facenr, ISBShadfacA::facenr, ShadBuf::isb_result, ISBData::minx, ISBData::miny, ISBShadfacA::next, ISBShadfacA::obi, ShadeInput::obi, R, ISBData::rectx, ISBShadfacA::shadfac, ISBData::shadfaca, ISBData::shadfacs, ShadeInput::thread, ShadeInput::xs, and ShadeInput::ys.
Referenced by lamp_get_shadow().
static void isb_make_buffer | ( | RenderPart * | pa, |
LampRen * | lar | ||
) | [static] |
Definition at line 2192 of file shadbuf.c.
References BLI_memarena_free(), BLI_memarena_new(), BLI_memarena_use_calloc(), bound_rectf(), ISBBranch::box, count_mask(), RenderPart::disprect, ISBSample::facenr, PixStr::facenr, isb_add_samples(), isb_add_shadfac(), isb_bsp_fillfaces(), isb_bsp_split_init(), ShadBuf::isb_result, PixStr::mask, MEM_callocN(), MEM_freeN(), ISBData::memarena, ISBData::minx, ISBData::miny, PixStr::next, NULL, ISBSample::obi, PixStr::obi, ObjectInstanceRen::obr, R, RE_findOrAddVlak(), RE_QUAD_MASK, RE_QUAD_OFFS, RenderPart::rectdaps, RenderPart::recto, RenderPart::rectp, RenderPart::rectx, ISBData::rectx, RenderPart::recty, ISBData::recty, MakeCursor::root, ISBSample::shadfac, PixStr::shadfac, ISBData::shadfaca, ISBData::shadfacs, LampRen::shb, ShadBuf::size, RenderPart::thread, viewpixel_to_lampbuf(), Boxf::xmin, rcti::xmin, Boxf::ymin, rcti::ymin, and ISBSample::zco.
Referenced by ISB_create().
static void isb_make_buffer_transp | ( | RenderPart * | pa, |
APixstr * | apixbuf, | ||
LampRen * | lar | ||
) | [static] |
Definition at line 2400 of file shadbuf.c.
References BLI_memarena_free(), BLI_memarena_new(), BLI_memarena_use_calloc(), bound_rectf(), ISBBranch::box, copy_v3_v3(), count_mask(), RenderPart::disprect, ISBSampleA::facenr, isb_add_samples_transp(), isb_add_shadfac(), isb_alloc_sample_transp(), isb_bsp_fillfaces(), isb_bsp_split_init(), ShadBuf::isb_result, APixstr::mask, MEM_callocN(), MEM_freeN(), ISBData::memarena, ISBData::minx, ISBData::miny, APixstr::next, ISBSampleA::obi, APixstr::obi, ObjectInstanceRen::obr, APixstr::p, R, RE_findOrAddVlak(), RE_QUAD_MASK, RE_QUAD_OFFS, RenderPart::rectx, ISBData::rectx, RenderPart::recty, ISBData::recty, MakeCursor::root, ISBSampleA::shadfac, APixstr::shadfac, ISBData::shadfaca, LampRen::shb, ShadBuf::size, RenderPart::thread, viewpixel_to_lampbuf(), Boxf::xmin, rcti::xmin, Boxf::ymin, rcti::ymin, and ISBSampleA::zco.
Referenced by ISB_create().
Definition at line 150 of file shadbuf.c.
References get_render_shadow_samples(), ShadBuf::jit, jit, LA_SHADBUF_GAUSS, LA_SHADBUF_TENT, MEM_mallocN(), Render::r, R_FILTER_GAUSS, RE_filter_value(), ShadBuf::samp, sqrt(), and ShadBuf::weight.
Referenced by makeshadowbuf().
Definition at line 735 of file shadbuf.c.
References compress_deepshadowbuf(), freepsA(), MEM_callocN(), MEM_freeN(), NULL, ShadBuf::persmat, LampRen::shb, ShadBuf::size, ShadBuf::totbuf, Render::totstrand, and zbuffer_abuf_shadow().
Referenced by makeshadowbuf().
Definition at line 715 of file shadbuf.c.
References compress_shadowbuf(), LA_SQUARE, MEM_freeN(), MEM_mapallocN(), LampRen::mode, ShadBuf::persmat, Render::samples, LampRen::shb, ShadBuf::size, Render::tbh, Render::test_break, ShadBuf::totbuf, and zbuffer_shadow().
Referenced by makeshadowbuf().
Calculates shadowbuffers for a vector of shadow-giving lamps
lar | The vector of lamps |
Definition at line 759 of file shadbuf.c.
References angle(), BLI_lock_thread(), BLI_unlock_thread(), LampRen::buffers, LampRen::bufflag, LampRen::buftype, ShadBuf::clipend, cos(), ShadBuf::d, ELEM3, LampRen::filtertype, get_render_shadow_samples(), give_jitter_tab(), ShadBuf::jit, LA_SHADBUF_AUTO_END, LA_SHADBUF_AUTO_START, LA_SHADBUF_DEEP, LA_SHADBUF_HALFWAY, LA_SHADBUF_IRREGULAR, LA_SHADBUF_REGULAR, LOCK_CUSTOM1, make_jitter_weight_tab(), makedeepshadowbuf(), makeflatshadowbuf(), mult_m4_m4m4(), ShadBuf::persmat, perspective_m4(), ShadBuf::pixsize, Render::r, saacos(), ShadBuf::samp, shadowbuf_autoclip(), LampRen::shb, sin(), ShadBuf::size, LampRen::spotsi, ShadBuf::totbuf, ShadBuf::viewmat, and ShadBuf::winmat.
Referenced by do_shadow_thread(), and threaded_makeshadowbufs().
static int point_behind_strand | ( | const float | p[3], |
BSPFace * | face | ||
) | [static] |
Definition at line 1667 of file shadbuf.c.
References BSPFace::len, BSPFace::radline_end, BSPFace::rc, sqrt(), and BSPFace::vec1.
Referenced by isb_bsp_face_inside().
static int point_behind_tria2d | ( | const float | p[3], |
const float | v1[3], | ||
const float | v2[3], | ||
const float | v3[3] | ||
) | [static] |
static float readdeepshadowbuf | ( | ShadBuf * | shb, |
ShadSampleBuf * | shsample, | ||
int | bias, | ||
int | xs, | ||
int | ys, | ||
int | zs | ||
) | [static] |
Definition at line 1007 of file shadbuf.c.
References ShadSampleBuf::deepbuf, readdeepvisibility(), ShadBuf::size, and ShadSampleBuf::totbuf.
Referenced by readshadowbuf().
static float readdeepvisibility | ( | DeepSample * | dsample, |
int | tot, | ||
int | z, | ||
int | bias, | ||
float * | biast | ||
) | [static] |
Definition at line 972 of file shadbuf.c.
References DeepSample::v, and DeepSample::z.
Referenced by readdeepshadowbuf().
static float readshadowbuf | ( | ShadBuf * | shb, |
ShadSampleBuf * | shsample, | ||
int | bias, | ||
int | xs, | ||
int | ys, | ||
int | zs | ||
) | [static] |
Definition at line 1035 of file shadbuf.c.
References ACOMP, BCOMP, ShadSampleBuf::cbuf, ShadSampleBuf::deepbuf, GCOMP, GET_INT_FROM_POINTER, readdeepshadowbuf(), ShadBuf::size, and ShadSampleBuf::zbuf.
Referenced by testshadowbuf().
static float readshadowbuf_halo | ( | ShadBuf * | shb, |
ShadSampleBuf * | shsample, | ||
int | xs, | ||
int | ys, | ||
int | zs | ||
) | [static] |
Definition at line 1222 of file shadbuf.c.
References ACOMP, BCOMP, ShadBuf::bias, ShadSampleBuf::cbuf, GCOMP, GET_INT_FROM_POINTER, ShadBuf::size, and ShadSampleBuf::zbuf.
Referenced by shadow_halo().
float shadow_halo | ( | LampRen * | lar, |
const float | p1[3], | ||
const float | p2[3] | ||
) |
Determines the shadow factor for lamp <lar>, between <p1> and <p2>. (Which CS?)
Definition at line 1294 of file shadbuf.c.
References ShadBuf::buffers, co, ListBase::first, MIN2, mul_m4_v4(), ShadSampleBuf::next, readshadowbuf_halo(), LampRen::sh_zfac, ShadBuf::shadhalostep, LampRen::shb, ShadBuf::size, ShadBuf::totbuf, and ShadBuf::winmat.
Referenced by spothalo().
Definition at line 615 of file shadbuf.c.
References ShadBuf::bias, LampRen::bufflag, LampRen::clipend, ShadBuf::clipend, LampRen::clipsta, VertRen::co, copy_m4_m4(), copy_v3_v3(), ShadBuf::d, ListBase::first, ObjectInstanceRen::flag, i, VertRen::index, Render::instancetable, LA_LAYER, LA_LAYER_SHADOW, LA_SHADBUF_AUTO_END, LA_SHADBUF_AUTO_START, ObjectInstanceRen::lay, LampRen::lay, Render::lay, MA_SHADBUF, VlakRen::mat, ObjectInstanceRen::mat, MAX2, MEM_callocN(), MEM_freeN(), Material::mode, LampRen::mode, mul_m4_v3(), mult_m4_m4m4(), ObjectInstanceRen::next, ObjectRen::next, normalize_v3(), NULL, Render::objecttable, ObjectInstanceRen::obr, Render::ok, R_TRANSFORMED, RE_findOrAddVert(), LampRen::shb, LampRen::spotsi, ObjectRen::totvert, ObjectRen::totvlak, VlakRen::v1, VlakRen::v2, VlakRen::v3, VlakRen::v4, ShadBuf::viewmat, Render::viewmat, VlakTableNode::vlak, and ObjectRen::vlaknodes.
Referenced by makeshadowbuf().
static void shadowbuf_project_co | ( | float * | x, |
float * | y, | ||
float * | z, | ||
ShadBuf * | shb, | ||
const float | co[3] | ||
) | [static] |
Definition at line 1102 of file shadbuf.c.
References copy_v3_v3(), mul_m4_v4(), ShadBuf::persmat, ShadBuf::size, and size().
Referenced by testshadowbuf().
static int testclip_minmax | ( | const float | ho[4], |
const float | minmax[4] | ||
) | [static] |
Definition at line 1931 of file shadbuf.c.
Referenced by isb_bsp_fillfaces().
float testshadowbuf | ( | struct Render * | re, |
struct ShadBuf * | shb, | ||
const float | rco[3], | ||
const float | dxco[3], | ||
const float | dyco[3], | ||
float | inp, | ||
float | mat_bias | ||
) |
Determines the shadow factor for a face and lamp. There is some communication with global variables here.
shb | The shadowbuffer to find the shadow factor in. |
inp | The inproduct between viewvector and ? |
Definition at line 1118 of file shadbuf.c.
References add_v3_v3v3(), ShadBuf::bias, ShadBuf::buffers, fabs(), ListBase::first, firstreadshadbuf(), get_render_shadow_samples(), ShadBuf::jit, jit, ShadSampleBuf::next, NULL, Render::r, readshadowbuf(), ShadBuf::samp, shadowbuf_project_co(), ShadBuf::soft, ShadBuf::totbuf, and ShadBuf::weight.
Referenced by lamp_get_shadow(), render_lighting_halo(), and vol_get_shadow().
static int thread_break | ( | void * | UNUSEDarg | ) | [static] |
Definition at line 835 of file shadbuf.c.
References g_break.
Referenced by threaded_makeshadowbufs().
void threaded_makeshadowbufs | ( | Render * | re | ) |
Definition at line 840 of file shadbuf.c.
References BLI_end_threads(), BLI_init_threads(), BLI_insert_thread(), BLI_lock_thread(), BLI_unlock_thread(), do_shadow_thread(), ListBase::first, G, Render::lampren, LOCK_CUSTOM1, makeshadowbuf(), MIN2, LampRen::next, PIL_sleep_ms(), Render::r, LampRen::shb, Render::tbh, Render::test_break, test_break(), LampRen::thread_assigned, thread_break(), LampRen::thread_ready, RenderData::threads, and threads.
Referenced by RE_Database_Baking(), and RE_Database_FromScene().
static int verg_deepsample | ( | const void * | poin1, |
const void * | poin2 | ||
) | [static] |
Definition at line 175 of file shadbuf.c.
References DeepSample::z.
Referenced by compress_deepshadowbuf().
static int viewpixel_to_lampbuf | ( | ShadBuf * | shb, |
ObjectInstanceRen * | obi, | ||
VlakRen * | vlr, | ||
float | x, | ||
float | y, | ||
float | co_r[3] | ||
) | [static] |
Definition at line 2060 of file shadbuf.c.
References ShadBuf::bias, calc_view_vector(), VertRen::co, copy_v3_v3(), div, fabs(), ObjectInstanceRen::flag, ObjectInstanceRen::mat, mul_m4_v3(), mul_m4_v4(), ShadBuf::persmat, R, R_ORTHO, R_TRANSFORMED, RE_vlakren_get_normal(), ShadBuf::size, and VlakRen::v1.
Referenced by isb_make_buffer(), and isb_make_buffer_transp().
volatile int g_break = 0 [static] |
Definition at line 834 of file shadbuf.c.
Referenced by thread_break().
Definition at line 127 of file pipeline.c.