|
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_rand.h"#include "BLI_voxel.h"#include "BLI_utildefines.h"#include "RE_shader_ext.h"#include "DNA_material_types.h"#include "DNA_group_types.h"#include "DNA_lamp_types.h"#include "DNA_meta_types.h"#include "BKE_global.h"#include "render_types.h"#include "pixelshading.h"#include "rayintersection.h"#include "rayobject.h"#include "shading.h"#include "shadbuf.h"#include "texture.h"#include "volumetric.h"#include "volume_precache.h"Go to the source code of this file.
Functions | |
| BM_INLINE float | luminance (float *col) |
| static float | vol_get_shadow (ShadeInput *shi, LampRen *lar, float *co) |
| static int | vol_get_bounds (ShadeInput *shi, float *co, float *vec, float *hitco, Isect *isect, int intersect_type) |
| static void | shade_intersection (ShadeInput *shi, float *col, Isect *is) |
| static void | vol_trace_behind (ShadeInput *shi, VlakRen *vlr, float *co, float *col) |
| static void | vol_get_precached_scattering (Render *re, ShadeInput *shi, float *scatter_col, float *co) |
| static float | metadensity (Object *ob, float *co) |
| float | vol_get_density (struct ShadeInput *shi, float *co) |
| static void | vol_get_reflection_color (ShadeInput *shi, float *ref_col, float *co) |
| static void | vol_get_emission (ShadeInput *shi, float *emission_col, float *co) |
| static void | vol_get_sigma_t (ShadeInput *shi, float *sigma_t, float *co) |
| static float | vol_get_phasefunc (ShadeInput *UNUSED(shi), float g, float *w, float *wp) |
| static void | vol_get_transmittance_seg (ShadeInput *shi, float *tr, float stepsize, float *co, float density) |
| static void | vol_get_transmittance (ShadeInput *shi, float *tr, float *co, float *endco) |
| static void | vol_shade_one_lamp (struct ShadeInput *shi, float *co, LampRen *lar, float *lacol) |
| void | vol_get_scattering (ShadeInput *shi, float *scatter_col, float *co) |
| static void | volumeintegrate (struct ShadeInput *shi, float *col, float *co, float *endco) |
| static void | volume_trace (struct ShadeInput *shi, struct ShadeResult *shr, int inside_volume) |
| void | shade_volume_shadow (struct ShadeInput *shi, struct ShadeResult *shr, struct Isect *last_is) |
| void | shade_volume_outside (ShadeInput *shi, ShadeResult *shr) |
| void | shade_volume_inside (ShadeInput *shi, ShadeResult *shr) |
Variables | |
| struct Render | R |
Definition in file volumetric.c.
| BM_INLINE float luminance | ( | float * | col | ) |
Definition at line 73 of file volumetric.c.
Referenced by shade_volume_shadow(), vol_shade_one_lamp(), and volumeintegrate().
| static float metadensity | ( | Object * | ob, |
| float * | co | ||
| ) | [static] |
Definition at line 241 of file volumetric.c.
References Object::data, and Render::imat.
Referenced by vol_get_density().
| static void shade_intersection | ( | ShadeInput * | shi, |
| float * | col, | ||
| Isect * | is | ||
| ) | [static] |
Definition at line 156 of file volumetric.c.
References ShadeResult::alpha, ShadeInput::camera_co, ShadeResult::combined, ShadeInput::combinedflag, copy_v3_v3(), ShadeInput::depth, ShadeInput::lay, ShadeInput::light_override, ShadeInput::mask, ShadeInput::mat_override, ShadeInput::osatex, ShadeInput::passflag, SCE_PASS_COMBINED, shade_ray(), Isect::start, ShadeInput::thread, VECCOPY, ShadeInput::volume_depth, ShadeInput::xs, and ShadeInput::ys.
Referenced by vol_trace_behind(), and volume_trace().
| void shade_volume_inside | ( | ShadeInput * | shi, |
| ShadeResult * | shr | ||
| ) |
Definition at line 801 of file volumetric.c.
References ShadeResult::alpha, CLAMP(), MatInside::ma, ShadeInput::mat, ShadeInput::obi, MatInside::obi, ShadeInput::obr, ObjectInstanceRen::obr, R, VOL_SHADE_INSIDE, and volume_trace().
Referenced by shade_material_loop().
| void shade_volume_outside | ( | ShadeInput * | shi, |
| ShadeResult * | shr | ||
| ) |
Definition at line 794 of file volumetric.c.
References VOL_SHADE_OUTSIDE, and volume_trace().
Referenced by shade_input_do_shade(), and shade_ray().
| void shade_volume_shadow | ( | struct ShadeInput * | shi, |
| struct ShadeResult * | shr, | ||
| struct Isect * | last_is | ||
| ) |
Definition at line 744 of file volumetric.c.
References ShadeResult::alpha, ShadeInput::co, ShadeResult::combined, copy_v3_v3(), Isect::dist, Isect::face, ShadeInput::flippednor, Isect::hit, luminance(), Isect::ob, ShadeInput::obi, Isect::start, ShadeInput::view, ShadeInput::vlr, VOL_BOUNDS_DEPTH, VOL_BOUNDS_SS, vol_get_bounds(), and vol_get_transmittance().
Referenced by shade_ray().
| static int vol_get_bounds | ( | ShadeInput * | shi, |
| float * | co, | ||
| float * | vec, | ||
| float * | hitco, | ||
| Isect * | isect, | ||
| int | intersect_type | ||
| ) | [static] |
Definition at line 124 of file volumetric.c.
References Isect::check, Isect::dir, Isect::dist, Isect::face, FLT_MAX, Isect::last_hit, Isect::lay, Isect::mode, NULL, Isect::ob, ShadeInput::obi, Isect::orig, R, RE_CHECK_VLR_NONE, RE_RAY_MIRROR, RE_rayobject_raycast(), RE_SKIP_VLR_NEIGHBOUR, Isect::skip, Isect::start, VECCOPY, ShadeInput::vlr, and VOL_BOUNDS_DEPTH.
Referenced by shade_volume_shadow(), vol_shade_one_lamp(), and volume_trace().
| float vol_get_density | ( | struct ShadeInput * | shi, |
| float * | co | ||
| ) |
Definition at line 287 of file volumetric.c.
References VolumeSettings::density, VolumeSettings::density_scale, do_volume_tex(), MAP_DENSITY, Material::mapto_textured, ShadeInput::mat, metadensity(), NULL, ObjectRen::ob, OB_MBALL, ShadeInput::obi, ObjectInstanceRen::obr, Object::type, and Material::vol.
Referenced by vol_get_transmittance(), and volumeintegrate().
| static void vol_get_emission | ( | ShadeInput * | shi, |
| float * | emission_col, | ||
| float * | co | ||
| ) | [static] |
Definition at line 328 of file volumetric.c.
References do_volume_tex(), VolumeSettings::emission, VolumeSettings::emission_col, MAP_EMISSION, MAP_EMISSION_COL, Material::mapto_textured, ShadeInput::mat, VECCOPY, and Material::vol.
Referenced by volumeintegrate().
| static float vol_get_phasefunc | ( | ShadeInput * | UNUSEDshi, |
| float | g, | ||
| float * | w, | ||
| float * | wp | ||
| ) | [static] |
Definition at line 364 of file volumetric.c.
References dot_v3v3(), g, and normalize().
Referenced by vol_shade_one_lamp().
| static void vol_get_precached_scattering | ( | Render * | re, |
| ShadeInput * | shi, | ||
| float * | scatter_col, | ||
| float * | co | ||
| ) | [static] |
Definition at line 216 of file volumetric.c.
References VolumePrecache::data_b, VolumePrecache::data_g, VolumePrecache::data_r, global_bounds_obi(), mul_v3_m4v3(), ShadeInput::obi, VolumePrecache::res, sub_v3_v3v3(), Render::viewinv, ObjectInstanceRen::volume_precache, and voxel_sample_triquadratic().
Referenced by volumeintegrate().
| static void vol_get_reflection_color | ( | ShadeInput * | shi, |
| float * | ref_col, | ||
| float * | co | ||
| ) | [static] |
Definition at line 308 of file volumetric.c.
References do_volume_tex(), MAP_REFLECTION, MAP_REFLECTION_COL, MAP_SCATTERING, Material::mapto_textured, ShadeInput::mat, NULL, VolumeSettings::reflection, reflection(), VolumeSettings::reflection_col, VolumeSettings::scattering, VECCOPY, and Material::vol.
Referenced by vol_shade_one_lamp().
| void vol_get_scattering | ( | ShadeInput * | shi, |
| float * | scatter_col, | ||
| float * | co | ||
| ) |
Definition at line 549 of file volumetric.c.
References add_v3_v3(), ListBase::first, get_lights(), GroupObject::lampren, Render::lights, GroupObject::next, and vol_shade_one_lamp().
Referenced by vol_precache_part(), and volumeintegrate().
| static float vol_get_shadow | ( | ShadeInput * | shi, |
| LampRen * | lar, | ||
| float * | co | ||
| ) | [static] |
Definition at line 79 of file volumetric.c.
References Isect::check, LampRen::co, copy_v3_v3(), Isect::dir, Isect::dist, Isect::face, LA_HEMI, LA_LAYER, LA_LAYER_SHADOW, LA_SHAD_RAY, LA_SUN, Isect::last_hit, LampRen::last_hit, Isect::lay, LampRen::lay, Isect::mode, LampRen::mode, normalize_v3(), NULL, Isect::ob, Isect::orig, R, RE_CHECK_VLR_NON_SOLID_MATERIAL, RE_RAY_MIRROR, RE_rayobject_raycast(), LampRen::shb, Isect::skip, Isect::start, testshadowbuf(), ShadeInput::thread, LampRen::type, LampRen::vec, and VECSUB.
Referenced by vol_shade_one_lamp().
| static void vol_get_sigma_t | ( | ShadeInput * | shi, |
| float * | sigma_t, | ||
| float * | co | ||
| ) | [static] |
Definition at line 346 of file volumetric.c.
References do_volume_tex(), MAP_SCATTERING, MAP_TRANSMISSION_COL, Material::mapto_textured, ShadeInput::mat, VolumeSettings::scattering, VolumeSettings::transmission_col, and Material::vol.
Referenced by vol_get_transmittance(), and vol_get_transmittance_seg().
| static void vol_get_transmittance | ( | ShadeInput * | shi, |
| float * | tr, | ||
| float * | co, | ||
| float * | endco | ||
| ) | [static] |
Definition at line 431 of file volumetric.c.
References add_v3_v3(), BLI_thread_frand(), simple_enum_gen::d, expf, MA_VOL_STEP_CONSTANT, ShadeInput::mat, mul_v3_fl(), normalize_v3(), p, VolumeSettings::stepsize, VolumeSettings::stepsize_type, ShadeInput::thread, Material::vol, vol_get_density(), and vol_get_sigma_t().
Referenced by shade_volume_shadow(), and vol_shade_one_lamp().
| static void vol_get_transmittance_seg | ( | ShadeInput * | shi, |
| float * | tr, | ||
| float | stepsize, | ||
| float * | co, | ||
| float | density | ||
| ) | [static] |
Definition at line 411 of file volumetric.c.
References KDL::exp(), and vol_get_sigma_t().
Referenced by volumeintegrate().
| static void vol_shade_one_lamp | ( | struct ShadeInput * | shi, |
| float * | co, | ||
| LampRen * | lar, | ||
| float * | lacol | ||
| ) | [static] |
Definition at line 467 of file volumetric.c.
References VolumeSettings::asymmetry, LampRen::co, copy_v3_v3(), do_lamp_tex(), ELEM, ELEM3, LampRen::energy, Isect::face, Isect::hit, if(), LA_HEMI, LA_LAYER, LA_SUN, LA_TEXTURE, lamp_get_visibility(), ShadeInput::lay, ObjectInstanceRen::lay, LampRen::lay, len_v3v3(), luminance(), MA_TYPE_SURFACE, MA_VOL_RECV_EXT_SHADOW, MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SHADED, MA_VOL_SHADE_SHADEDPLUSMULTIPLE, MA_VOL_SHADE_SHADOWED, ShadeInput::mat, VlakRen::mat, Material::material_type, LampRen::mode, mul_v3_fl(), mul_v3_v3v3(), negate_v3(), normalize_v3(), ShadeInput::obi, ShadeInput::osatex, p, LampRen::r, VolumeSettings::shade_type, VolumeSettings::shadeflag, LampRen::type, LampRen::vec, VECCOPY, ShadeInput::view, Material::vol, VOL_BOUNDS_SS, vol_get_bounds(), vol_get_phasefunc(), vol_get_reflection_color(), vol_get_shadow(), and vol_get_transmittance().
Referenced by vol_get_scattering().
| static void vol_trace_behind | ( | ShadeInput * | shi, |
| VlakRen * | vlr, | ||
| float * | co, | ||
| float * | col | ||
| ) | [static] |
Definition at line 189 of file volumetric.c.
References Isect::check, Isect::dir, Isect::dist, Isect::face, FLT_MAX, Isect::last_hit, Isect::lay, Isect::mode, NULL, Isect::ob, ShadeInput::obi, Isect::orig, R, RE_CHECK_VLR_NONE, RE_RAY_MIRROR, RE_rayobject_raycast(), RE_SKIP_VLR_NEIGHBOUR, shade_intersection(), shadeSkyView(), shadeSunView(), Isect::skip, Isect::start, ShadeInput::thread, VECCOPY, and ShadeInput::view.
Referenced by volume_trace().
| static void volume_trace | ( | struct ShadeInput * | shi, |
| struct ShadeResult * | shr, | ||
| int | inside_volume | ||
| ) | [static] |
Definition at line 650 of file volumetric.c.
References ShadeResult::alpha, ShadeInput::camera_co, ShadeInput::co, ShadeResult::combined, copy_v3_v3(), ShadeInput::depth, ShadeResult::diff, Isect::face, ShadeInput::flippednor, Isect::hit, if(), MatInside::ma, MA_TRANSP, MA_ZTRANSP, ShadeInput::mat, VlakRen::mat, Material::mode, MatInside::next, QUATCOPY, R, shade_intersection(), VECCOPY, ShadeInput::view, ShadeInput::vlr, VOL_BOUNDS_DEPTH, vol_get_bounds(), VOL_SHADE_INSIDE, VOL_SHADE_OUTSIDE, vol_trace_behind(), and volumeintegrate().
Referenced by shade_volume_inside(), and shade_volume_outside().
| static void volumeintegrate | ( | struct ShadeInput * | shi, |
| float * | col, | ||
| float * | co, | ||
| float * | endco | ||
| ) | [static] |
Definition at line 588 of file volumetric.c.
References add_v3_v3(), BLI_thread_frand(), VolumeSettings::depth_cutoff, luminance(), MA_VOL_STEP_CONSTANT, ShadeInput::mat, mul_v3_fl(), mul_v3_v3v3(), normalize_v3(), ShadeInput::obi, p, R, VolumeSettings::stepsize, VolumeSettings::stepsize_type, ShadeInput::thread, Material::vol, vol_get_density(), vol_get_emission(), vol_get_precached_scattering(), vol_get_scattering(), vol_get_transmittance_seg(), and ObjectInstanceRen::volume_precache.
Referenced by volume_trace().
Definition at line 127 of file pipeline.c.