Blender V2.61 - r43446
|
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <float.h>
#include <assert.h>
#include "MEM_guardedalloc.h"
#include "DNA_material_types.h"
#include "DNA_lamp_types.h"
#include "BLI_blenlib.h"
#include "BLI_cpu.h"
#include "BLI_jitter.h"
#include "BLI_math.h"
#include "BLI_rand.h"
#include "BLI_utildefines.h"
#include "BKE_global.h"
#include "BKE_node.h"
#include "PIL_time.h"
#include "render_result.h"
#include "render_types.h"
#include "renderpipeline.h"
#include "rendercore.h"
#include "renderdatabase.h"
#include "pixelblending.h"
#include "pixelshading.h"
#include "shading.h"
#include "texture.h"
#include "volumetric.h"
#include "rayintersection.h"
#include "rayobject.h"
#include "raycounter.h"
Go to the source code of this file.
Defines | |
#define | RAY_TRA 1 |
#define | RAY_INSIDE 2 |
#define | DEPTH_SHADOW_TRA 10 |
Functions | |
static int | test_break (void *data) |
static void | RE_rayobject_config_control (RayObject *r, Render *re) |
static RayObject * | RE_rayobject_create (Render *re, int type, int size) |
void | freeraytree (Render *re) |
static int | is_raytraceable_vlr (Render *re, VlakRen *vlr) |
static int | is_raytraceable (Render *re, ObjectInstanceRen *obi) |
RayObject * | makeraytree_object (Render *re, ObjectInstanceRen *obi) |
static int | has_special_rayobject (Render *re, ObjectInstanceRen *obi) |
static void | makeraytree_single (Render *re) |
void | makeraytree (Render *re) |
static void | shade_ray_set_derivative (ShadeInput *shi) |
void | shade_ray (Isect *is, ShadeInput *shi, ShadeResult *shr) |
static int | refraction (float refract[3], const float n[3], const float view[3], float index) |
static void | reflection_simple (float ref[3], float n[3], const float view[3]) |
static void | reflection (float ref[3], float n[3], const float view[3], const float orn[3]) |
static float | shade_by_transmission (Isect *is, ShadeInput *shi, ShadeResult *shr) |
static void | ray_fadeout_endcolor (float col[3], ShadeInput *origshi, ShadeInput *shi, ShadeResult *shr, Isect *isec, const float vec[3]) |
static void | ray_fadeout (Isect *is, ShadeInput *shi, float col[3], const float blendcol[3], float dist_mir) |
static void | traceray (ShadeInput *origshi, ShadeResult *origshr, short depth, const float start[3], const float dir[3], float col[4], ObjectInstanceRen *obi, VlakRen *vlr, int traflag) |
static void | DP_energy (float *table, float vec[2], int tot, float xsize, float ysize) |
static void | jitter_plane_offset (float *jitter1, float *jitter2, int tot, float sizex, float sizey, float ofsx, float ofsy) |
void | init_jitter_plane (LampRen *lar) |
static float * | give_jitter_plane (LampRen *lar, int thread, int xs, int ys) |
static void | halton_sample (double *ht_invprimes, double *ht_nums, double *v) |
static void | hammersley_create (double *out, int n) |
static struct QMCSampler * | QMC_initSampler (int type, int tot) |
static void | QMC_initPixel (QMCSampler *qsa, int thread) |
static void | QMC_freeSampler (QMCSampler *qsa) |
static void | QMC_getSample (double *s, QMCSampler *qsa, int thread, int num) |
static void | QMC_samplePhong (float vec[3], QMCSampler *qsa, int thread, int num, float blur) |
static void | QMC_sampleRect (float vec[3], QMCSampler *qsa, int thread, int num, float sizex, float sizey) |
static void | QMC_sampleDisc (float vec[3], QMCSampler *qsa, int thread, int num, float radius) |
static void | QMC_sampleHemi (float vec[3], QMCSampler *qsa, int thread, int num) |
void | init_render_qmcsampler (Render *re) |
static QMCSampler * | get_thread_qmcsampler (Render *re, int thread, int type, int tot) |
static void | release_thread_qmcsampler (Render *UNUSED(re), int UNUSED(thread), QMCSampler *qsa) |
void | free_render_qmcsampler (Render *re) |
static int | adaptive_sample_variance (int samples, const float col[3], const float colsq[3], float thresh) |
static int | adaptive_sample_contrast_val (int samples, float prev, float val, float thresh) |
static float | get_avg_speed (ShadeInput *shi) |
static void | trace_refract (float col[4], ShadeInput *shi, ShadeResult *shr) |
static void | trace_reflect (float col[3], ShadeInput *shi, ShadeResult *shr, float fresnelfac) |
void | ray_trace (ShadeInput *shi, ShadeResult *shr) |
static void | addAlphaLight (float shadfac[4], const float col[3], float alpha, float filter) |
static void | ray_trace_shadow_tra (Isect *is, ShadeInput *origshi, int depth, int traflag, float col[4]) |
static int UNUSED_FUNCTION() | ray_trace_shadow_rad (ShadeInput *ship, ShadeResult *shr) |
static void | RandomSpherical (float v[3]) |
static void | DS_energy (float *sphere, int tot, float vec[3]) |
void | init_ao_sphere (World *wrld) |
static float * | threadsafe_table_sphere (int test, int thread, int xs, int ys, int tot) |
static float * | sphere_sampler (int type, int resol, int thread, int xs, int ys, int reset) |
static void | ray_ao_qmc (ShadeInput *shi, float ao[3], float env[3]) |
static void | ray_ao_spheresamp (ShadeInput *shi, float ao[3], float env[3]) |
void | ray_ao (ShadeInput *shi, float ao[3], float env[3]) |
static void | ray_shadow_jittered_coords (ShadeInput *shi, int max, float jitco[RE_MAX_OSA][3], int *totjitco) |
static void | ray_shadow_qmc (ShadeInput *shi, LampRen *lar, const float lampco[3], float shadfac[4], Isect *isec) |
static void | ray_shadow_jitter (ShadeInput *shi, LampRen *lar, const float lampco[3], float shadfac[4], Isect *isec) |
void | ray_shadow (ShadeInput *shi, LampRen *lar, float shadfac[4]) |
Variables | |
struct Render | R |
Definition in file rayshade.c.
#define DEPTH_SHADOW_TRA 10 |
Definition at line 75 of file rayshade.c.
Referenced by ray_shadow(), ray_shadow_jitter(), and ray_shadow_qmc().
#define RAY_INSIDE 2 |
Definition at line 73 of file rayshade.c.
Referenced by trace_refract(), and traceray().
#define RAY_TRA 1 |
Definition at line 72 of file rayshade.c.
Referenced by ray_trace_shadow_tra().
static int adaptive_sample_contrast_val | ( | int | samples, |
float | prev, | ||
float | val, | ||
float | thresh | ||
) | [static] |
static int adaptive_sample_variance | ( | int | samples, |
const float | col[3], | ||
const float | colsq[3], | ||
float | thresh | ||
) | [static] |
Definition at line 1256 of file rayshade.c.
References thresh.
Referenced by ray_shadow_qmc(), trace_reflect(), and trace_refract().
static void addAlphaLight | ( | float | shadfac[4], |
const float | col[3], | ||
float | alpha, | ||
float | filter | ||
) | [static] |
static void DP_energy | ( | float * | table, |
float | vec[2], | ||
int | tot, | ||
float | xsize, | ||
float | ysize | ||
) | [static] |
Definition at line 896 of file rayshade.c.
References floorf, min, MIN2, Render::result, and table.
Referenced by init_jitter_plane().
static void DS_energy | ( | float * | sphere, |
int | tot, | ||
float | vec[3] | ||
) | [static] |
Definition at line 1765 of file rayshade.c.
References add_v3_v3(), mul_v3_fl(), normalize_v3(), sub_v3_v3v3(), and QMCSampler::tot.
Referenced by init_ao_sphere().
void free_render_qmcsampler | ( | Render * | re | ) |
Definition at line 1237 of file rayshade.c.
References BLENDER_MAX_THREADS, ListBase::first, ListBase::last, MEM_freeN(), QMCSampler::next, next, NULL, QMC_freeSampler(), and Render::qmcsamplers.
Referenced by RE_Database_Free().
void freeraytree | ( | Render * | re | ) |
Definition at line 147 of file rayshade.c.
References BLENDER_MAX_THREADS, ListBase::first, i, Render::instancetable, MEM_freeN(), ObjectInstanceRen::next, NULL, ObjectInstanceRen::obr, ObjectRen::rayfaces, Render::rayfaces, Render::rayprimitives, ObjectInstanceRen::raytree, ObjectRen::raytree, Render::raytree, RE_rayobject_free(), RE_RC_INFO, RE_RC_MERGE, and sum().
Referenced by makeraytree(), and RE_Database_Free().
static float get_avg_speed | ( | ShadeInput * | shi | ) | [static] |
Definition at line 1289 of file rayshade.c.
References PASS_VECTOR_MAX, sqrt(), and ShadeInput::winspeed.
Referenced by ray_ao_qmc().
static QMCSampler* get_thread_qmcsampler | ( | Render * | re, |
int | thread, | ||
int | type, | ||
int | tot | ||
) | [static] |
Definition at line 1211 of file rayshade.c.
References BLI_addtail(), ListBase::first, QMCSampler::next, QMC_initSampler(), Render::qmcsamplers, QMCSampler::tot, QMCSampler::type, and QMCSampler::used.
Referenced by ray_ao_qmc(), ray_shadow_qmc(), trace_reflect(), and trace_refract().
static float* give_jitter_plane | ( | LampRen * | lar, |
int | thread, | ||
int | xs, | ||
int | ys | ||
) | [static] |
Definition at line 987 of file rayshade.c.
References LampRen::area_size, LampRen::area_sizey, BLI_thread_frand(), LampRen::jitter, jitter_plane_offset(), LA_SAMP_DITHER, LA_SAMP_JITTER, LampRen::ray_samp_type, LampRen::ray_totsamp, LampRen::xold, and LampRen::yold.
Referenced by ray_shadow_jitter().
static void halton_sample | ( | double * | ht_invprimes, |
double * | ht_nums, | ||
double * | v | ||
) | [static] |
Definition at line 1013 of file rayshade.c.
References credits_svn_gen::e, fabs(), i, and Render::r.
Referenced by QMC_initPixel().
static void hammersley_create | ( | double * | out, |
int | n | ||
) | [static] |
static int has_special_rayobject | ( | Render * | re, |
ObjectInstanceRen * | obi | ||
) | [static] |
Definition at line 302 of file rayshade.c.
References ObjectInstanceRen::flag, is_raytraceable_vlr(), ObjectInstanceRen::obr, Render::r, R_RAYTRACE_USE_INSTANCES, R_TRANSFORMED, RenderData::raytrace_options, ObjectRen::totvlak, VlakTableNode::vlak, and ObjectRen::vlaknodes.
Referenced by makeraytree_single().
void init_ao_sphere | ( | World * | wrld | ) |
Definition at line 1792 of file rayshade.c.
References World::aosamp, World::aosphere, World::aotables, BLENDER_MAX_THREADS, BLI_srandom(), DS_energy(), MEM_mallocN(), RandomSpherical(), and QMCSampler::tot.
Referenced by RE_Database_Baking(), and RE_Database_FromScene().
void init_jitter_plane | ( | LampRen * | lar | ) |
Definition at line 947 of file rayshade.c.
References LampRen::area_size, LampRen::area_sizey, BLENDER_MAX_THREADS, BLI_frand(), BLI_srandom(), DP_energy(), LampRen::jitter, jitter_plane_offset(), MEM_callocN(), and LampRen::ray_totsamp.
Referenced by add_render_lamp().
void init_render_qmcsampler | ( | Render * | re | ) |
Definition at line 1206 of file rayshade.c.
References BLENDER_MAX_THREADS, MEM_callocN(), and Render::qmcsamplers.
Referenced by RE_Database_Baking(), and RE_Database_FromScene().
static int is_raytraceable | ( | Render * | re, |
ObjectInstanceRen * | obi | ||
) | [static] |
Definition at line 208 of file rayshade.c.
References Render::excludeob, is_raytraceable_vlr(), ObjectRen::ob, ObjectInstanceRen::obr, ObjectRen::totvlak, VlakTableNode::vlak, and ObjectRen::vlaknodes.
Referenced by makeraytree_single().
Definition at line 199 of file rayshade.c.
References Render::flag, VlakRen::flag, MA_TYPE_VOLUME, MA_TYPE_WIRE, VlakRen::mat, Material::material_type, R_BAKE_TRACE, and R_TRACEBLE.
Referenced by has_special_rayobject(), is_raytraceable(), makeraytree_object(), and makeraytree_single().
static void jitter_plane_offset | ( | float * | jitter1, |
float * | jitter2, | ||
int | tot, | ||
float | sizex, | ||
float | sizey, | ||
float | ofsx, | ||
float | ofsy | ||
) | [static] |
Definition at line 930 of file rayshade.c.
Referenced by give_jitter_plane(), and init_jitter_plane().
void makeraytree | ( | Render * | re | ) |
Definition at line 439 of file rayshade.c.
References freeraytree(), Render::i, i, RenderStats::infostr, INIT_MINMAX, makeraytree_single(), max, Render::maxdist, min, Render::r, R_RAYSTRUCTURE_OCTREE, R_RAYTRACE_USE_INSTANCES, R_RAYTRACE_USE_LOCAL_COORDS, RenderData::raytrace_options, RenderData::raytrace_structure, Render::raytree, RE_rayobject_merge_bb(), Render::sdh, sqrt(), Render::stats_draw, and test_break().
Referenced by RE_Database_Baking(), and RE_Database_FromScene().
RayObject* makeraytree_object | ( | Render * | re, |
ObjectInstanceRen * | obi | ||
) | [read] |
Definition at line 227 of file rayshade.c.
References ObjectInstanceRen::flag, is_raytraceable_vlr(), ObjectInstanceRen::mat, MEM_callocN(), NULL, ObjectInstanceRen::obr, Render::r, R_RAYTRACE_USE_LOCAL_COORDS, R_TRANSFORMED, ObjectRen::rayfaces, ObjectRen::rayobi, ObjectRen::rayprimitives, RenderData::raytrace_options, RenderData::raytrace_structure, ObjectInstanceRen::raytree, Render::raytree, ObjectRen::raytree, RE_rayface_from_vlak(), RE_rayobject_add(), RE_rayobject_create(), RE_rayobject_done(), RE_rayobject_free(), RE_rayobject_instance_create(), RE_rayobject_unalignRayFace, RE_vlakprimitive_from_vlak(), test_break(), ObjectRen::totvlak, ObjectInstanceRen::transform_primitives, VlakTableNode::vlak, and ObjectRen::vlaknodes.
Referenced by makeraytree_single(), point_inside_volume_objectinstance(), and vol_precache_objectinstance_threads().
static void makeraytree_single | ( | Render * | re | ) | [static] |
Definition at line 325 of file rayshade.c.
References ListBase::first, ObjectInstanceRen::flag, has_special_rayobject(), Render::i, RenderStats::infostr, Render::instancetable, is_raytraceable(), is_raytraceable_vlr(), makeraytree_object(), ObjectInstanceRen::mat, MEM_callocN(), mul_m4_v3(), ObjectInstanceRen::next, NULL, ObjectInstanceRen::obr, Render::r, R_RAYTRACE_USE_LOCAL_COORDS, R_TRANSFORMED, Render::rayfaces, Render::rayprimitives, RenderData::raytrace_options, RenderData::raytrace_structure, Render::raytree, RE_rayface_from_vlak(), RE_rayface_isQuad, RE_rayobject_add(), RE_rayobject_create(), RE_rayobject_done(), RE_rayobject_empty_create(), RE_rayobject_unalignRayFace, RE_vlakprimitive_from_vlak(), Render::sdh, Render::stats_draw, test_break(), ObjectRen::totvlak, ObjectInstanceRen::transform_primitives, RayFace::v1, RayFace::v2, RayFace::v3, RayFace::v4, VlakTableNode::vlak, and ObjectRen::vlaknodes.
Referenced by makeraytree().
static void QMC_freeSampler | ( | QMCSampler * | qsa | ) | [static] |
Definition at line 1107 of file rayshade.c.
References MEM_freeN(), and QMCSampler::samp2d.
Referenced by free_render_qmcsampler().
static void QMC_getSample | ( | double * | s, |
QMCSampler * | qsa, | ||
int | thread, | ||
int | num | ||
) | [static] |
Definition at line 1113 of file rayshade.c.
References QMCSampler::offs, QMCSampler::samp2d, SAMP_TYPE_HAMMERSLEY, and QMCSampler::type.
Referenced by QMC_sampleDisc(), QMC_sampleHemi(), QMC_samplePhong(), and QMC_sampleRect().
static void QMC_initPixel | ( | QMCSampler * | qsa, |
int | thread | ||
) | [static] |
Definition at line 1076 of file rayshade.c.
References BLI_thread_frand(), halton_sample(), i, QMCSampler::offs, QMCSampler::samp2d, SAMP_TYPE_HAMMERSLEY, QMCSampler::tot, and QMCSampler::type.
Referenced by ray_ao_qmc(), ray_shadow_qmc(), trace_reflect(), and trace_refract().
static struct QMCSampler* QMC_initSampler | ( | int | type, |
int | tot | ||
) | [static, read] |
Definition at line 1062 of file rayshade.c.
References hammersley_create(), MEM_callocN(), QMCSampler::samp2d, SAMP_TYPE_HAMMERSLEY, QMCSampler::tot, and QMCSampler::type.
Referenced by get_thread_qmcsampler().
static void QMC_sampleDisc | ( | float | vec[3], |
QMCSampler * | qsa, | ||
int | thread, | ||
int | num, | ||
float | radius | ||
) | [static] |
Definition at line 1155 of file rayshade.c.
References cosf, M_PI, QMC_getSample(), sinf, KDL::sqr(), and sqrt().
Referenced by ray_shadow_qmc().
static void QMC_sampleHemi | ( | float | vec[3], |
QMCSampler * | qsa, | ||
int | thread, | ||
int | num | ||
) | [static] |
Definition at line 1171 of file rayshade.c.
References cosf, M_PI, QMC_getSample(), sinf, KDL::sqr(), and sqrt().
Referenced by ray_ao_qmc().
static void QMC_samplePhong | ( | float | vec[3], |
QMCSampler * | qsa, | ||
int | thread, | ||
int | num, | ||
float | blur | ||
) | [static] |
Definition at line 1126 of file rayshade.c.
References cosf, M_PI, pow(), QMC_getSample(), sinf, KDL::sqr(), and sqrt().
Referenced by trace_reflect(), and trace_refract().
static void QMC_sampleRect | ( | float | vec[3], |
QMCSampler * | qsa, | ||
int | thread, | ||
int | num, | ||
float | sizex, | ||
float | sizey | ||
) | [static] |
Definition at line 1143 of file rayshade.c.
References QMC_getSample().
Referenced by ray_shadow_qmc().
static void RandomSpherical | ( | float | v[3] | ) | [static] |
Definition at line 1751 of file rayshade.c.
References BLI_frand(), cosf, sinf, and sqrt().
Referenced by init_ao_sphere(), and sphere_sampler().
void ray_ao | ( | ShadeInput * | shi, |
float | ao[3], | ||
float | env[3] | ||
) |
Definition at line 2169 of file rayshade.c.
References ELEM, R, ray_ao_qmc(), ray_ao_spheresamp(), WO_AOSAMP_CONSTANT, WO_AOSAMP_HALTON, and WO_AOSAMP_HAMMERSLEY.
Referenced by ambient_occlusion().
static void ray_ao_qmc | ( | ShadeInput * | shi, |
float | ao[3], | ||
float | env[3] | ||
) | [static] |
Definition at line 1892 of file rayshade.c.
References adaptive_sample_contrast_val(), Isect::check, CLAMP(), ShadeInput::co, copy_v3_v3(), Isect::dir, Isect::dist, expf, Isect::face, ShadeInput::facenor, VlakRen::flag, get_avg_speed(), get_thread_qmcsampler(), Isect::hint, Isect::hit, Isect::last_hit, Isect::lay, MA_ONLYSHADOW, ShadeInput::mat, Material::mode, Isect::mode, mul_v3_fl(), normalize_v3(), NULL, Isect::ob, ShadeInput::obi, Isect::orig, ortho_basis_v3v3_v3(), QMCSampler::prev, QMC_initPixel(), QMC_sampleHemi(), R, R_SMOOTH, RE_CHECK_VLR_NON_SOLID_MATERIAL, RE_RAY_SHADOW, RE_RAY_SHADOW_TRA, RE_rayobject_hint_bb(), RE_rayobject_raycast(), RE_RC_INIT, RE_SKIP_VLR_NEIGHBOUR, release_thread_qmcsampler(), SAMP_TYPE_HALTON, SAMP_TYPE_HAMMERSLEY, shadeSkyView(), shadeSunView(), Isect::skip, Isect::start, ShadeInput::thread, QMCSampler::type, ShadeInput::view, ShadeInput::vlr, ShadeInput::vn, WO_AODIST, WO_AOPLAIN, WO_AOSAMP_HALTON, WO_AOSAMP_HAMMERSLEY, WO_AOSKYCOL, WO_AOSKYTEX, and zero_v3().
Referenced by ray_ao().
static void ray_ao_spheresamp | ( | ShadeInput * | shi, |
float | ao[3], | ||
float | env[3] | ||
) | [static] |
Definition at line 2041 of file rayshade.c.
References Isect::check, ShadeInput::co, copy_v3_v3(), Isect::dir, Isect::dist, expf, Isect::face, ShadeInput::facenor, VlakRen::flag, Isect::hint, Isect::hit, Isect::last_hit, Isect::lay, MA_ONLYSHADOW, ShadeInput::mask, ShadeInput::mat, Material::mode, Isect::mode, mul_v3_fl(), normalize_v3(), NULL, Isect::ob, ShadeInput::obi, Isect::orig, R, R_OSA, R_SMOOTH, RE_CHECK_VLR_RENDER, RE_RAY_SHADOW, RE_RAY_SHADOW_TRA, RE_rayobject_hint_bb(), RE_rayobject_raycast(), RE_RC_INIT, RE_SKIP_VLR_NEIGHBOUR, shadeSkyView(), shadeSunView(), Isect::skip, sphere_sampler(), Isect::start, ShadeInput::strand, ShadeInput::thread, QMCSampler::tot, ShadeInput::view, ShadeInput::vlr, ShadeInput::vn, WO_AODIST, WO_AOPLAIN, WO_AOSKYCOL, WO_AOSKYTEX, ShadeInput::xs, ShadeInput::ys, and zero_v3().
Referenced by ray_ao().
static void ray_fadeout | ( | Isect * | is, |
ShadeInput * | shi, | ||
float | col[3], | ||
const float | blendcol[3], | ||
float | dist_mir | ||
) | [static] |
Definition at line 712 of file rayshade.c.
References ShadeInput::co, len_v3v3(), and Isect::start.
Referenced by traceray().
static void ray_fadeout_endcolor | ( | float | col[3], |
ShadeInput * | origshi, | ||
ShadeInput * | shi, | ||
ShadeResult * | shr, | ||
Isect * | isec, | ||
const float | vec[3] | ||
) | [static] |
Definition at line 698 of file rayshade.c.
References ShadeResult::combined, copy_v3_v3(), Material::fadeto_mir, MA_RAYMIR_FADETOMAT, MA_RAYMIR_FADETOSKY, ShadeInput::mat, normalize_v3(), NULL, shadeSkyView(), shadeSunView(), Isect::start, ShadeInput::thread, and ShadeInput::view.
Referenced by traceray().
void ray_shadow | ( | ShadeInput * | shi, |
LampRen * | lar, | ||
float | shadfac[4] | ||
) |
Definition at line 2477 of file rayshade.c.
References LampRen::co, ShadeInput::co, copy_v3_v3(), copy_v4_v4(), ShadeInput::depth, DEPTH_SHADOW_TRA, Isect::dir, Isect::dist, ELEM, Isect::face, Isect::hint, LA_HEMI, LA_LAYER, LA_LAYER_SHADOW, LA_SAMP_HALTON, LA_SAMP_HAMMERSLEY, LA_SUN, LampRen::last_hit, Isect::last_hit, LampRen::lay, Isect::lay, MA_SHADOW_TRA, ShadeInput::mat, LampRen::mode, Isect::mode, Material::mode, normalize_v3(), NULL, Isect::ob, ShadeInput::obi, Isect::orig, R, LampRen::ray_samp_method, ray_shadow_jitter(), ray_shadow_qmc(), LampRen::ray_totsamp, ray_trace_shadow_tra(), RE_RAY_SHADOW, RE_RAY_SHADOW_TRA, RE_rayobject_raycast(), RE_RC_INIT, Isect::start, sub_v3_v3v3(), ShadeInput::thread, LampRen::type, LampRen::vec, and ShadeInput::vlr.
Referenced by lamp_get_shadow().
static void ray_shadow_jitter | ( | ShadeInput * | shi, |
LampRen * | lar, | ||
const float | lampco[3], | ||
float | shadfac[4], | ||
Isect * | isec | ||
) | [static] |
Definition at line 2393 of file rayshade.c.
References Isect::check, ShadeInput::co, copy_v3_v3(), DEPTH_SHADOW_TRA, Isect::dir, Isect::dist, div, Isect::face, give_jitter_plane(), Isect::hint, LA_SAMP_UMBRA, ShadeInput::mask, LampRen::mat, Isect::mode, mul_m3_v3(), Isect::ob, ShadeInput::obi, Isect::orig, R, R_OSA, LampRen::ray_samp_type, LampRen::ray_totsamp, ray_trace_shadow_tra(), RE_CHECK_VLR_RENDER, RE_RAY_SHADOW_TRA, RE_rayobject_hint_bb(), RE_rayobject_raycast(), RE_SKIP_VLR_NEIGHBOUR, Isect::skip, sqrt(), Isect::start, ShadeInput::thread, ShadeInput::vlr, ShadeInput::xs, and ShadeInput::ys.
Referenced by ray_shadow().
static void ray_shadow_jittered_coords | ( | ShadeInput * | shi, |
int | max, | ||
float | jitco[RE_MAX_OSA][3], | ||
int * | totjitco | ||
) | [static] |
Definition at line 2181 of file rayshade.c.
References ShadeInput::co, copy_v3_v3(), count_mask(), ShadeInput::depth, ShadeInput::mask, NULL, R, ShadeInput::scanco, shade_input_calc_viewco(), ShadeInput::strand, and QMCSampler::tot.
Referenced by ray_shadow_qmc().
static void ray_shadow_qmc | ( | ShadeInput * | shi, |
LampRen * | lar, | ||
const float | lampco[3], | ||
float | shadfac[4], | ||
Isect * | isec | ||
) | [static] |
Definition at line 2221 of file rayshade.c.
References LampRen::adapt_thresh, adaptive_sample_variance(), LampRen::area_size, LampRen::area_sizey, Isect::check, co, copy_v3_v3(), ShadeInput::depth, DEPTH_SHADOW_TRA, Isect::dir, Isect::dist, DO_MINMAX, ShadeInput::dxco, ShadeInput::dyco, Isect::face, VlakRen::flag, get_thread_qmcsampler(), Isect::hint, i, INIT_MINMAX, LA_LOCAL, LA_SAMP_HALTON, LA_SAMP_HAMMERSLEY, len_v3(), LampRen::mat, max, min, Isect::mode, mul_m3_v3(), normalize_v3(), NULL, Isect::ob, ShadeInput::obi, Isect::orig, ortho_basis_v3v3_v3(), QMC_initPixel(), QMC_sampleDisc(), QMC_sampleRect(), R, R_FULL_OSA, R_OSA, LampRen::ray_samp_method, ray_shadow_jittered_coords(), LampRen::ray_totsamp, ray_trace_shadow_tra(), RE_CHECK_VLR_RENDER, RE_MAX_OSA, RE_RAY_SHADOW_TRA, RE_rayobject_hint_bb(), RE_rayobject_raycast(), RE_SKIP_VLR_NEIGHBOUR, release_thread_qmcsampler(), SAMP_TYPE_HALTON, SAMP_TYPE_HAMMERSLEY, Isect::skip, Isect::start, ShadeInput::strand, sub_v3_v3v3(), ShadeInput::thread, LampRen::type, and ShadeInput::vlr.
Referenced by ray_shadow().
void ray_trace | ( | ShadeInput * | shi, |
ShadeResult * | shr | ||
) |
Definition at line 1515 of file rayshade.c.
References add_v3_v3v3(), ShadeResult::alpha, ShadeInput::b, ShadeResult::combined, ShadeInput::combinedflag, copy_v3_v3(), ShadeInput::depth, KDL::diff(), fb(), Material::filter, fresnel_fac(), Material::fresnel_mir, Material::fresnel_mir_i, ShadeInput::g, i, MA_RAYMIRROR, MA_RAYTRANSP, MA_TRANSP, ShadeInput::mat, MIN2, ShadeInput::mirb, ShadeInput::mirg, ShadeInput::mirr, Material::mode, ShadeInput::mode, ShadeInput::passflag, ShadeInput::r, Material::ray_depth, Material::ray_depth_tra, ShadeInput::ray_mirror, ShadeResult::refl, ShadeResult::refr, SCE_PASS_REFLECT, SCE_PASS_REFRACT, SCE_PASS_SPEC, ShadeResult::spec, sub_v3_v3v3(), trace_reflect(), trace_refract(), ShadeInput::view, and ShadeInput::vn.
Referenced by shade_material_loop().
static int UNUSED_FUNCTION() ray_trace_shadow_rad | ( | ShadeInput * | ship, |
ShadeResult * | shr | ||
) | [static] |
Definition at line 1679 of file rayshade.c.
References assert, copy_v3_v3(), ShadeResult::diff, Isect::dir, Isect::dist, div, Isect::face, hashvectf, Isect::hint, Isect::mode, Isect::ob, Isect::orig, R, RE_RAY_MIRROR, RE_rayobject_raycast(), RE_RAYTRACE_MAXDIST, RE_RC_INIT, shade_ray(), ShadeResult::spec, and Isect::start.
static void ray_trace_shadow_tra | ( | Isect * | is, |
ShadeInput * | origshi, | ||
int | depth, | ||
int | traflag, | ||
float | col[4] | ||
) | [static] |
Definition at line 1616 of file rayshade.c.
References addAlphaLight(), ShadeResult::alpha, ShadeInput::co, ShadeResult::combined, ShadeInput::combinedflag, copy_v3_v3(), simple_enum_gen::d, ShadeInput::depth, ShadeResult::diff, Isect::dist, Isect::face, Material::filter, ShadeInput::lay, MA_TYPE_SURFACE, MA_TYPE_VOLUME, ShadeInput::mask, ShadeInput::mat, Material::material_type, ShadeInput::nodes, NULL, Isect::ob, ShadeInput::obi, Isect::orig, ShadeInput::passflag, R, RAY_TRA, RE_rayobject_raycast(), RE_RC_MERGE, SCE_PASS_COMBINED, shade_by_transmission(), shade_ray(), Isect::start, ShadeInput::thread, ShadeInput::vlr, ShadeInput::xs, and ShadeInput::ys.
Referenced by ray_shadow(), ray_shadow_jitter(), and ray_shadow_qmc().
Definition at line 88 of file rayshade.c.
References RayObject::control, RayObjectControl::data, RE_rayobject_align, RE_rayobject_isRayAPI, RayObjectControl::test_break, and test_break().
Referenced by RE_rayobject_create().
Definition at line 98 of file rayshade.c.
References BLI_cpu_support_sse2(), NULL, RenderData::ocres, Render::r, R_RAYSTRUCTURE_AUTO, R_RAYSTRUCTURE_BLIBVH, R_RAYSTRUCTURE_OCTREE, R_RAYSTRUCTURE_SIMD_QBVH, R_RAYSTRUCTURE_SIMD_SVBVH, R_RAYSTRUCTURE_VBVH, RE_rayobject_blibvh_create(), RE_rayobject_config_control(), RE_rayobject_octree_create(), RE_rayobject_qbvh_create(), RE_rayobject_svbvh_create(), and RE_rayobject_vbvh_create().
Referenced by makeraytree_object(), and makeraytree_single().
static void reflection | ( | float | ref[3], |
float | n[3], | ||
const float | view[3], | ||
const float | orn[3] | ||
) | [static] |
Definition at line 629 of file rayshade.c.
References dot_v3v3(), and reflection_simple().
Referenced by reflection(), trace_reflect(), trace_refract(), traceray(), and vol_get_reflection_color().
static void reflection_simple | ( | float | ref[3], |
float | n[3], | ||
const float | view[3] | ||
) | [static] |
Definition at line 622 of file rayshade.c.
References dot_v3v3(), and madd_v3_v3v3fl().
Referenced by reflection(), trace_reflect(), trace_refract(), and traceray().
static int refraction | ( | float | refract[3], |
const float | n[3], | ||
const float | view[3], | ||
float | index | ||
) | [static] |
Definition at line 595 of file rayshade.c.
References copy_v3_v3(), dot(), and sqrtf.
Referenced by trace_refract(), and traceray().
static void release_thread_qmcsampler | ( | Render * | UNUSEDre, |
int | UNUSEDthread, | ||
QMCSampler * | qsa | ||
) | [static] |
Definition at line 1232 of file rayshade.c.
References QMCSampler::used.
Referenced by ray_ao_qmc(), ray_shadow_qmc(), trace_reflect(), and trace_refract().
static float shade_by_transmission | ( | Isect * | is, |
ShadeInput * | shi, | ||
ShadeResult * | shr | ||
) | [static] |
Definition at line 666 of file rayshade.c.
References ShadeResult::alpha, ShadeInput::co, simple_enum_gen::d, MA_TRANSP, ShadeInput::mat, Material::mode, p, powf, sqrt(), Isect::start, Material::tx_falloff, and Material::tx_limit.
Referenced by ray_trace_shadow_tra(), and traceray().
void shade_ray | ( | Isect * | is, |
ShadeInput * | shi, | ||
ShadeResult * | shr | ||
) |
Definition at line 529 of file rayshade.c.
References ShadeInput::co, ShadeResult::combined, copy_v3_v3(), ShadeResult::diff, Isect::dir, Isect::dist, ShadeInput::dx_u, ShadeInput::dx_v, ShadeInput::dy_u, ShadeInput::dy_v, ELEM, Isect::face, Isect::hit, Isect::isect, MA_TYPE_VOLUME, ShadeInput::mat, Material::material_type, Isect::mode, ShadeInput::nodes, Material::nodetree, normalize_v3(), ntreeShaderExecTree(), Isect::ob, ShadeInput::obi, ObjectInstanceRen::obr, ShadeInput::obr, ShadeInput::osatex, RE_RAY_SHADOW, RE_RAY_SHADOW_TRA, shade_color(), shade_input_init_material(), shade_input_set_normals(), shade_input_set_shade_texco(), shade_input_set_triangle_i(), shade_material_loop(), shade_ray_set_derivative(), shade_volume_outside(), shade_volume_shadow(), ShadeResult::spec, Isect::start, sub_v3_v3v3(), Isect::u, ShadeInput::u, Material::use_nodes, Isect::v, ShadeInput::v, ShadeInput::view, and ShadeInput::vlr.
Referenced by ray_trace_shadow_rad(), ray_trace_shadow_tra(), shade_intersection(), and traceray().
static void shade_ray_set_derivative | ( | ShadeInput * | shi | ) | [static] |
Definition at line 487 of file rayshade.c.
References axis_dominant_v3(), VertRen::co, ShadeInput::dx_u, ShadeInput::dx_v, ShadeInput::dxco, ShadeInput::dy_u, ShadeInput::dy_v, ShadeInput::dyco, ShadeInput::facenor, ObjectInstanceRen::flag, mul_v3_m3v3(), ObjectInstanceRen::nmat, ShadeInput::obi, R_TRANSFORMED, ShadeInput::v1, ShadeInput::v2, and ShadeInput::v3.
Referenced by shade_ray().
static float* sphere_sampler | ( | int | type, |
int | resol, | ||
int | thread, | ||
int | xs, | ||
int | ys, | ||
int | reset | ||
) | [static] |
Definition at line 1839 of file rayshade.c.
References BLI_thread_frand(), cos(), NULL, R, RandomSpherical(), sin(), threadsafe_table_sphere(), QMCSampler::tot, and WO_AORNDSMP.
Referenced by ray_ao_spheresamp().
static int test_break | ( | void * | data | ) | [static] |
Definition at line 82 of file rayshade.c.
References Render::tbh, and Render::test_break.
Referenced by makeraytree(), makeraytree_object(), makeraytree_single(), RE_rayobject_config_control(), RE_rayobject_set_control(), and threaded_makeshadowbufs().
static float* threadsafe_table_sphere | ( | int | test, |
int | thread, | ||
int | xs, | ||
int | ys, | ||
int | tot | ||
) | [static] |
Definition at line 1822 of file rayshade.c.
References BLENDER_MAX_THREADS, NULL, and R.
Referenced by sphere_sampler().
static void trace_reflect | ( | float | col[3], |
ShadeInput * | shi, | ||
ShadeResult * | shr, | ||
float | fresnelfac | ||
) | [static] |
Definition at line 1406 of file rayshade.c.
References Material::adapt_thresh_mir, adaptive_sample_variance(), add_v3_v3(), add_v3_v3v3(), Material::aniso_gloss_mir, ShadeInput::co, copy_v3_v3(), cross_v3_v3v3(), ShadeInput::facenor, VlakRen::flag, get_thread_qmcsampler(), Material::gloss_mir, MA_TANGENT_V, ShadeInput::mat, Material::mode, mul_v3_fl(), normalize_v3(), NULL, ShadeInput::obi, ortho_basis_v3v3_v3(), powf, QMC_initPixel(), QMC_samplePhong(), R, R_SMOOTH, Material::ray_depth, reflection(), reflection_simple(), release_thread_qmcsampler(), Material::samp_gloss_mir, SAMP_TYPE_HALTON, SAMP_TYPE_HAMMERSLEY, ShadeInput::tang, ShadeInput::thread, traceray(), ShadeInput::view, ShadeInput::vlr, and ShadeInput::vn.
Referenced by ray_trace().
static void trace_refract | ( | float | col[4], |
ShadeInput * | shi, | ||
ShadeResult * | shr | ||
) | [static] |
Definition at line 1306 of file rayshade.c.
References Material::adapt_thresh_tra, adaptive_sample_variance(), add_v3_v3(), add_v3_v3v3(), ShadeResult::alpha, ShadeInput::ang, ShadeInput::co, copy_v3_v3(), ShadeInput::facenor, VlakRen::flag, get_thread_qmcsampler(), Material::gloss_tra, ShadeInput::mat, mul_v3_fl(), normalize_v3(), NULL, ShadeInput::obi, ortho_basis_v3v3_v3(), powf, QMC_initPixel(), QMC_samplePhong(), R, R_SMOOTH, Material::ray_depth_tra, RAY_INSIDE, reflection(), reflection_simple(), refraction(), release_thread_qmcsampler(), Material::samp_gloss_tra, SAMP_TYPE_HALTON, SAMP_TYPE_HAMMERSLEY, ShadeInput::thread, traceray(), ShadeInput::view, ShadeInput::vlr, and ShadeInput::vn.
Referenced by ray_trace().
static void traceray | ( | ShadeInput * | origshi, |
ShadeResult * | origshr, | ||
short | depth, | ||
const float | start[3], | ||
const float | dir[3], | ||
float | col[4], | ||
ObjectInstanceRen * | obi, | ||
VlakRen * | vlr, | ||
int | traflag | ||
) | [static] |
Definition at line 726 of file rayshade.c.
References ShadeResult::alpha, ShadeInput::ang, ShadeInput::b, Isect::check, ShadeInput::co, ShadeInput::combinedflag, copy_v3_v3(), simple_enum_gen::d, ShadeInput::depth, ShadeResult::diff, Isect::dir, Isect::dist, Material::dist_mir, ShadeInput::dxco, ShadeInput::dyco, Isect::face, fb(), Material::filter, fresnel_fac(), Material::fresnel_mir, Material::fresnel_mir_i, ShadeInput::g, Isect::hint, ShadeInput::lay, ShadeInput::light_override, MA_RAYMIRROR, MA_RAYTRANSP, MA_TRANSP, MA_ZTRANSP, ShadeInput::mask, ShadeInput::mat, ShadeInput::mat_override, ShadeInput::mirb, ShadeInput::mirg, ShadeInput::mirr, Material::mode, Isect::mode, Material::mode_l, norm(), Isect::ob, ShadeInput::obi, Isect::orig, ShadeInput::osatex, ShadeInput::passflag, ShadeInput::r, R, ray_fadeout(), ray_fadeout_endcolor(), RAY_INSIDE, ShadeInput::ray_mirror, RE_CHECK_VLR_RENDER, RE_RAY_MIRROR, RE_rayobject_raycast(), RE_RAYTRACE_MAXDIST, RE_RC_INIT, RE_RC_MERGE, RE_SKIP_VLR_NEIGHBOUR, reflection(), reflection_simple(), refract(), refraction(), SCE_PASS_COMBINED, shade_by_transmission(), shade_ray(), Isect::skip, ShadeResult::spec, Isect::start, ShadeInput::thread, ShadeInput::view, ShadeInput::vlr, ShadeInput::vn, ShadeInput::xs, and ShadeInput::ys.
Referenced by trace_reflect(), and trace_refract().
Definition at line 127 of file pipeline.c.