|
Blender
V2.59
|
#include <math.h>#include <stdlib.h>#include <string.h>#include <float.h>#include "MEM_guardedalloc.h"#include "BLI_blenlib.h"#include "BLI_math.h"#include "BLI_threads.h"#include "BLI_voxel.h"#include "BLI_utildefines.h"#include "PIL_time.h"#include "RE_shader_ext.h"#include "DNA_material_types.h"#include "rayintersection.h"#include "rayobject.h"#include "render_types.h"#include "rendercore.h"#include "renderdatabase.h"#include "volumetric.h"#include "volume_precache.h"#include "BKE_global.h"Go to the source code of this file.
Functions | |
| static int | intersect_outside_volume (RayObject *tree, Isect *isect, float *offset, int limit, int depth) |
| static int | point_inside_obi (RayObject *tree, ObjectInstanceRen *UNUSED(obi), float *co) |
| void | global_bounds_obi (Render *re, ObjectInstanceRen *obi, float *bbmin, float *bbmax) |
| static float | get_avg_surrounds (float *cache, int *res, int xx, int yy, int zz) |
| static void | lightcache_filter (VolumePrecache *vp) |
| static int | ms_I (int x, int y, int z, int *n) |
| static int | v_I_pad (int x, int y, int z, int *n) |
| static int | lc_to_ms_I (int x, int y, int z, int *n) |
| static float | total_ss_energy (VolumePrecache *vp) |
| static float | total_ms_energy (float *sr, float *sg, float *sb, int *res) |
| static void | ms_diffuse (float *x0, float *x, float diff, int *n) |
| static void | multiple_scattering_diffusion (Render *re, VolumePrecache *vp, Material *ma) |
| static void * | vol_precache_part (void *data) |
| static void | precache_setup_shadeinput (Render *re, ObjectInstanceRen *obi, Material *ma, ShadeInput *shi) |
| static void | precache_init_parts (Render *re, RayObject *tree, ShadeInput *shi, ObjectInstanceRen *obi, int totthread, int *parts) |
| static VolPrecachePart * | precache_get_new_part (Render *re) |
| static int | precache_resolution (Render *re, VolumePrecache *vp, ObjectInstanceRen *obi, int res) |
| static void | vol_precache_objectinstance_threads (Render *re, ObjectInstanceRen *obi, Material *ma) |
| static int | using_lightcache (Material *ma) |
| void | volume_precache (Render *re) |
| void | free_volume_precache (Render *re) |
| int | point_inside_volume_objectinstance (Render *re, ObjectInstanceRen *obi, float *co) |
Variables | |
| struct Render | R |
Definition in file volume_precache.c.
| void free_volume_precache | ( | Render * | re | ) |
Definition at line 805 of file volume_precache.c.
References VolumePrecache::bbmax, VolumePrecache::bbmin, BLI_freelistN(), VolumePrecache::data_b, VolumePrecache::data_g, VolumePrecache::data_r, ListBase::first, Render::instancetable, MEM_freeN(), ObjectInstanceRen::next, NULL, ObjectInstanceRen::volume_precache, and Render::volumes.
Referenced by RE_Database_Free().
| static float get_avg_surrounds | ( | float * | cache, |
| int * | res, | ||
| int | xx, | ||
| int | yy, | ||
| int | zz | ||
| ) | [static] |
Definition at line 167 of file volume_precache.c.
Referenced by lightcache_filter().
| void global_bounds_obi | ( | Render * | re, |
| ObjectInstanceRen * | obi, | ||
| float * | bbmin, | ||
| float * | bbmax | ||
| ) |
Definition at line 125 of file volume_precache.c.
References VolumePrecache::bbmax, VolumePrecache::bbmin, VertRen::co, co, copy_v3_v3(), DO_MINMAX, ObjectInstanceRen::flag, INIT_MINMAX, ObjectInstanceRen::mat, MEM_callocN(), mul_m4_v3(), NULL, ObjectInstanceRen::obr, R_TRANSFORMED, ObjectRen::totvert, VertTableNode::vert, ObjectRen::vertnodes, Render::viewinv, and ObjectInstanceRen::volume_precache.
Referenced by precache_init_parts(), precache_resolution(), and vol_get_precached_scattering().
| static int intersect_outside_volume | ( | RayObject * | tree, |
| Isect * | isect, | ||
| float * | offset, | ||
| int | limit, | ||
| int | depth | ||
| ) | [static] |
Definition at line 77 of file volume_precache.c.
References Isect::dir, Isect::dist, Isect::face, FLT_MAX, Isect::hit, Isect::ob, Isect::orig, RE_rayobject_raycast(), RE_SKIP_VLR_NEIGHBOUR, Isect::skip, and Isect::start.
Referenced by point_inside_obi().
| static int lc_to_ms_I | ( | int | x, |
| int | y, | ||
| int | z, | ||
| int * | n | ||
| ) | [inline, static] |
Definition at line 280 of file volume_precache.c.
Referenced by multiple_scattering_diffusion().
| static void lightcache_filter | ( | VolumePrecache * | vp | ) | [static] |
Definition at line 207 of file volume_precache.c.
References VolumePrecache::data_b, VolumePrecache::data_g, VolumePrecache::data_r, get_avg_surrounds(), i, VolumePrecache::res, and V_I.
Referenced by vol_precache_objectinstance_threads().
| static void ms_diffuse | ( | float * | x0, |
| float * | x, | ||
| float | diff, | ||
| int * | n | ||
| ) | [static] |
Definition at line 330 of file volume_precache.c.
References i, v_I_pad(), and VOL_MS_TIMESTEP.
Referenced by multiple_scattering_diffusion().
| static int ms_I | ( | int | x, |
| int | y, | ||
| int | z, | ||
| int * | n | ||
| ) | [inline, static] |
Definition at line 268 of file volume_precache.c.
Referenced by multiple_scattering_diffusion(), and total_ms_energy().
| static void multiple_scattering_diffusion | ( | Render * | re, |
| VolumePrecache * | vp, | ||
| Material * | ma | ||
| ) | [static] |
Definition at line 353 of file volume_precache.c.
References BLI_snprintf(), VolumePrecache::data_b, VolumePrecache::data_g, VolumePrecache::data_r, KDL::diff(), i, Render::i, RenderStats::infostr, lc_to_ms_I(), MA_VOL_SHADE_SHADEDPLUSMULTIPLE, MAX3(), MEM_callocN(), MEM_freeN(), VolumeSettings::ms_diff, ms_diffuse(), ms_I(), VolumeSettings::ms_intensity, VolumeSettings::ms_spread, NULL, PIL_check_seconds_timer(), VolumePrecache::res, Render::sdh, VolumeSettings::shade_type, size(), Render::stats_draw, str, SWAP, Render::tbh, Render::test_break, total_ms_energy(), total_ss_energy(), and Material::vol.
Referenced by vol_precache_objectinstance_threads().
| static int point_inside_obi | ( | RayObject * | tree, |
| ObjectInstanceRen * | UNUSEDobi, | ||
| float * | co | ||
| ) | [static] |
Definition at line 99 of file volume_precache.c.
References Isect::dir, Isect::dist, Isect::face, FLT_MAX, intersect_outside_volume(), Isect::last_hit, Isect::lay, Isect::mode, NULL, Isect::ob, Isect::orig, RE_RAY_MIRROR, Isect::start, and VECCOPY.
Referenced by point_inside_volume_objectinstance(), and vol_precache_part().
| int point_inside_volume_objectinstance | ( | Render * | re, |
| ObjectInstanceRen * | obi, | ||
| float * | co | ||
| ) |
Definition at line 824 of file volume_precache.c.
References makeraytree_object(), and point_inside_obi().
Referenced by init_camera_inside_volumes().
| static VolPrecachePart* precache_get_new_part | ( | Render * | re | ) | [static] |
Definition at line 633 of file volume_precache.c.
References VolPrecachePart::done, ListBase::first, VolPrecachePart::next, NULL, Render::volume_precache_parts, and VolPrecachePart::working.
Referenced by vol_precache_objectinstance_threads().
| static void precache_init_parts | ( | Render * | re, |
| RayObject * | tree, | ||
| ShadeInput * | shi, | ||
| ObjectInstanceRen * | obi, | ||
| int | totthread, | ||
| int * | parts | ||
| ) | [static] |
Definition at line 558 of file volume_precache.c.
References VolPrecachePart::bbmin, BLI_addtail(), BLI_freelistN(), copy_m4_m4(), copy_v3_v3(), VolPrecachePart::done, global_bounds_obi(), i, VolPrecachePart::maxx, VolPrecachePart::maxy, VolPrecachePart::maxz, MEM_callocN(), VolPrecachePart::minx, VolPrecachePart::miny, VolPrecachePart::minz, VolPrecachePart::num, VolPrecachePart::obi, VolPrecachePart::re, VolPrecachePart::res, VolumePrecache::res, VolPrecachePart::shi, sub_v3_v3v3(), VolPrecachePart::tree, VECCOPY, Render::viewmat, VolPrecachePart::viewmat, ObjectInstanceRen::volume_precache, Render::volume_precache_parts, VolPrecachePart::voxel, and VolPrecachePart::working.
Referenced by vol_precache_objectinstance_threads().
| static int precache_resolution | ( | Render * | re, |
| VolumePrecache * | vp, | ||
| ObjectInstanceRen * | obi, | ||
| int | res | ||
| ) | [static] |
Definition at line 649 of file volume_precache.c.
References div, global_bounds_obi(), MAX3(), VolumePrecache::res, and sub_v3_v3v3().
Referenced by vol_precache_objectinstance_threads().
| static void precache_setup_shadeinput | ( | Render * | re, |
| ObjectInstanceRen * | obi, | ||
| Material * | ma, | ||
| ShadeInput * | shi | ||
| ) | [static] |
Definition at line 544 of file volume_precache.c.
References ShadeInput::depth, Material::har, ShadeInput::har, ShadeInput::lay, Render::lay, ShadeInput::mask, ShadeInput::mat, NULL, ShadeInput::obi, ShadeInput::obr, ObjectInstanceRen::obr, Material::r, ShadeInput::r, and ShadeInput::vlr.
Referenced by vol_precache_objectinstance_threads().
| static float total_ms_energy | ( | float * | sr, |
| float * | sg, | ||
| float * | sb, | ||
| int * | res | ||
| ) | [static] |
Definition at line 310 of file volume_precache.c.
Referenced by multiple_scattering_diffusion().
| static float total_ss_energy | ( | VolumePrecache * | vp | ) | [static] |
Definition at line 289 of file volume_precache.c.
References VolumePrecache::data_b, VolumePrecache::data_g, VolumePrecache::data_r, i, VolumePrecache::res, and V_I.
Referenced by multiple_scattering_diffusion().
| static int using_lightcache | ( | Material * | ma | ) | [static] |
Definition at line 778 of file volume_precache.c.
References ELEM, MA_VOL_PRECACHESHADING, MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SHADED, MA_VOL_SHADE_SHADEDPLUSMULTIPLE, VolumeSettings::shade_type, VolumeSettings::shadeflag, and Material::vol.
Referenced by volume_precache().
| static int v_I_pad | ( | int | x, |
| int | y, | ||
| int | z, | ||
| int * | n | ||
| ) | [inline, static] |
Definition at line 274 of file volume_precache.c.
Referenced by ms_diffuse().
| static void vol_precache_objectinstance_threads | ( | Render * | re, |
| ObjectInstanceRen * | obi, | ||
| Material * | ma | ||
| ) | [static] |
Definition at line 678 of file volume_precache.c.
References BLI_available_threads(), BLI_end_threads(), BLI_freelistN(), BLI_init_threads(), BLI_insert_thread(), BLI_remove_thread(), BLI_snprintf(), VolumePrecache::data_b, VolumePrecache::data_g, VolumePrecache::data_r, VolPrecachePart::done, ELEM, ListBase::first, Render::i, RenderStats::infostr, lightcache_filter(), MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SHADEDPLUSMULTIPLE, makeraytree_object(), MEM_callocN(), MEM_freeN(), multiple_scattering_diffusion(), VolPrecachePart::next, NULL, Render::parts, PIL_check_seconds_timer(), PIL_sleep_ms(), precache_get_new_part(), precache_init_parts(), VolumeSettings::precache_resolution, precache_resolution(), precache_setup_shadeinput(), Render::r, R, VolumePrecache::res, Render::sdh, VolumeSettings::shade_type, Render::stats_draw, str, Render::tbh, Render::test_break, threads, RenderData::threads, Material::vol, vol_precache_part(), ObjectInstanceRen::volume_precache, Render::volume_precache_parts, and VolPrecachePart::working.
Referenced by volume_precache().
| static void* vol_precache_part | ( | void * | data | ) | [static] |
Definition at line 486 of file volume_precache.c.
References VolPrecachePart::bbmin, co, copy_v3_v3(), VolumePrecache::data_b, VolumePrecache::data_g, VolumePrecache::data_r, VolPrecachePart::done, i, VolPrecachePart::minx, VolPrecachePart::miny, VolPrecachePart::minz, mul_v3_m4v3(), normalize_v3(), NULL, VolPrecachePart::obi, point_inside_obi(), VolPrecachePart::re, VolPrecachePart::res, VolPrecachePart::shi, Render::tbh, Render::test_break, VolPrecachePart::tree, V_I, ShadeInput::view, VolPrecachePart::viewmat, vol_get_scattering(), ObjectInstanceRen::volume_precache, and VolPrecachePart::voxel.
Referenced by vol_precache_objectinstance_threads().
| void volume_precache | ( | Render * | re | ) |
Definition at line 786 of file volume_precache.c.
References ListBase::first, Render::i, RenderStats::infostr, Render::instancetable, VolumeOb::ma, ObjectInstanceRen::next, VolumeOb::next, NULL, ObjectInstanceRen::obr, VolumeOb::obr, Render::sdh, Render::stats_draw, using_lightcache(), vol_precache_objectinstance_threads(), and Render::volumes.
Referenced by RE_Database_FromScene().
Definition at line 127 of file pipeline.c.