Blender V2.61 - r43446
Functions | Variables

shadeoutput.c File Reference

#include <stdio.h>
#include <float.h>
#include <math.h>
#include <string.h>
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BKE_colortools.h"
#include "BKE_material.h"
#include "BKE_texture.h"
#include "DNA_group_types.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
#include "occlusion.h"
#include "renderpipeline.h"
#include "render_types.h"
#include "pixelblending.h"
#include "rendercore.h"
#include "shadbuf.h"
#include "sss.h"
#include "texture.h"
#include "shading.h"

Go to the source code of this file.

Functions

ListBaseget_lights (ShadeInput *shi)
float mistfactor (float zcor, float const co[3])
static void spothalo (struct LampRen *lar, ShadeInput *shi, float *intens)
void renderspothalo (ShadeInput *shi, float col[4], float alpha)
static double Normalize_d (double *n)
float fresnel_fac (float *view, float *vn, float grad, float fac)
static double saacos_d (double fac)
static float area_lamp_energy (float(*area)[3], float *co, float *vn)
static float area_lamp_energy_multisample (LampRen *lar, float *co, float *vn)
static float spec (float inp, int hard)
static float Phong_Spec (float *n, float *l, float *v, int hard, int tangent)
static float CookTorr_Spec (float *n, float *l, float *v, int hard, int tangent)
static float Blinn_Spec (float *n, float *l, float *v, float refrac, float spec_power, int tangent)
static float Toon_Spec (float *n, float *l, float *v, float size, float smooth, int tangent)
static float WardIso_Spec (float *n, float *l, float *v, float rms, int tangent)
static float Toon_Diff (float *n, float *l, float *UNUSED(v), float size, float smooth)
static float OrenNayar_Diff (float nl, float *n, float *l, float *v, float rough)
static float Minnaert_Diff (float nl, float *n, float *v, float darkness)
static float Fresnel_Diff (float *vn, float *lv, float *UNUSED(view), float fac_i, float fac)
void calc_R_ref (ShadeInput *shi)
void shade_color (ShadeInput *shi, ShadeResult *shr)
static void ramp_diffuse_result (float *diff, ShadeInput *shi)
static void add_to_diffuse (float *diff, ShadeInput *shi, float is, float r, float g, float b)
static void ramp_spec_result (float spec_col[3], ShadeInput *shi)
static void do_specular_ramp (ShadeInput *shi, float is, float t, float spec[3])
void ambient_occlusion (ShadeInput *shi)
static void ambient_occlusion_apply (ShadeInput *shi, ShadeResult *shr)
void environment_lighting_apply (ShadeInput *shi, ShadeResult *shr)
static void indirect_lighting_apply (ShadeInput *shi, ShadeResult *shr)
void lamp_get_shadow (LampRen *lar, ShadeInput *shi, float inp, float shadfac[4], int do_real)
float lamp_get_visibility (LampRen *lar, const float co[3], float lv[3], float *dist)
static void shade_one_light (LampRen *lar, ShadeInput *shi, ShadeResult *shr, int passflag)
static void shade_lamp_loop_only_shadow (ShadeInput *shi, ShadeResult *shr)
static void wrld_exposure_correct (float diff[3])
void shade_lamp_loop (ShadeInput *shi, ShadeResult *shr)

Variables

struct Render R

Detailed Description

Definition in file shadeoutput.c.


Function Documentation

static void add_to_diffuse ( float *  diff,
ShadeInput shi,
float  is,
float  r,
float  g,
float  b 
) [static]
void ambient_occlusion ( ShadeInput shi)
static void ambient_occlusion_apply ( ShadeInput shi,
ShadeResult shr 
) [static]
static float area_lamp_energy ( float(*)  area[3],
float *  co,
float *  vn 
) [static]

Definition at line 431 of file shadeoutput.c.

References CROSS, cross(), Normalize_d(), saacos_d(), and VECSUB.

Referenced by area_lamp_energy_multisample().

static float area_lamp_energy_multisample ( LampRen lar,
float *  co,
float *  vn 
) [static]
static float Blinn_Spec ( float *  n,
float *  l,
float *  v,
float  refrac,
float  spec_power,
int  tangent 
) [static]

Definition at line 597 of file shadeoutput.c.

References KDL::exp(), g, i, normalize_v3(), p, saacos(), sasqrt(), and sqrt().

Referenced by shade_one_light().

void calc_R_ref ( ShadeInput shi)
static float CookTorr_Spec ( float *  n,
float *  l,
float *  v,
int  hard,
int  tangent 
) [static]

Definition at line 573 of file shadeoutput.c.

References i, normalize_v3(), sasqrt(), and spec().

Referenced by shade_one_light().

static void do_specular_ramp ( ShadeInput shi,
float  is,
float  t,
float  spec[3] 
) [static]
void environment_lighting_apply ( ShadeInput shi,
ShadeResult shr 
)
static float Fresnel_Diff ( float *  vn,
float *  lv,
float *  UNUSEDview,
float  fac_i,
float  fac 
) [static]

