Blender V2.61 - r43446
Classes | Defines | Typedefs | Functions

shading.h File Reference

Go to the source code of this file.

Classes

struct  ShadeSample

Defines

#define RE_MAX_OSA   16

Typedefs

typedef struct ShadeSample ShadeSample

Functions

void shade_material_loop (struct ShadeInput *shi, struct ShadeResult *shr)
void shade_volume_loop (struct ShadeInput *shi, struct ShadeResult *shr)
void shade_input_set_triangle_i (struct ShadeInput *shi, struct ObjectInstanceRen *obi, struct VlakRen *vlr, short i1, short i2, short i3)
void shade_input_set_triangle (struct ShadeInput *shi, volatile int obi, volatile int facenr, int normal_flip)
void shade_input_copy_triangle (struct ShadeInput *shi, struct ShadeInput *from)
void shade_input_calc_viewco (struct ShadeInput *shi, float x, float y, float z, float view[3], float *dxyview, float *co, float *dxco, float *dyco)
void shade_input_set_viewco (struct ShadeInput *shi, float x, float y, float sx, float sy, float z)
void shade_input_set_uv (struct ShadeInput *shi)
void shade_input_set_normals (struct ShadeInput *shi)
void shade_input_set_vertex_normals (struct ShadeInput *shi)
void shade_input_flip_normals (struct ShadeInput *shi)
void shade_input_set_shade_texco (struct ShadeInput *shi)
void shade_input_set_strand (struct ShadeInput *shi, struct StrandRen *strand, struct StrandPoint *spoint)
void shade_input_set_strand_texco (struct ShadeInput *shi, struct StrandRen *strand, struct StrandVert *svert, struct StrandPoint *spoint)
void shade_input_do_shade (struct ShadeInput *shi, struct ShadeResult *shr)
void shade_input_init_material (struct ShadeInput *shi)
void shade_input_initialize (struct ShadeInput *shi, struct RenderPart *pa, struct RenderLayer *rl, int sample)
void shade_sample_initialize (struct ShadeSample *ssamp, struct RenderPart *pa, struct RenderLayer *rl)
void shade_samples_do_AO (struct ShadeSample *ssamp)
void shade_samples_fill_with_ps (struct ShadeSample *ssamp, struct PixStr *ps, int x, int y)
int shade_samples (struct ShadeSample *ssamp, struct PixStr *ps, int x, int y)
void vlr_set_uv_indices (struct VlakRen *vlr, int *i1, int *i2, int *i3)
void calc_R_ref (struct ShadeInput *shi)
void shade_lamp_loop (struct ShadeInput *shi, struct ShadeResult *shr)
void shade_color (struct ShadeInput *shi, ShadeResult *shr)
void ambient_occlusion (struct ShadeInput *shi)
void environment_lighting_apply (struct ShadeInput *shi, struct ShadeResult *shr)
ListBaseget_lights (struct ShadeInput *shi)
float lamp_get_visibility (struct LampRen *lar, const float co[3], float lv[3], float *dist)
void lamp_get_shadow (struct LampRen *lar, ShadeInput *shi, float inp, float shadfac[4], int do_real)
float fresnel_fac (float *view, float *vn, float fresnel, float fac)
void shade_ray (struct Isect *is, struct ShadeInput *shi, struct ShadeResult *shr)

Detailed Description

Definition in file shading.h.


Define Documentation

#define RE_MAX_OSA   16

Typedef Documentation

typedef struct ShadeSample ShadeSample

Function Documentation

