Blender V2.61 - r43446
|
#include <stdio.h>
#include <math.h>
#include <string.h>
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
#include "DNA_curve_types.h"
#include "DNA_group_types.h"
#include "DNA_lamp_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_material_types.h"
#include "BKE_colortools.h"
#include "BKE_node.h"
#include "raycounter.h"
#include "renderpipeline.h"
#include "render_types.h"
#include "renderdatabase.h"
#include "rendercore.h"
#include "shadbuf.h"
#include "shading.h"
#include "strand.h"
#include "texture.h"
#include "volumetric.h"
#include "zbuf.h"
Go to the source code of this file.
Definition in file shadeinput.c.
#define VECADDISFAC | ( | v1, | |
v3, | |||
fac | |||
) | {*(v1)+= *(v3)*(fac); *(v1+1)+= *(v3+1)*(fac); *(v1+2)+= *(v3+2)*(fac);} |
Definition at line 70 of file shadeinput.c.
Referenced by shade_material_loop().
void shade_input_calc_viewco | ( | ShadeInput * | shi, |
float | x, | ||
float | y, | ||
float | z, | ||
float | view[3], | ||
float | dxyview[2], | ||
float | co[3], | ||
float | dxco[3], | ||
float | dyco[3] | ||
) |
Definition at line 590 of file shadeinput.c.
References calc_renderco_ortho(), calc_renderco_zbuf(), calc_view_vector(), ShadeInput::camera_co, VertRen::co, copy_v3_v3(), div, ShadeInput::facenor, ObjectInstanceRen::flag, MA_TYPE_WIRE, ObjectInstanceRen::mat, ShadeInput::mat, Material::material_type, mul_m4_v3(), normalize_v3(), ShadeInput::obi, R, R_ORTHO, R_TRANSFORMED, and ShadeInput::v1.
void shade_input_copy_triangle | ( | ShadeInput * | shi, |
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 | ( | ShadeInput * | shi, |
ShadeResult * | shr | ||
) |
Definition at line 156 of file shadeinput.c.
References ShadeResult::alpha, ShadeInput::co, ShadeResult::combined, copy_v3_v3(), copy_v4_v4(), len_v3(), MA_NOMIST, MA_TYPE_VOLUME, ShadeInput::mat, Material::material_type, ShadeResult::mist, mistfactor(), Material::mode, mul_v3_fl(), Material::nodetree, ShadeResult::nor, ntreeShaderExecTree(), ShadeInput::passflag, R, R_ORTHO, R_RAYTRACE, RE_RC_MERGE, SCE_PASS_MIST, SCE_PASS_NORMAL, SCE_PASS_VECTOR, shade_input_init_material(), shade_material_loop(), shade_volume_outside(), ShadeInput::thread, Material::use_nodes, ShadeInput::vn, ShadeInput::winspeed, ShadeResult::winspeed, WO_MIST, and ShadeResult::z.
Referenced by shade_samples(), shade_tra_samples(), and strand_shade_point().
void shade_input_flip_normals | ( | ShadeInput * | shi | ) |
Definition at line 870 of file shadeinput.c.
References ShadeInput::facenor, ShadeInput::flippednor, ShadeInput::nmapnorm, ShadeInput::vn, and ShadeInput::vno.
Referenced by bake_set_shade_input(), occ_shade(), shade_input_set_normals(), and shade_sample_sss().
void shade_input_init_material | ( | ShadeInput * | shi | ) |
Definition at line 96 of file shadeinput.c.
References Material::har, ShadeInput::har, ShadeInput::mat, ShadeInput::r, and Material::r.
Referenced by bake_shade(), shade_input_do_shade(), shade_material_loop(), shade_ray(), shade_sample_sss(), and strand_shade_point().
void shade_input_initialize | ( | ShadeInput * | shi, |
RenderPart * | pa, | ||
RenderLayer * | rl, | ||
int | sample | ||
) |
Definition at line 1330 of file shadeinput.c.
References ShadeInput::combinedflag, ShadeInput::do_manage, ShadeInput::do_preview, RenderLayer::lay, ShadeInput::lay, RenderLayer::layflag, ShadeInput::layflag, RenderLayer::light_override, ShadeInput::light_override, RenderLayer::mat_override, ShadeInput::mat_override, RenderLayer::pass_xor, RenderLayer::passflag, ShadeInput::passflag, R, R_COLOR_MANAGEMENT, R_MATNODE_PREVIEW, ShadeInput::sample, RenderPart::thread, and ShadeInput::thread.
Referenced by lamphalo_tile(), and shade_sample_initialize().
void shade_input_set_normals | ( | ShadeInput * | shi | ) |
Definition at line 790 of file shadeinput.c.
References copy_v3_v3(), dot_v3v3(), ShadeInput::facenor, VlakRen::flag, ShadeInput::flippednor, ShadeInput::n1, ShadeInput::n2, ShadeInput::n3, negate_v3(), ShadeInput::nmapnorm, normalize_v3(), R_SMOOTH, R_TANGENT, shade_input_flip_normals(), ShadeInput::u, ShadeInput::v, ShadeInput::view, ShadeInput::vlr, ShadeInput::vn, and ShadeInput::vno.
Referenced by bake_set_shade_input(), occ_shade(), shade_ray(), shade_sample_sss(), shade_samples_fill_with_ps(), and shade_tra_samples_fill().
void shade_input_set_shade_texco | ( | 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 | ( | ShadeInput * | shi, |
StrandRen * | strand, | ||
StrandPoint * | spoint | ||
) |
Definition at line 331 of file shadeinput.c.
References StrandRen::buffer, StrandPoint::co, ShadeInput::co, copy_v3_v3(), cross(), cross_v3_v3v3(), dot_v3v3(), StrandPoint::dsco, StrandPoint::dtco, ShadeInput::dxco, ShadeInput::dyco, ShadeInput::facenor, StrandBuffer::ma, MA_TANGENT_STR, ShadeInput::mat, ShadeInput::mat_override, Material::mode, ShadeInput::mode, Material::mode_l, negate_v3(), StrandPoint::nor, normalize_v3(), ShadeInput::osatex, R, R_SHADOW, StrandPoint::tan, Material::texco, TEXCO_OSA, ShadeInput::view, ShadeInput::vn, ShadeInput::vno, StrandPoint::x, ShadeInput::xs, StrandPoint::y, and ShadeInput::ys.
Referenced by strand_shade_point().
void shade_input_set_strand_texco | ( | ShadeInput * | shi, |
StrandRen * | strand, | ||
StrandVert * | svert, | ||
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, ShadeInputCol::col, ShadeInput::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(), ShadeInputUV::name, ShadeInputCol::name, Render::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, StrandPoint::strandco, ShadeInput::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 | ( | ShadeInput * | shi, |
volatile int | obi, | ||
volatile int | facenr, | ||
int | UNUSEDnormal_flip | ||
) |
Definition at line 302 of file shadeinput.c.
References ShadeInput::facenr, NULL, ShadeInput::obi, ObjectInstanceRen::obr, ShadeInput::obr, R, RE_findOrAddVlak(), RE_QUAD_MASK, RE_QUAD_OFFS, shade_input_set_triangle_i(), ObjectRen::totvlak, and ShadeInput::vlr.
void shade_input_set_triangle_i | ( | ShadeInput * | shi, |
ObjectInstanceRen * | obi, | ||
VlakRen * | vlr, | ||
short | i1, | ||
short | i2, | ||
short | i3 | ||
) |
Definition at line 257 of file shadeinput.c.
References copy_v3_v3(), ShadeInput::facenor, ObjectInstanceRen::flag, VlakRen::flag, ShadeInput::flippednor, ShadeInput::i1, ShadeInput::i2, ShadeInput::i3, VlakRen::mat, ShadeInput::mat, ShadeInput::mat_override, ShadeInput::mode, Material::mode_l, mul_m3_v3(), VertRen::n, ShadeInput::n1, ShadeInput::n2, ShadeInput::n3, ObjectInstanceRen::nmat, normalize_v3(), ShadeInput::obi, ObjectInstanceRen::obr, ShadeInput::obr, ShadeInput::osatex, R, R_SMOOTH, R_TRANSFORMED, RE_vlakren_get_normal(), Material::texco, TEXCO_OSA, ShadeInput::v1, VlakRen::v1, ShadeInput::v2, ShadeInput::v3, and ShadeInput::vlr.
Referenced by bake_set_shade_input(), occ_shade(), shade_input_set_triangle(), shade_ray(), and shade_sample_sss().
void shade_input_set_uv | ( | ShadeInput * | shi | ) |
Definition at line 718 of file shadeinput.c.
References axis_dominant_v3(), CLAMP(), ShadeInput::co, VertRen::co, copy_v3_v3(), ShadeInput::dx_u, ShadeInput::dx_v, ShadeInput::dxco, ShadeInput::dy_u, ShadeInput::dy_v, ShadeInput::dyco, ShadeInput::facenor, ObjectInstanceRen::flag, VlakRen::flag, len_v3v3(), ObjectInstanceRen::mat, ShadeInput::mat, mul_m4_v3(), NEED_UV, ShadeInput::obi, ShadeInput::osatex, ShadeInput::passflag, R_SMOOTH, R_TRANSFORMED, SCE_PASS_UV, Material::texco, ShadeInput::u, ShadeInput::v, ShadeInput::v1, VlakRen::v2, ShadeInput::v2, VlakRen::v3, ShadeInput::v3, and ShadeInput::vlr.
Referenced by bake_set_shade_input(), shade_sample_sss(), shade_samples_fill_with_ps(), and shade_tra_samples_fill().
void shade_input_set_vertex_normals | ( | ShadeInput * | shi | ) |
Definition at line 840 of file shadeinput.c.
References copy_v3_v3(), ShadeInput::facenor, VlakRen::flag, ShadeInput::n1, ShadeInput::n2, ShadeInput::n3, ShadeInput::nmapnorm, normalize_v3(), R_SMOOTH, ShadeInput::u, ShadeInput::v, ShadeInput::vlr, ShadeInput::vn, and ShadeInput::vno.
Referenced by shade_samples_fill_with_ps(), and shade_tra_samples_fill().
void shade_input_set_viewco | ( | ShadeInput * | shi, |
float | x, | ||
float | y, | ||
float | xs, | ||
float | ys, | ||
float | z | ||
) |
Definition at line 692 of file shadeinput.c.
References ShadeInput::co, ShadeInput::dxco, ShadeInput::dxview, ShadeInput::dyco, ShadeInput::mat, NULL, ShadeInput::osatex, R, R_SHADOW, ShadeInput::scanco, shade_input_calc_viewco(), Material::texco, TEXCO_REFL, ShadeInput::view, ShadeInput::xs, and ShadeInput::ys.
Referenced by shade_sample_sss(), shade_samples_fill_with_ps(), and shade_tra_samples_fill().
void shade_material_loop | ( | ShadeInput * | shi, |
ShadeResult * | shr | ||
) |
Definition at line 105 of file shadeinput.c.
References ShadeResult::alpha, ShadeResult::combined, ShadeInput::depth, ShadeResult::diff, ShadeInput::facenor, ShadeInput::layflag, MA_RAYTRANSP, MA_TRANSP, ShadeInput::mode, negate_v3(), negate_v3_v3(), ShadeInput::passflag, R, R_ADDSKY, R_RAYTRACE, ShadeInput::ray_mirror, ray_trace(), SCE_LAY_SKY, SCE_PASS_DIFFUSE, SCE_PASS_SHADOW, SCE_PASS_SPEC, ShadeResult::shad, shade_input_init_material(), shade_lamp_loop(), shade_volume_inside(), ShadeResult::spec, ShadeInput::translucency, VECADDISFAC, ShadeInput::vn, ShadeInput::vno, and ShadeInput::volume_depth.
Referenced by bake_shade(), occ_shade(), RE_Database_Baking(), RE_Database_FromScene(), shade_input_do_shade(), shade_ray(), and shade_sample_sss().
void shade_sample_initialize | ( | ShadeSample * | ssamp, |
RenderPart * | pa, | ||
RenderLayer * | rl | ||
) |
Definition at line 1351 of file shadeinput.c.
References get_sample_layers(), R, ShadeSample::rlpp, shade_input_initialize(), ShadeSample::shi, and ShadeSample::shr.
Referenced by shadeDA_tile(), zbuffer_transp_shade(), zbufshade_sss_tile(), and zbufshade_tile().
int shade_samples | ( | ShadeSample * | ssamp, |
PixStr * | ps, | ||
int | x, | ||
int | y | ||
) |
Definition at line 1454 of file shadeinput.c.
References ShadeInput::passflag, SCE_PASS_INDEXMA, SCE_PASS_INDEXOB, SCE_PASS_Z, shade_input_do_shade(), shade_input_set_shade_texco(), shade_samples_do_AO(), shade_samples_fill_with_ps(), ShadeSample::shi, ShadeSample::shr, ShadeSample::tot, and ShadeResult::z.
Referenced by shadeDA_tile(), and zbufshade_tile().
void shade_samples_do_AO | ( | ShadeSample * | ssamp | ) |
Definition at line 1366 of file shadeinput.c.
References ambient_occlusion(), ShadeInput::combinedflag, MA_SHLESS, ShadeInput::mode, ShadeInput::passflag, R, R_RAYTRACE, R_SHADOW, SCE_PASS_AO, SCE_PASS_COMBINED, SCE_PASS_ENVIRONMENT, SCE_PASS_INDIRECT, ShadeSample::shi, ShadeSample::tot, WO_AMB_OCC, WO_AOGATHER_APPROX, WO_ENV_LIGHT, and WO_INDIRECT_LIGHT.
Referenced by bake_shade(), shade_sample_sss(), shade_samples(), shade_tra_samples(), and strand_shade_point().
void shade_samples_fill_with_ps | ( | ShadeSample * | ssamp, |
PixStr * | ps, | ||
int | x, | ||
int | y | ||
) |
Definition at line 1386 of file shadeinput.c.
References PixStr::facenr, VlakRen::flag, ShadeInput::mask, PixStr::mask, PixStr::next, PixStr::obi, R, R_FULL_OSA, ShadeInput::samplenr, shade_input_copy_triangle(), shade_input_set_normals(), shade_input_set_triangle(), shade_input_set_uv(), shade_input_set_vertex_normals(), shade_input_set_viewco(), ShadeSample::shi, ShadeInput::thread, ShadeSample::tot, ShadeInput::vlr, and PixStr::z.
Referenced by cache_occ_samples(), and shade_samples().
void vlr_set_uv_indices | ( | VlakRen * | vlr, |
int * | i1, | ||
int * | i2, | ||
int * | i3 | ||
) |
Definition at line 233 of file shadeinput.c.
References VlakRen::flag, R_DIVIDE_24, and R_FACE_SPLIT.
Referenced by compatible_bump_uv_derivs(), shade_input_set_shade_texco(), and shade_tface().
Definition at line 127 of file pipeline.c.