Definition at line 808 of file shadeoutput.c.

References fresnel_fac().

Referenced by shade_one_light().

float fresnel_fac ( float *  view,
float *  vn,
float  grad,
float  fac 
)

Definition at line 406 of file shadeoutput.c.

References grad(), and powf.

Referenced by Fresnel_Diff(), ray_trace(), shade_color(), shade_lamp_loop(), and traceray().

ListBase* get_lights ( ShadeInput shi)
static void indirect_lighting_apply ( ShadeInput shi,
ShadeResult shr 
) [static]
void lamp_get_shadow ( LampRen lar,
ShadeInput shi,
float  inp,
float  shadfac[4],
int  do_real 
)
float lamp_get_visibility ( LampRen lar,
const float  co[3],
float  lv[3],
float *  dist 
)
static float Minnaert_Diff ( float  nl,
float *  n,
float *  v,
float  darkness 
) [static]

Definition at line 786 of file shadeoutput.c.

References i, MAX2, and pow().

Referenced by shade_one_light().

float mistfactor ( float  zcor,
float const  co[3] 
)

Definition at line 122 of file shadeoutput.c.

References R, and sqrt().

Referenced by shade_input_do_shade(), shadeHaloFloat(), and spothalo().

static double Normalize_d ( double *  n) [static]

Definition at line 386 of file shadeoutput.c.

References simple_enum_gen::d, and sqrt().

Referenced by area_lamp_energy().

static float OrenNayar_Diff ( float  nl,
float *  n,
float *  l,
float *  v,
float  rough 
) [static]

Definition at line 726 of file shadeoutput.c.

References A, B, i, normalize_v3(), saacos(), sinf, and tanf.

Referenced by shade_one_light().

static float Phong_Spec ( float *  n,
float *  l,
float *  v,
int  hard,
int  tangent 
) [static]

Definition at line 552 of file shadeoutput.c.

References normalize_v3(), sasqrt(), and spec().

Referenced by shade_one_light().

static void ramp_diffuse_result ( float *  diff,
ShadeInput shi 
) [static]
static void ramp_spec_result ( float  spec_col[3],
ShadeInput shi 
) [static]
void renderspothalo ( ShadeInput shi,
float  col[4],
float  alpha 
)
static double saacos_d ( double  fac) [static]

Definition at line 423 of file shadeoutput.c.

References acos(), and M_PI.

Referenced by area_lamp_energy().

void shade_color ( ShadeInput shi,
ShadeResult shr 
)
void shade_lamp_loop ( ShadeInput shi,
ShadeResult shr 
)

Definition at line 1645 of file shadeoutput.c.

References add_v3_v3(), ShadeResult::alpha, ShadeInput::alpha, ShadeInput::ambb, ShadeInput::ambg, ambient_occlusion(), ambient_occlusion_apply(), ShadeInput::ambr, ShadeInput::ao, ShadeResult::ao, ShadeInput::b, CLAMP(), ShadeInput::co, Object::col, ShadeResult::col, ShadeResult::combined, ShadeInput::combinedflag, copy_v3_v3(), copy_v4_v4(), ShadeInput::depth, ShadeResult::diff, do_material_tex(), ShadeInput::emit, ShadeResult::emit, ShadeInput::env, ShadeResult::env, environment_lighting_apply(), ListBase::first, fresnel_fac(), Material::fresnel_tra, Material::fresnel_tra_i, ShadeInput::g, get_lights(), ShadeInput::indirect, ShadeResult::indirect, indirect_lighting_apply(), LA_LAYER, LA_YF_PHOTON, GroupObject::lampren, ShadeInput::lay, ObjectInstanceRen::lay, LampRen::lay, Render::lights, MA_DIFF_SSS, MA_FACETEXTURE, MA_FACETEXTURE_ALPHA, MA_OBCOLOR, MA_ONLYSHADOW, MA_RAMP_COL, MA_RAMP_SPEC, MA_RAYTRANSP, MA_SHLESS, MA_TRANSP, MA_VERTEXCOL, MA_VERTEXCOLP, MA_ZTRANSP, ShadeInput::mat, MAX3(), ShadeInput::mirb, ShadeInput::mirg, ShadeInput::mirr, LampRen::mode, Material::mode, ShadeInput::mode, mul_v3_fl(), GroupObject::next, NULL, ObjectRen::ob, ShadeInput::obi, ShadeInput::obr, ShadeInput::passflag, pow(), R, ShadeInput::r, R_SHADOW, ramp_diffuse_result(), ramp_spec_result(), ShadeInput::refcol, ShadeResult::refl, Render::result, sample_sss(), SCE_PASS_AO, SCE_PASS_COMBINED, SCE_PASS_DIFFUSE, SCE_PASS_EMIT, SCE_PASS_ENVIRONMENT, SCE_PASS_INDIRECT, SCE_PASS_REFLECT, SCE_PASS_RGBA, SCE_PASS_SHADOW, SCE_PASS_SPEC, ShadeResult::shad, Material::shade_flag, shade_lamp_loop_only_shadow(), shade_one_light(), ShadeResult::spec, ShadeInput::spectra, Material::sss_flag, sss_pass_done(), Material::sss_texfac, sub_v3_v3v3(), Material::texco, LampRen::type, ShadeInput::vcol, ShadeInput::view, ShadeInput::vn, ShadeInput::volume_depth, WO_AMB_OCC, WO_ENV_LIGHT, WO_INDIRECT_LIGHT, and wrld_exposure_correct().