void ambient_occlusion ( struct ShadeInput shi)
void calc_R_ref ( struct ShadeInput shi)
void environment_lighting_apply ( struct ShadeInput shi,
struct ShadeResult shr 
)
float fresnel_fac ( float *  view,
float *  vn,
float  fresnel,
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 ( struct ShadeInput shi)
void lamp_get_shadow ( struct LampRen lar,
ShadeInput shi,
float  inp,
float  shadfac[4],
int  do_real 
)
float lamp_get_visibility ( struct LampRen lar,
const float  co[3],
float  lv[3],
float *  dist 
)
void shade_color ( struct ShadeInput shi,
ShadeResult shr 
)
void shade_input_calc_viewco ( struct ShadeInput shi,
float  x,
float  y,
float  z,
float  view[3],
float *  dxyview,
float *  co,
float *  dxco,
float *  dyco 
)
void shade_input_copy_triangle ( struct ShadeInput shi,
struct ShadeInput from 
)

Definition at line 324 of file shadeinput.c.

Referenced by shade_samples_fill_with_ps(), and shade_tra_samples_fill().

void shade_input_do_shade ( struct ShadeInput shi,
struct ShadeResult shr 
)
void shade_input_flip_normals ( struct ShadeInput shi)
void shade_input_init_material ( struct ShadeInput shi)
void shade_input_initialize ( struct ShadeInput shi,
struct RenderPart pa,
struct RenderLayer rl,
int  sample 
)
void shade_input_set_normals ( struct ShadeInput shi)
void shade_input_set_shade_texco ( struct ShadeInput shi)

Definition at line 891 of file shadeinput.c.

References VertRen::accum, ShadeInput::actcol, ObjectRen::actmcol, ObjectRen::actmtface, ShadeInput::actuv, VertRen::co, ShadeInput::co, ShadeInputCol::col, ShadeInput::col, copy_m4_m4(), copy_v3_v3(), ShadeInput::depth, ShadeInput::do_manage, ShadeInput::duplilo, ObjectInstanceRen::dupliorco, ObjectInstanceRen::dupliuv, ShadeInput::dupliuv, ShadeInput::dx_u, ShadeInput::dx_v, ShadeInput::dxco, ShadeInput::dxgl, ShadeInput::dxlo, ShadeInput::dxno, ShadeInput::dxsticky, ShadeInput::dxstrand, ShadeInputUV::dxuv, ShadeInput::dxwin, ShadeInput::dy_u, ShadeInput::dy_v, ShadeInput::dyco, ShadeInput::dygl, ShadeInput::dylo, ShadeInput::dyno, ShadeInput::dysticky, ShadeInput::dystrand, ShadeInputUV::dyuv, ShadeInput::dywin, ObjectInstanceRen::flag, VlakRen::flag, ShadeInput::gl, i, ShadeInput::i1, ShadeInput::i2, ShadeInput::i3, ShadeInput::lo, MA_FACETEXTURE, MA_NORMAP_TANG, MA_STR_SURFDIFF, MA_TANGENT_V, MA_VERTEXCOL, MA_VERTEXCOLP, ObjectInstanceRen::mat, ShadeInput::mat, ShadeInput::mode, mul_m3_v3(), mul_m4_v3(), mul_mat3_m4_v3(), mul_v3_fl(), mult_m4_m4m4(), ShadeInput::n1, ShadeInput::n2, ShadeInput::n3, ShadeInputUV::name, ShadeInputCol::name, Render::name, NEED_UV, ShadeInput::nmaptang, ObjectInstanceRen::nmat, normalize_v3(), ShadeInput::obi, ShadeInput::obr, VertRen::orco, ShadeInput::orn, ShadeInput::osatex, ShadeInput::passflag, R, R_NEED_TANGENT, R_SMOOTH, R_SPEED, R_TRANSFORMED, RE_vertren_get_sticky(), RE_vertren_get_stress(), RE_vertren_get_tangent(), RE_vertren_get_winspeed(), RE_vlakren_get_mcol(), RE_vlakren_get_nmap_tangent(), RE_vlakren_get_surfnor(), RE_vlakren_get_tface(), render_realtime_texture(), SCE_PASS_UV, srgb_to_linearrgb_v3_v3(), ShadeInput::sticky, ShadeInput::strandco, ShadeInput::stress, ShadeInput::surfdist, ShadeInput::surfnor, ShadeInput::tang, Material::texco, TEXCO_GLOB, TEXCO_NORM, TEXCO_ORCO, TEXCO_REFL, TEXCO_STICKY, TEXCO_STRAND, TEXCO_STRESS, TEXCO_TANGENT, TEXCO_UV, TEXCO_WINDOW, ShadeInput::totcol, ShadeInput::totuv, MTFace::tpage, ShadeInput::u, ShadeInputUV::uv, MTFace::uv, ShadeInput::uv, ShadeInput::v, ShadeInput::v1, ShadeInput::v2, ShadeInput::v3, ShadeInput::vcol, ShadeInput::vlr, vlr_set_uv_indices(), ShadeInput::vn, ShadeInput::winco, Render::winmat, ShadeInput::winspeed, ShadeInput::xs, ShadeInput::ys, zbuf_make_winmat(), and zbuf_render_project().

Referenced by bake_shade(), do_bake_shade(), occ_shade(), shade_ray(), shade_sample_sss(), shade_samples(), and shade_tra_samples().

void shade_input_set_strand ( struct ShadeInput shi,
struct StrandRen strand,
struct StrandPoint spoint 
)
void shade_input_set_strand_texco ( struct ShadeInput shi,
struct StrandRen strand,
struct StrandVert svert,
struct StrandPoint spoint 
)

Definition at line 375 of file shadeinput.c.

References ShadeInput::actcol, ObjectRen::actmcol, ObjectRen::actmtface, ShadeInput::actuv, StrandRen::buffer, ShadeInput::co, StrandVert::co, ShadeInput::col, ShadeInputCol::col, copy_v3_v3(), copy_v4_v4(), ShadeInput::depth, ShadeInput::do_manage, StrandPoint::dtstrandco, ShadeInput::dxco, ShadeInput::dxgl, ShadeInput::dxstrand, ShadeInputUV::dxuv, ShadeInput::dxwin, ShadeInput::dyco, ShadeInput::dygl, ShadeInput::dystrand, ShadeInputUV::dyuv, ShadeInput::dywin, ShadeInput::gl, i, len_v3v3(), ShadeInput::lo, MA_FACETEXTURE, MA_NORMAP_TANG, MA_STR_SURFDIFF, MA_TANGENT_V, MA_VERTEXCOL, MA_VERTEXCOLP, ShadeInput::mat, ShadeInput::mode, mul_m4_v3(), mul_mat3_m4_v3(), Render::name, ShadeInputUV::name, ShadeInputCol::name, NEED_UV, ShadeInput::nmaptang, ShadeInput::obi, StrandBuffer::obr, StrandRen::orco, ShadeInput::orn, ShadeInput::osatex, StrandBuffer::overrideuv, R, R_SPEED, RE_strandren_get_mcol(), RE_strandren_get_surfnor(), RE_strandren_get_uv(), RE_strandren_get_winspeed(), srgb_to_linearrgb_v3_v3(), Material::strand_surfnor, ShadeInput::strandco, StrandPoint::strandco, ShadeInput::surfdist, ShadeInput::surfnor, StrandPoint::t, StrandPoint::tan, ShadeInput::tang, Material::texco, TEXCO_GLOB, TEXCO_NORM, TEXCO_ORCO, TEXCO_REFL, TEXCO_STICKY, TEXCO_STRAND, TEXCO_STRESS, TEXCO_TANGENT, TEXCO_UV, TEXCO_WINDOW, ShadeInput::totcol, ShadeInput::totuv, ShadeInputUV::uv, ShadeInput::uv, ShadeInput::vcol, StrandRen::vert, ShadeInput::vn, ShadeInput::winco, ShadeInput::winspeed, StrandPoint::x, and StrandPoint::y.

Referenced by strand_shade_point().

void shade_input_set_triangle ( struct ShadeInput shi,
volatile int  obi,
volatile int  facenr,
int  normal_flip 
)
void shade_input_set_triangle_i ( struct ShadeInput shi,
struct ObjectInstanceRen obi,
struct VlakRen vlr,
short  i1,
short  i2,
short  i3 
)
void shade_input_set_uv ( struct ShadeInput shi)
void shade_input_set_vertex_normals ( struct ShadeInput shi)
void shade_input_set_viewco ( struct ShadeInput shi,
float  x,
float  y,
float  sx,
float  sy,
float  z 
)
void shade_lamp_loop ( struct ShadeInput shi,
struct 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, ShadeResult::ao, ShadeInput::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(), ShadeResult::indirect, ShadeInput::indirect, indirect_lighting_apply(), LA_LAYER, LA_YF_PHOTON, GroupObject::lampren, ShadeInput::lay, LampRen::lay, ObjectInstanceRen::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(), ShadeInput::r, 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().

void shade_material_loop ( struct ShadeInput shi,
struct ShadeResult shr 
)
void shade_ray ( struct Isect is,
struct ShadeInput shi,
struct ShadeResult shr 
)
void shade_sample_initialize ( struct ShadeSample ssamp,
struct RenderPart pa,
struct RenderLayer rl 
)
int shade_samples ( struct ShadeSample ssamp,
struct PixStr ps,
int  x,
int  y 
)
void shade_samples_do_AO ( struct ShadeSample ssamp)
void shade_samples_fill_with_ps ( struct ShadeSample ssamp,
struct PixStr ps,
int  x,
int  y 
)
void shade_volume_loop ( struct ShadeInput shi,
struct ShadeResult shr 
)
void vlr_set_uv_indices ( struct VlakRen vlr,
int *  i1,
int *  i2,
int *  i3 
)