Blender V2.61 - r43446
|
Go to the source code of this file.
Defines | |
#define | BRICONT |
#define | BRICONTRGB |
#define | RGBTOBW(r, g, b) ( r*0.35f + g*0.45f + b*0.2f ) |
Functions | |
void | do_halo_tex (struct HaloRen *har, float xn, float yn, float col_r[4]) |
void | do_sky_tex (const float rco[3], float lo[3], const float dxyview[2], float hor[3], float zen[3], float *blend, int skyflag, short thread) |
void | do_material_tex (struct ShadeInput *shi, struct Render *re) |
void | do_lamp_tex (LampRen *la, const float lavec[3], struct ShadeInput *shi, float col_r[3], int effect) |
void | do_volume_tex (struct ShadeInput *shi, const float xyz[3], int mapto_flag, float col[3], float *val, struct Render *re) |
void | init_render_textures (Render *re) |
void | end_render_textures (Render *re) |
void | render_realtime_texture (struct ShadeInput *shi, struct Image *ima) |
int | imagewraposa (struct Tex *tex, struct Image *ima, struct ImBuf *ibuf, const float texvec[3], const float dxt[3], const float dyt[3], struct TexResult *texres) |
int | imagewrap (struct Tex *tex, struct Image *ima, struct ImBuf *ibuf, const float texvec[3], struct TexResult *texres) |
void | image_sample (struct Image *ima, float fx, float fy, float dx, float dy, float *result) |
Definition in file blender/render/intern/include/texture.h.
#define BRICONT |
texres->tin= (texres->tin-0.5f) * tex->contrast+tex->bright-0.5f; \ if(texres->tin < 0.0f) texres->tin= 0.0f; \ else if(texres->tin > 1.0f) texres->tin= 1.0f; \
Definition at line 39 of file blender/render/intern/include/texture.h.
Referenced by blend(), clouds(), marble(), mg_distNoiseTex(), mg_HTerrainTex(), mg_mFractalOrfBmTex(), mg_ridgedOrHybridMFTex(), ocean_texture(), plugintex(), pointdensitytex(), texnoise(), voronoiTex(), voxeldatatex(), and wood().
#define BRICONTRGB |
texres->tr= tex->rfac*((texres->tr-0.5f)*tex->contrast+tex->bright-0.5f); \ if(texres->tr<0.0f) texres->tr= 0.0f; \ texres->tg= tex->gfac*((texres->tg-0.5f)*tex->contrast+tex->bright-0.5f); \ if(texres->tg<0.0f) texres->tg= 0.0f; \ texres->tb= tex->bfac*((texres->tb-0.5f)*tex->contrast+tex->bright-0.5f); \ if(texres->tb<0.0f) texres->tb= 0.0f; \ if(tex->saturation != 1.0f) { \ float _hsv[3]; \ rgb_to_hsv(texres->tr, texres->tg, texres->tb, \ _hsv, _hsv+1, _hsv+2); \ _hsv[1] *= tex->saturation; \ hsv_to_rgb(_hsv[0], _hsv[1], _hsv[2], \ &texres->tr, &texres->tg, &texres->tb); \ } \
Definition at line 44 of file blender/render/intern/include/texture.h.
Referenced by clouds(), imagewrap(), imagewraposa(), imagewraposa_aniso(), magic(), ocean_texture(), plugintex(), pointdensitytex(), voronoiTex(), and voxeldatatex().
Definition at line 60 of file blender/render/intern/include/texture.h.
void do_halo_tex | ( | struct HaloRen * | har, |
float | xn, | ||
float | yn, | ||
float | col_r[4] | ||
) |
Definition at line 2875 of file render_texture.c.
References MTex::b, HaloRen::b, BKE_image_get_ibuf(), MTex::blendtype, CLAMP(), MTex::colfac, do_2d_mapping(), MTex::g, HaloRen::g, Tex::ima, Tex::iuser, MAP_ALPHA, MAP_COL, MTex::mapto, HaloRen::mat, Material::mtex, MTEX_BLEND, MTEX_MUL, MTEX_NEGATIVE, MTEX_RGBTOINT, MTEX_SUB, multitex(), TexResult::nor, NULL, MTex::ofs, MTex::projx, MTex::projy, MTex::projz, R, MTex::r, HaloRen::r, R_COLOR_MANAGEMENT, R_NO_TEX, HaloRen::rad, ImBuf::rect_float, Material::septex, MTex::size, srgb_to_linearrgb_v3_v3(), TexResult::ta, TexResult::talpha, TexResult::tb, MTex::tex, TEX_IMAGE, Material::texco, TEXCO_OSA, MTex::texflag, TexResult::tg, TexResult::tin, TexResult::tr, Tex::type, and MTex::which_output.
Referenced by shadeHaloFloat().
void do_lamp_tex | ( | LampRen * | la, |
const float | lavec[3], | ||
struct ShadeInput * | shi, | ||
float | col_r[3], | ||
int | effect | ||
) |
Definition at line 3220 of file render_texture.c.
References MTex::b, BKE_image_get_ibuf(), MTex::blendtype, co, ShadeInput::co, MTex::colfac, copy_v3_v3(), do_2d_mapping(), ShadeInput::dxco, ShadeInput::dxlv, ShadeInput::dyco, ShadeInput::dylv, LampRen::energy, MTex::g, ShadeInput::gl, i, Tex::ima, LampRen::imat, Object::imat_ren, Tex::iuser, LA_SHAD_TEX, LA_SPOT, LA_TEXTURE, LAMAP_COL, LAMAP_SHAD, MAP_ALPHA, MTex::mapto, MAX_MTEX, LampRen::mtex, MTEX_NEGATIVE, MTEX_RGBTOINT, MTEX_STENCIL, mul_m3_v3(), mul_m4_v3(), mul_mat3_m4_v3(), mul_v3_fl(), multitex(), TexResult::nor, NULL, MTex::object, MTex::ofs, ShadeInput::osatex, MTex::projx, MTex::projy, MTex::projz, R, MTex::r, R_COLOR_MANAGEMENT, R_NO_TEX, ImBuf::rect_float, MTex::size, LampRen::spottexfac, srgb_to_linearrgb_v3_v3(), TexResult::ta, TexResult::tb, MTex::tex, TEX_IMAGE, MTex::texco, TEXCO_GLOB, TEXCO_OBJECT, TEXCO_VIEW, MTex::texflag, texture_rgb_blend(), TexResult::tg, ShadeInput::thread, TexResult::tin, TexResult::tr, LampRen::type, Tex::type, and MTex::which_output.
Referenced by render_lighting_halo(), shade_one_light(), and vol_shade_one_lamp().
void do_material_tex | ( | struct ShadeInput * | shi, |
struct Render * | re | ||
) |
Definition at line 2163 of file render_texture.c.
References ShadeInput::actuv, add_v3_v3v3(), ShadeInput::alpha, MTex::alphafac, ShadeInput::amb, World::ambb, ShadeInput::ambb, MTex::ambfac, World::ambg, ShadeInput::ambg, World::ambr, ShadeInput::ambr, B, MTex::b, BKE_image_get_ibuf(), MTex::blendtype, calc_R_ref(), ShadeInput::co, co, MTex::colfac, RenderData::color_mgt_flag, MTex::colspecfac, compatible_bump_compute(), compatible_bump_init(), compatible_bump_uv_derivs(), copy_v3_v3(), cos(), cross_v3_v3v3(), MTex::def_var, MTex::difffac, MTex::dispfac, ShadeInput::displace, dot(), dot_v3v3(), ShadeInput::duplilo, ObjectInstanceRen::duplitexmat, ShadeInput::dupliuv, ShadeInput::dxco, ShadeInput::dxgl, ShadeInput::dxlo, ShadeInput::dxno, ShadeInput::dxref, ShadeInput::dxsticky, ShadeInput::dxstrand, ShadeInputUV::dxuv, ShadeInput::dxwin, ShadeInput::dyco, ShadeInput::dygl, ShadeInput::dylo, ShadeInput::dyno, ShadeInput::dyref, ShadeInput::dysticky, ShadeInput::dystrand, ShadeInputUV::dyuv, ShadeInput::dywin, ShadeInput::emit, MTex::emitfac, fabsf, MTex::g, ShadeInput::gl, ShadeInput::har, MTex::hardfac, i, Tex::ima, Tex::imaflag, Object::imat_ren, Tex::iuser, len(), ShadeInput::lo, MA_TANGENT_V, madd_v3_v3fl(), MAP_ALPHA, MAP_AMB, MAP_COL, MAP_COLMIR, MAP_COLSPEC, MAP_DISPLACE, MAP_EMIT, MAP_HAR, MAP_NORM, MAP_RAYMIRR, MAP_REF, MAP_SPEC, MAP_TRANSLU, MAP_VARS, MAP_WARP, MTex::mapto, ShadeInput::mat, MAX_MTEX, ShadeInput::mirr, MTex::mirrfac, Material::mode, Material::mtex, MTEX_3TAP_BUMP, MTEX_5TAP_BUMP, MTEX_BICUBIC_BUMP, MTEX_BLEND, MTEX_COMPAT_BUMP, MTEX_DUPLI_MAPTO, MTEX_MUL, MTEX_NEGATIVE, MTEX_NSPACE_CAMERA, MTEX_NSPACE_OBJECT, MTEX_NSPACE_TANGENT, MTEX_NSPACE_WORLD, MTEX_OB_DUPLI_ORIG, MTEX_RGBTOINT, MTEX_STENCIL, MTEX_SUB, MTEX_VIEWSPACE, mul_m4_v3(), mul_mat3_m4_v3(), mul_v3_fl(), multitex_mtex(), ShadeInputUV::name, ShadeInput::nmapnorm, ShadeInput::nmaptang, Tex::nodetree, TexResult::nor, MTex::norfac, normalize_v3(), MTex::normapspace, ntap_bump_compute(), ntap_bump_init(), NULL, ObjectRen::ob, ShadeInput::obi, MTex::object, Object::obmat, ShadeInput::obr, ShadeInput::orn, ShadeInput::osatex, ShadeInput::r, MTex::r, Render::r, R_COLOR_MANAGEMENT, R_NO_TEX, ShadeInput::ray_mirror, MTex::raymirrfac, ImBuf::rect_float, ShadeInput::ref, ShadeInput::refcol, ShadeInput::refl, RenderData::scemode, Material::septex, si, sin(), ShadeInput::spec, MTex::specfac, ShadeInput::specr, srgb_to_linearrgb_v3_v3(), ShadeInput::sticky, ShadeInput::strandco, ShadeInput::stress, TexResult::ta, TexResult::talpha, ShadeInput::tang, TexResult::tb, MTex::tex, TEX_DERIVATIVEMAP, TEX_ENVMAP, TEX_IMAGE, TEX_NOR, TEX_NORMALMAP, TEX_OCEAN, TEX_RGB, MTex::texco, TEXCO_GLOB, texco_mapping(), TEXCO_NORM, TEXCO_OBJECT, TEXCO_ORCO, TEXCO_REFL, TEXCO_STICKY, TEXCO_STRAND, TEXCO_STRESS, TEXCO_TANGENT, TEXCO_UV, TEXCO_WINDOW, MTex::texflag, texture_rgb_blend(), texture_value_blend(), TexResult::tg, TexResult::tin, ShadeInput::totuv, TexResult::tr, MTex::translfac, ShadeInput::translucency, Tex::type, Tex::use_nodes, ShadeInputUV::uv, ShadeInput::uv, MTex::uvname, Render::viewmat, ShadeInput::vlr, ShadeInput::vn, MTex::warpfac, ShadeInput::winco, and Render::wrld.
void do_sky_tex | ( | const float | rco[3], |
float | lo[3], | ||
const float | dxyview[2], | ||
float | hor[3], | ||
float | zen[3], | ||
float * | blend, | ||
int | skyflag, | ||
short | thread | ||
) |
Definition at line 3014 of file render_texture.c.
References atan2f, MTex::b, BKE_image_get_ibuf(), MTex::blendfac, MTex::blendtype, co, MTex::colfac, copy_v3_v3(), MTex::def_var, do_2d_mapping(), MTex::g, Tex::ima, Object::imat_ren, Tex::iuser, M_PI, map_to_sphere(), map_to_tube(), MTex::mapto, MAX_MTEX, MTEX_NEGATIVE, MTEX_RGBTOINT, MTEX_STENCIL, mul_m4_v3(), multitex(), TexResult::nor, NULL, MTex::object, MTex::ofs, MTex::projx, MTex::projy, MTex::projz, R, MTex::r, R_COLOR_MANAGEMENT, R_NO_TEX, ImBuf::rect_float, saacos(), MTex::size, sqrtf, srgb_to_linearrgb_v3_v3(), TexResult::ta, TexResult::tb, MTex::tex, TEX_IMAGE, MTex::texco, TEXCO_ANGMAP, TEXCO_EQUIRECTMAP, TEXCO_GLOB, TEXCO_H_SPHEREMAP, TEXCO_H_TUBEMAP, TEXCO_OBJECT, MTex::texflag, texture_rgb_blend(), texture_value_blend(), TexResult::tg, TexResult::tin, TexResult::tr, Tex::type, MTex::which_output, WO_SKYREAL, WO_ZENUP, WOMAP_BLEND, WOMAP_HORIZ, WOMAP_ZENDOWN, WOMAP_ZENUP, MTex::zendownfac, and MTex::zenupfac.
Referenced by shadeSkyView().
void do_volume_tex | ( | struct ShadeInput * | shi, |
const float | xyz[3], | ||
int | mapto_flag, | ||
float | col[3], | ||
float * | val, | ||
struct Render * | re | ||
) |
Referenced by RE_sample_material_color(), vol_get_density(), vol_get_emission(), vol_get_reflection_color(), and vol_get_sigma_t().
void end_render_textures | ( | Render * | re | ) |
Definition at line 155 of file render_texture.c.
References end_render_texture(), ListBase::first, Tex::id, Render::main, ID::next, Main::tex, and ID::us.
Referenced by RE_Database_Free().
void image_sample | ( | struct Image * | ima, |
float | fx, | ||
float | fy, | ||
float | dx, | ||
float | dy, | ||
float * | result | ||
) |
Definition at line 1793 of file imagetexture.c.
References BKE_image_get_ibuf(), boxsample(), ImBuf::flags, IB_fields, NULL, R, R_SEC_FIELD, ImBuf::rect, TexResult::ta, TexResult::talpha, TexResult::tb, TexResult::tg, TexResult::tr, ImBuf::x, and ImBuf::y.
int imagewrap | ( | struct Tex * | tex, |
struct Image * | ima, | ||
struct ImBuf * | ibuf, | ||
const float | texvec[3], | ||
struct TexResult * | texres | ||
) |
Definition at line 113 of file imagetexture.c.
References BKE_image_get_ibuf(), boxsample(), BRICONTRGB, Tex::checkerdist, credits_svn_gen::e, Tex::extend, Tex::filtersize, ListBase::first, Tex::flag, ImBuf::flags, floorf, IB_fields, ibuf_get_color(), Image::ibufs, Tex::imaflag, Tex::iuser, MAX3(), TexResult::nor, NULL, R, R_NO_IMAGE_LOAD, R_SEC_FIELD, ImBuf::rect, ImBuf::rect_float, TexResult::ta, TexResult::talpha, TexResult::tb, TEX_CALCALPHA, TEX_CHECKER, TEX_CHECKER_EVEN, TEX_CHECKER_ODD, TEX_CLIP, TEX_CLIPCUBE, TEX_EXTEND, TEX_IMAROT, TEX_INTERPOL, TEX_NEGALPHA, TEX_NORMALMAP, TEX_REPEAT, TEX_USEALPHA, TexResult::tg, TexResult::tin, TexResult::tr, TRUE, ImBuf::x, and ImBuf::y.
Referenced by envmaptex(), multitex(), and render_realtime_texture().
int imagewraposa | ( | struct Tex * | tex, |
struct Image * | ima, | ||
struct ImBuf * | ibuf, | ||
const float | texvec[3], | ||
const float | dxt[3], | ||
const float | dyt[3], | ||
struct TexResult * | texres | ||
) |
Definition at line 1413 of file imagetexture.c.
References BKE_image_get_ibuf(), boxsample(), BRICONTRGB, Tex::checkerdist, copy_v3_v3(), credits_svn_gen::e, Tex::extend, Tex::filtersize, ListBase::first, Tex::flag, ImBuf::flags, IB_fields, Image::ibufs, Tex::imaflag, image_mipmap_test(), imagewraposa_aniso(), Tex::iuser, MAX2, MAX3(), MIN2, MIN3, ImBuf::mipmap, TexResult::nor, NULL, R, R_FIELDS, R_NO_IMAGE_LOAD, R_SEC_FIELD, ImBuf::rect, ImBuf::rect_float, SWAP, TexResult::ta, TexResult::talpha, TexResult::tb, TEX_CALCALPHA, TEX_CHECKER, TEX_CHECKER_EVEN, TEX_CHECKER_ODD, TEX_CLIP, TEX_CLIPCUBE, TEX_EXTEND, TEX_FILTER_MIN, TEX_IMAROT, TEX_INTERPOL, TEX_MIPMAP, TEX_NEGALPHA, TEX_NORMALMAP, TEX_REPEAT, TEX_REPEAT_XMIR, TEX_REPEAT_YMIR, TEX_USEALPHA, Tex::texfilter, TexResult::tg, TexResult::tin, TexResult::tr, TXF_BOX, ImBuf::x, and ImBuf::y.
Referenced by envmaptex(), multitex(), and render_realtime_texture().
void init_render_textures | ( | Render * | re | ) |
Definition at line 138 of file render_texture.c.
References ListBase::first, Tex::id, init_render_texture(), Render::main, ID::next, Main::tex, and ID::us.
Referenced by RE_Database_Baking(), and RE_Database_FromScene().
void render_realtime_texture | ( | struct ShadeInput * | shi, |
struct Image * | ima | ||
) |
Definition at line 3459 of file render_texture.c.
References ShadeInput::actuv, BLENDER_MAX_THREADS, BLI_lock_thread(), BLI_unlock_thread(), default_tex(), ShadeInputUV::dxuv, ShadeInputUV::dyuv, imagewrap(), imagewraposa(), Tex::iuser, LOCK_IMAGE, TexResult::nor, NULL, Image::ok, ImageUser::ok, ShadeInput::osatex, R, R_NO_TEX, TexResult::ta, TexResult::tb, TEX_IMAGE, TexResult::tg, ShadeInput::thread, TexResult::tr, Tex::type, ShadeInputUV::uv, ShadeInput::uv, and ShadeInput::vcol.
Referenced by shade_input_set_shade_texco().