Referenced by shade_material_loop().

static void shade_lamp_loop_only_shadow ( ShadeInput shi,
ShadeResult shr 
) [static]
static void shade_one_light ( LampRen lar,
ShadeInput shi,
ShadeResult shr,
int  passflag 
) [static]

Definition at line 1235 of file shadeoutput.c.

References add_to_diffuse(), area_lamp_energy_multisample(), ShadeInput::b, LampRen::b, blend(), Blinn_Spec(), CLAMP(), LampRen::co, ShadeInput::co, CookTorr_Spec(), copy_v3_v3(), cross(), cross_v3_v3v3(), Material::darkness, ShadeInput::depth, ShadeResult::diff, Material::diff_shader, do_lamp_tex(), do_specular_ramp(), dot_v3v3(), ShadeInput::dxco, ShadeInput::dxlv, ShadeInput::dyco, ShadeInput::dylv, LampRen::energy, VlakRen::flag, Fresnel_Diff(), ShadeInput::g, LampRen::g, ShadeInput::har, i, interp_v3_v3v3(), LA_AREA, LA_HEMI, LA_NO_DIFF, LA_NO_SPEC, LA_ONLYSHADOW, LA_OSATEX, LA_SHAD_RAY, LA_SHAD_TEX, LA_SPOT, LA_TEXTURE, lamp_get_shadow(), lamp_get_visibility(), MA_CUBIC, MA_DIFF_FRESNEL, MA_DIFF_MINNAERT, MA_DIFF_ORENNAYAR, MA_DIFF_TOON, MA_RAMP_SPEC, MA_RAYBIAS, MA_SHADOW, MA_SHADOW_TRA, MA_SPEC_BLINN, MA_SPEC_COOKTORR, MA_SPEC_PHONG, MA_SPEC_WARDISO, MA_STR_SURFDIFF, MA_TANGENT_V, ShadeInput::mat, Minnaert_Diff(), Material::mode, LampRen::mode, normalize_v3(), ObjectRen::ob, ShadeInput::obr, OrenNayar_Diff(), ShadeInput::osatex, Material::param, Phong_Spec(), ShadeInput::r, LampRen::r, R, R_SHADOW, R_SMOOTH, R_TANGENT, ShadeInput::refl, Material::refrac, Material::rms, Material::roughness, Material::sbias, SCE_PASS_COMBINED, SCE_PASS_DIFFUSE, SCE_PASS_SHADOW, SCE_PASS_SPEC, ShadeResult::shad, Material::shade_flag, LampRen::shb, LampRen::shdwb, LampRen::shdwg, LampRen::shdwr, Object::smoothresh, spec(), ShadeInput::spec, ShadeResult::spec, Material::spec_shader, ShadeInput::specb, ShadeInput::specg, ShadeInput::specr, Material::strand_surfnor, ShadeInput::surfdist, ShadeInput::surfnor, ShadeInput::tang, thresh, Toon_Diff(), Toon_Spec(), LampRen::type, ShadeInput::view, ShadeInput::vlr, ShadeInput::vn, and WardIso_Spec().

Referenced by shade_lamp_loop().

static float spec ( float  inp,
int  hard 
) [static]
static void spothalo ( struct LampRen lar,
ShadeInput shi,
float *  intens 
) [static]
static float Toon_Diff ( float *  n,
float *  l,
float *  UNUSEDv,
float  size,
float  smooth 
) [static]

Definition at line 707 of file shadeoutput.c.

References saacos(), and size().

Referenced by shade_one_light().

static float Toon_Spec ( float *  n,
float *  l,
float *  v,
float  size,
float  smooth,
int  tangent 
) [static]

Definition at line 651 of file shadeoutput.c.

References normalize_v3(), saacos(), sasqrt(), and size().

Referenced by shade_one_light().

static float WardIso_Spec ( float *  n,
float *  l,
float *  v,
float  rms,
int  tangent 
) [static]

Definition at line 675 of file shadeoutput.c.

References angle(), expf, i, M_PI, MAX2, normalize_v3(), saacos(), sasqrt(), sqrtf, and KDL::tan().

Referenced by shade_one_light().

static void wrld_exposure_correct ( float  diff[3]) [static]

Definition at line 1637 of file shadeoutput.c.

References expf, and R.

Referenced by shade_lamp_loop().


Variable Documentation

struct Render R

Definition at line 127 of file pipeline.c.