Blender V2.61 - r43446
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_rand.h"
#include "BLI_utildefines.h"
#include "DNA_anim_types.h"
#include "DNA_texture_types.h"
#include "DNA_object_types.h"
#include "DNA_lamp_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_material_types.h"
#include "DNA_image_types.h"
#include "DNA_node_types.h"
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
#include "BKE_colortools.h"
#include "BKE_image.h"
#include "BKE_node.h"
#include "BKE_plugin_types.h"
#include "BKE_animsys.h"
#include "BKE_DerivedMesh.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_scene.h"
#include "BKE_library.h"
#include "BKE_texture.h"
#include "BKE_key.h"
#include "BKE_ipo.h"
#include "MEM_guardedalloc.h"
#include "envmap.h"
#include "pointdensity.h"
#include "voxeldata.h"
#include "renderpipeline.h"
#include "render_types.h"
#include "rendercore.h"
#include "shading.h"
#include "texture.h"
#include "texture_ocean.h"
#include "renderdatabase.h"
Go to the source code of this file.
Classes | |
struct | CompatibleBump |
struct | NTapBump |
Typedefs | |
typedef struct CompatibleBump | CompatibleBump |
typedef struct NTapBump | NTapBump |
Functions | |
static void | init_render_texture (Render *re, Tex *tex) |
void | init_render_textures (Render *re) |
static void | end_render_texture (Tex *tex) |
void | end_render_textures (Render *re) |
static void | tex_normal_derivate (Tex *tex, TexResult *texres) |
static int | blend (Tex *tex, float *texvec, TexResult *texres) |
static int | clouds (Tex *tex, float *texvec, TexResult *texres) |
static float | tex_sin (float a) |
static float | tex_saw (float a) |
static float | tex_tri (float a) |
static float | wood_int (Tex *tex, float x, float y, float z) |
static int | wood (Tex *tex, float *texvec, TexResult *texres) |
static float | marble_int (Tex *tex, float x, float y, float z) |
static int | marble (Tex *tex, float *texvec, TexResult *texres) |
static int | magic (Tex *tex, float *texvec, TexResult *texres) |
static int | stucci (Tex *tex, float *texvec, TexResult *texres) |
static float | mg_mFractalOrfBmTex (Tex *tex, float *texvec, TexResult *texres) |
static float | mg_ridgedOrHybridMFTex (Tex *tex, float *texvec, TexResult *texres) |
static float | mg_HTerrainTex (Tex *tex, float *texvec, TexResult *texres) |
static float | mg_distNoiseTex (Tex *tex, float *texvec, TexResult *texres) |
static float | voronoiTex (Tex *tex, float *texvec, TexResult *texres) |
static int | texnoise (Tex *tex, TexResult *texres) |
static int | plugintex (Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexResult *texres) |
static int | cubemap_glob (float *n, float x, float y, float z, float *adr1, float *adr2) |
static int | cubemap (MTex *mtex, VlakRen *vlr, float *n, float x, float y, float z, float *adr1, float *adr2) |
static int | cubemap_ob (Object *ob, float *n, float x, float y, float z, float *adr1, float *adr2) |
static void | do_2d_mapping (MTex *mtex, float *t, VlakRen *vlr, float *n, float *dxt, float *dyt) |
static int | multitex (Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexResult *texres, short thread, short which_output) |
int | multitex_nodes (Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexResult *texres, short thread, short which_output, ShadeInput *shi, MTex *mtex) |
int | multitex_mtex (ShadeInput *shi, MTex *mtex, float *texvec, float *dxt, float *dyt, TexResult *texres) |
int | multitex_ext (Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexResult *texres) |
int | multitex_ext_safe (Tex *tex, float *texvec, TexResult *texres) |
void | texture_rgb_blend (float in[3], const float tex[3], const float out[3], float fact, float facg, int blendtype) |
float | texture_value_blend (float tex, float out, float fact, float facg, int blendtype) |
static void | texco_mapping (ShadeInput *shi, Tex *tex, MTex *mtex, float *co, float *dx, float *dy, float *texvec, float *dxt, float *dyt) |
static void | compatible_bump_init (CompatibleBump *compat_bump) |
static void | compatible_bump_uv_derivs (CompatibleBump *compat_bump, ShadeInput *shi, MTex *mtex, int i) |
static int | compatible_bump_compute (CompatibleBump *compat_bump, ShadeInput *shi, MTex *mtex, Tex *tex, TexResult *texres, float Tnor, float *co, float *dx, float *dy, float *texvec, float *dxt, float *dyt) |
static void | ntap_bump_init (NTapBump *ntap_bump) |
static int | ntap_bump_compute (NTapBump *ntap_bump, ShadeInput *shi, MTex *mtex, Tex *tex, TexResult *texres, float Tnor, float *co, float *dx, float *dy, float *texvec, float *dxt, float *dyt) |
void | do_material_tex (ShadeInput *shi, Render *re) |
void | do_volume_tex (ShadeInput *shi, const float *xyz, int mapto_flag, float *col, float *val, Render *re) |
void | do_halo_tex (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_lamp_tex (LampRen *la, const float lavec[3], ShadeInput *shi, float col_r[3], int effect) |
int | externtex (MTex *mtex, const float vec[3], float *tin, float *tr, float *tg, float *tb, float *ta, const int thread) |
void | render_realtime_texture (ShadeInput *shi, Image *ima) |
static void | textured_face_generate_uv (float *uv, float *normal, float *hit, float *v1, float *v2, float *v3) |
Material * | RE_init_sample_material (Material *orig_mat, Scene *scene) |
void | RE_free_sample_material (Material *mat) |
void | RE_sample_material_color (Material *mat, float color[3], float *alpha, const float volume_co[3], const float surface_co[3], int face_index, short hit_quad, DerivedMesh *orcoDm, Object *ob) |
Variables | |
struct Render | R |
Definition in file render_texture.c.
typedef struct CompatibleBump CompatibleBump |
Definition at line 196 of file render_texture.c.
References KDL::atan2(), BRICONT, Tex::flag, M_PI, sqrt(), Tex::stype, TEX_DIAG, TEX_EASE, TEX_FLIPBLEND, TEX_HALO, TEX_INT, TEX_LIN, TEX_QUAD, TEX_RAD, and TexResult::tin.
Referenced by blend_from_shape_exec(), brush_debug_print_state(), filterNullReebGraph(), get_cpa_texture(), get_strand_normal(), imapaint_paint_op(), multitex(), p_flush_uvs_blend(), param_stretch_blend(), psys_get_texture(), shade_one_light(), shadeSkyView(), svm_node_layer_weight(), weight_to_rgb(), widget_state_numslider(), and xml_read_shader_graph().
Definition at line 248 of file render_texture.c.
References BLI_gTurbulence(), BRICONT, BRICONTRGB, Tex::nabla, Tex::noisebasis, Tex::noisedepth, Tex::noisesize, Tex::noisetype, TexResult::nor, NULL, Tex::stype, TexResult::ta, TexResult::tb, TEX_COLOR, TEX_INT, TEX_NOISESOFT, TEX_NOR, tex_normal_derivate(), TEX_RGB, TexResult::tg, TexResult::tin, and TexResult::tr.
Referenced by multitex().
static int compatible_bump_compute | ( | CompatibleBump * | compat_bump, |
ShadeInput * | shi, | ||
MTex * | mtex, | ||
Tex * | tex, | ||
TexResult * | texres, | ||
float | Tnor, | ||
float * | co, | ||
float * | dx, | ||
float * | dy, | ||
float * | texvec, | ||
float * | dxt, | ||
float * | dyt | ||
) | [static] |
Definition at line 1752 of file render_texture.c.
References BKE_image_get_ibuf(), copy_v3_v3(), cross_v3_v3v3(), CompatibleBump::dudnu, CompatibleBump::dudnv, CompatibleBump::dvdnu, CompatibleBump::dvdnv, credits_svn_gen::e, fabsf, Tex::flag, if(), Tex::ima, Object::imat_ren, Tex::iuser, MAX2, MAX3(), MIN2, mul_mat3_m4_v3(), multitex_mtex(), negate_v3_v3(), CompatibleBump::nn, TexResult::nor, MTex::norfac, normalize_v3(), CompatibleBump::nu, NULL, CompatibleBump::nunvdone, CompatibleBump::nv, ObjectRen::ob, MTex::object, ShadeInput::obr, ortho_basis_v3v3_v3(), ShadeInput::osatex, R, TexResult::talpha, TexResult::tb, TEX_COLORBAND, TEX_IMAGE, TEX_NOR, MTex::texco, TEXCO_GLOB, texco_mapping(), TEXCO_OBJECT, TEXCO_ORCO, TEXCO_UV, TexResult::tg, TexResult::tin, TexResult::tr, Tex::type, ShadeInput::vn, ImBuf::x, and ImBuf::y.
Referenced by do_material_tex().
static void compatible_bump_init | ( | CompatibleBump * | compat_bump | ) | [static] |
Definition at line 1689 of file render_texture.c.
References CompatibleBump::dudnu, and CompatibleBump::dvdnv.
Referenced by do_material_tex().
static void compatible_bump_uv_derivs | ( | CompatibleBump * | compat_bump, |
ShadeInput * | shi, | ||
MTex * | mtex, | ||
int | i | ||
) | [static] |
Definition at line 1697 of file render_texture.c.
References VertRen::co, simple_enum_gen::d, CompatibleBump::dudnu, CompatibleBump::dudnv, CompatibleBump::dvdnu, CompatibleBump::dvdnv, credits_svn_gen::e, fabsf, ShadeInput::i1, ShadeInput::i2, ShadeInput::i3, Tex::imaflag, MAP_NORM, MAP_WARP, MTex::mapto, MTEX_COMPAT_BUMP, CompatibleBump::nn, CompatibleBump::nu, NULL, CompatibleBump::nunvdone, CompatibleBump::nv, ObjectRen::ob, ShadeInput::obr, ortho_basis_v3v3_v3(), RE_vlakren_get_tface(), MTex::tex, TEX_IMAGE, TEX_NORMALMAP, MTex::texflag, Tex::type, MTFace::uv, ShadeInput::v1, ShadeInput::v2, ShadeInput::v3, ShadeInput::vlr, vlr_set_uv_indices(), and ShadeInput::vn.
Referenced by do_material_tex().
static int cubemap | ( | MTex * | mtex, |
VlakRen * | vlr, | ||
float * | n, | ||
float | x, | ||
float | y, | ||
float | z, | ||
float * | adr1, | ||
float * | adr2 | ||
) | [static] |
Definition at line 856 of file render_texture.c.
References cubemap_glob(), fabs(), ME_PROJXY, ME_PROJXZ, ME_PROJYZ, normal_tri_v3(), VertRen::orco, MTex::projx, MTex::projy, MTex::projz, VlakRen::puno, VlakRen::v1, VlakRen::v2, and VlakRen::v3.
Referenced by do_2d_mapping().
static int cubemap_glob | ( | float * | n, |
float | x, | ||
float | y, | ||
float | z, | ||
float * | adr1, | ||
float * | adr2 | ||
) | [static] |
Definition at line 818 of file render_texture.c.
References copy_v3_v3(), fabs(), mul_mat3_m4_v3(), NULL, and R.
Referenced by cubemap(), and do_2d_mapping().
static int cubemap_ob | ( | Object * | ob, |
float * | n, | ||
float | x, | ||
float | y, | ||
float | z, | ||
float * | adr1, | ||
float * | adr2 | ||
) | [static] |
Definition at line 914 of file render_texture.c.
References copy_v3_v3(), fabs(), Object::imat, mul_mat3_m4_v3(), and NULL.
Referenced by do_2d_mapping().
static void do_2d_mapping | ( | MTex * | mtex, |
float * | t, | ||
VlakRen * | vlr, | ||
float * | n, | ||
float * | dxt, | ||
float * | dyt | ||
) | [static] |
Definition at line 948 of file render_texture.c.
References Tex::cropxmax, Tex::cropxmin, Tex::cropymax, Tex::cropymin, cubemap(), cubemap_glob(), cubemap_ob(), ELEM, Tex::extend, Tex::flag, map_to_sphere(), map_to_tube(), MTex::mapping, max, MTEX_FLAT, MTEX_SPHERE, MTEX_TUBE, NULL, MTex::object, Render::ok, R, SWAP, MTex::tex, TEX_REPEAT, TEX_REPEAT_XMIR, TEX_REPEAT_YMIR, MTex::texco, TEXCO_GLOB, TEXCO_OBJECT, Tex::texfilter, TXF_BOX, Tex::xrepeat, and Tex::yrepeat.
Referenced by do_halo_tex(), do_lamp_tex(), do_sky_tex(), externtex(), multitex_nodes(), and texco_mapping().
void do_halo_tex | ( | HaloRen * | har, |
float | xn, | ||
float | yn, | ||
float | col_r[4] | ||
) |
Definition at line 2875 of file render_texture.c.
References HaloRen::b, MTex::b, BKE_image_get_ibuf(), MTex::blendtype, CLAMP(), MTex::colfac, do_2d_mapping(), HaloRen::g, MTex::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, HaloRen::r, MTex::r, 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], | ||
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, ShadeInput::co, 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, MTex::r, 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, Tex::type, LampRen::type, and MTex::which_output.
Referenced by render_lighting_halo(), shade_one_light(), and vol_shade_one_lamp().
void do_material_tex | ( | ShadeInput * | shi, |
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, MTex::r, 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 | ( | ShadeInput * | shi, |
const float * | xyz, | ||
int | mapto_flag, | ||
float * | col, | ||
float * | val, | ||
Render * | re | ||
) |
Definition at line 2695 of file render_texture.c.
References MTex::b, MTex::blendtype, CLAMP(), co, MTex::colemitfac, MTex::colreflfac, MTex::coltransfac, copy_v3_v3(), MTex::def_var, MTex::densfac, ShadeInput::duplilo, ObjectInstanceRen::duplitexmat, MTex::emitfac, MTex::g, Object::imat_ren, MAP_DENSITY, MAP_EMISSION, MAP_EMISSION_COL, MAP_REFLECTION, MAP_REFLECTION_COL, MAP_SCATTERING, MAP_TRANSMISSION_COL, MAP_VARS, MTex::mapto, ShadeInput::mat, MAX_MTEX, Material::mtex, MTEX_DUPLI_MAPTO, MTEX_NEGATIVE, MTEX_OB_DUPLI_ORIG, MTEX_RGBTOINT, MTEX_STENCIL, mul_m4_v3(), multitex(), TexResult::nor, NULL, ObjectInstanceRen::ob, ShadeInput::obi, MTex::object, MTex::ofs, MTex::projx, MTex::projy, MTex::projz, MTex::r, Render::r, R_NO_TEX, MTex::reflfac, MTex::scatterfac, RenderData::scemode, Material::septex, MTex::size, TexResult::ta, TexResult::talpha, TexResult::tb, MTex::tex, TEX_IMAGE, TEX_INT, TEX_RGB, MTex::texco, TEXCO_GLOB, TEXCO_OBJECT, TEXCO_ORCO, MTex::texflag, texture_rgb_blend(), texture_value_blend(), TexResult::tg, TexResult::tin, TexResult::tr, Tex::type, Render::viewinv, and MTex::which_output.
static void end_render_texture | ( | Tex * | tex | ) | [static] |
Definition at line 149 of file render_texture.c.
References bNodeTree::execdata, Tex::nodetree, ntreeTexEndExecTree(), and Tex::use_nodes.
Referenced by end_render_textures().
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().
int externtex | ( | MTex * | mtex, |
const float | vec[3], | ||
float * | tin, | ||
float * | tr, | ||
float * | tg, | ||
float * | tb, | ||
float * | ta, | ||
const int | thread | ||
) |
Definition at line 3410 of file render_texture.c.
References MTex::b, do_2d_mapping(), MTex::g, multitex(), TexResult::nor, NULL, MTex::ofs, MTex::projx, MTex::projy, MTex::projz, MTex::r, MTex::size, TexResult::ta, TexResult::tb, MTex::tex, TEX_IMAGE, TexResult::tg, TexResult::tin, TexResult::tr, Tex::type, and MTex::which_output.
Referenced by brush_sample_tex(), get_cpa_texture(), mesh_noise_exec(), psys_get_texture(), RE_inithalo(), RE_inithalo_particle(), and tex_strength().
Definition at line 95 of file render_texture.c.
References BKE_free_envmapdata(), BKE_image_user_calc_frame(), PluginTex::cfra, RenderData::cfra, Render::cfra, PluginTex::doit, ELEM, Tex::env, ENV_ANIM, ENV_PLANE, Tex::extend, Render::flag, G, Tex::ima, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE, Tex::imaflag, Tex::iuser, RenderData::mode, Tex::nodetree, ntreeTexBeginExecTree(), Tex::plugin, Render::r, Scene::r, R_ENVMAP, R_SEC_FIELD, Render::scene, Image::source, EnvMap::stype, TEX_CLIP, TEX_ENVMAP, TEX_EXTEND, TEX_INTERPOL, TEX_MIPMAP, TEX_PLUGIN, EnvMap::type, Tex::type, and Tex::use_nodes.
Referenced by init_render_textures().
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().
Definition at line 418 of file render_texture.c.
References BRICONTRGB, cos(), Tex::noisedepth, sin(), TexResult::ta, TexResult::tb, TEX_RGB, TexResult::tg, TexResult::tin, TexResult::tr, turb(), and Tex::turbul.
Referenced by multitex().
Definition at line 394 of file render_texture.c.
References BRICONT, marble_int(), Tex::nabla, TexResult::nor, NULL, TEX_INT, TEX_NOR, tex_normal_derivate(), and TexResult::tin.
Referenced by multitex().
static float marble_int | ( | Tex * | tex, |
float | x, | ||
float | y, | ||
float | z | ||
) | [static] |
Definition at line 364 of file render_texture.c.
References BLI_gTurbulence(), mt, Tex::noisebasis, Tex::noisebasis2, Tex::noisedepth, Tex::noisesize, Tex::noisetype, sqrt(), Tex::stype, TEX_NOISESOFT, tex_saw(), TEX_SHARP, TEX_SHARPER, TEX_SIN, tex_sin(), TEX_SOFT, TEX_TRI, tex_tri(), and Tex::turbul.
Referenced by marble().
Definition at line 622 of file render_texture.c.
References BRICONT, Tex::dist_amount, mg_VLNoise(), Tex::nabla, Tex::noisebasis, Tex::noisebasis2, Tex::noisesize, TexResult::nor, NULL, offs, TEX_INT, TEX_NOR, tex_normal_derivate(), and TexResult::tin.
Referenced by multitex().
Definition at line 597 of file render_texture.c.
References BRICONT, Tex::mg_H, mg_HeteroTerrain(), Tex::mg_lacunarity, Tex::mg_octaves, Tex::mg_offset, Tex::nabla, Tex::noisebasis, Tex::noisesize, TexResult::nor, Tex::ns_outscale, NULL, offs, TEX_INT, TEX_NOR, tex_normal_derivate(), and TexResult::tin.
Referenced by multitex().
Definition at line 536 of file render_texture.c.
References BRICONT, mg_fBm(), Tex::mg_H, Tex::mg_lacunarity, mg_MultiFractal(), Tex::mg_octaves, Tex::nabla, Tex::noisebasis, Tex::noisesize, TexResult::nor, Tex::ns_outscale, NULL, offs, Tex::stype, TEX_INT, TEX_MFRACTAL, TEX_NOR, tex_normal_derivate(), and TexResult::tin.
Referenced by multitex().
Definition at line 566 of file render_texture.c.
References BRICONT, Tex::mg_gain, Tex::mg_H, mg_HybridMultiFractal(), Tex::mg_lacunarity, Tex::mg_octaves, Tex::mg_offset, mg_RidgedMultiFractal(), Tex::nabla, Tex::noisebasis, Tex::noisesize, TexResult::nor, Tex::ns_outscale, NULL, offs, Tex::stype, TEX_INT, TEX_NOR, tex_normal_derivate(), TEX_RIDGEDMF, and TexResult::tin.
Referenced by multitex().
static int multitex | ( | Tex * | tex, |
float * | texvec, | ||
float * | dxt, | ||
float * | dyt, | ||
int | osatex, | ||
TexResult * | texres, | ||
short | thread, | ||
short | which_output | ||
) | [static] |
Definition at line 1171 of file render_texture.c.
References blend(), clouds(), Tex::coba, copy_v3_v3(), do_colorband(), envmaptex(), Tex::flag, Tex::ima, imagewrap(), imagewraposa(), magic(), marble(), mg_distNoiseTex(), mg_HTerrainTex(), mg_mFractalOrfBmTex(), mg_ridgedOrHybridMFTex(), mul_v3_fl(), Tex::nodetree, Tex::noisesize, ntreeTexExecTree(), NULL, ocean_texture(), plugintex(), pointdensitytex(), R, R_TEXNODE_PREVIEW, stucci(), Tex::stype, TexResult::ta, tag_image_time(), TexResult::talpha, TexResult::tb, TEX_BLEND, TEX_CLOUDS, TEX_COLORBAND, TEX_DISTNOISE, TEX_ENVMAP, TEX_FBM, TEX_HTERRAIN, TEX_HYBRIDMF, TEX_IMAGE, TEX_MAGIC, TEX_MARBLE, TEX_MFRACTAL, TEX_MUSGRAVE, TEX_NOISE, TEX_OCEAN, TEX_PLUGIN, TEX_POINTDENSITY, TEX_RGB, TEX_RIDGEDMF, TEX_STUCCI, TEX_VORONOI, TEX_VOXELDATA, TEX_WOOD, texnoise(), TexResult::tg, TexResult::tin, TexResult::tr, Tex::type, Tex::use_nodes, voronoiTex(), voxeldatatex(), and wood().
Referenced by do_halo_tex(), do_lamp_tex(), do_sky_tex(), do_volume_tex(), externtex(), multitex_mtex(), and multitex_nodes().
int multitex_ext | ( | Tex * | tex, |
float * | texvec, | ||
float * | dxt, | ||
float * | dyt, | ||
int | osatex, | ||
TexResult * | texres | ||
) |
Definition at line 1361 of file render_texture.c.
References multitex_nodes(), and NULL.
Referenced by brush_gen_texture_cache(), do_texture_effector(), paint_get_tex_pixel(), and texture_procedural().
Definition at line 1367 of file render_texture.c.
References multitex_nodes(), NULL, and Tex::use_nodes.
Referenced by dynamicPaint_setInitialColor(), and get_texture_value().
int multitex_mtex | ( | ShadeInput * | shi, |
MTex * | mtex, | ||
float * | texvec, | ||
float * | dxt, | ||
float * | dyt, | ||
TexResult * | texres | ||
) |
Definition at line 1345 of file render_texture.c.
References multitex(), Tex::nodetree, ntreeTexExecTree(), ShadeInput::osatex, R, R_TEXNODE_PREVIEW, MTex::tex, ShadeInput::thread, Tex::use_nodes, and MTex::which_output.
Referenced by compatible_bump_compute(), do_material_tex(), and ntap_bump_compute().
int multitex_nodes | ( | Tex * | tex, |
float * | texvec, | ||
float * | dxt, | ||
float * | dyt, | ||
int | osatex, | ||
TexResult * | texres, | ||
short | thread, | ||
short | which_output, | ||
ShadeInput * | shi, | ||
MTex * | mtex | ||
) |
Definition at line 1288 of file render_texture.c.
References BKE_image_get_ibuf(), copy_v3_v3(), do_2d_mapping(), ShadeInput::facenor, Tex::ima, Tex::iuser, MAP_COL, MAP_COLMIR, MAP_COLSPEC, MTex::mapping, MTex::mapto, MTEX_FLAT, multitex(), NULL, MTex::object, R, R_COLOR_MANAGEMENT, ImBuf::rect_float, srgb_to_linearrgb_v3_v3(), MTex::tex, TEX_IMAGE, MTex::texco, TEXCO_ORCO, TexResult::tr, Tex::type, ShadeInput::vlr, MTex::which_output, and zero_v3().
Referenced by do_proc(), multitex_ext(), multitex_ext_safe(), and node_shader_exec_texture().
static int ntap_bump_compute | ( | NTapBump * | ntap_bump, |
ShadeInput * | shi, | ||
MTex * | mtex, | ||
Tex * | tex, | ||
TexResult * | texres, | ||
float | Tnor, | ||
float * | co, | ||
float * | dx, | ||
float * | dy, | ||
float * | texvec, | ||
float * | dxt, | ||
float * | dyt | ||
) | [static] |
Definition at line 1908 of file render_texture.c.
References DerivedMesh::auto_bump_scale, BKE_image_get_ibuf(), copy_m3_m4(), copy_v3_v3(), cross_v3_v3v3(), Object::derivedFinal, dot_v3v3(), ShadeInput::dxco, ShadeInput::dyco, fabsf, Tex::flag, NTapBump::fPrevMagnitude, Tex::ima, Tex::imaflag, NTapBump::init_done, invert_m3_m3(), NTapBump::iPrevBumpSpace, Tex::iuser, len_v2(), len_v3(), MAX2, MTEX_5TAP_BUMP, MTEX_BUMP_OBJECTSPACE, MTEX_BUMP_TEXTURESPACE, mul_m3_v3(), mul_transposed_m3_v3(), mult_m4_m4m4(), multitex_mtex(), TexResult::nor, MTex::norfac, normalize_v3(), NULL, ObjectRen::ob, Object::obmat, ShadeInput::obr, R, RGBTOBW, NTapBump::sgn_det, MTex::size, sqrtf, TexResult::talpha, TexResult::tb, TEX_COLORBAND, TEX_DERIVATIVEMAP, TEX_IMAGE, TEX_NOR, MTex::texco, texco_mapping(), TEXCO_UV, MTex::texflag, TexResult::tg, TexResult::tin, TexResult::tr, Tex::type, ShadeInput::vn, NTapBump::vNacc, NTapBump::vNorg, NTapBump::vR1, NTapBump::vR2, ImBuf::x, and ImBuf::y.
Referenced by do_material_tex().
static void ntap_bump_init | ( | NTapBump * | ntap_bump | ) | [static] |
Definition at line 1903 of file render_texture.c.
Referenced by do_material_tex().
static int plugintex | ( | Tex * | tex, |
float * | texvec, | ||
float * | dxt, | ||
float * | dyt, | ||
int | osatex, | ||
TexResult * | texres | ||
) | [static] |
Definition at line 750 of file render_texture.c.
References BRICONT, BRICONTRGB, copy_v3_v3(), PluginTex::data, PluginTex::doit, TexResult::nor, NULL, Tex::plugin, PluginTex::result, Render::result, Tex::stype, TexResult::ta, TexResult::tb, TEX_NOR, TEX_RGB, TexResult::tg, TexResult::tin, TexResult::tr, and PluginTex::version.
Referenced by multitex().
void RE_free_sample_material | ( | Material * | mat | ) |
Definition at line 3622 of file render_texture.c.
References free_material(), free_texture(), MAX_MTEX, MEM_freeN(), Material::mtex, NULL, Material::septex, and MTex::tex.
Referenced by dynamicPaint_freeBrushMaterials().
Definition at line 3537 of file render_texture.c.
References Tex::adt, Material::adt, ADT_RECALC_ANIM, BKE_animsys_evaluate_animdata(), BKE_curframe(), BKE_image_user_calc_frame(), cache_pointdensity(), cache_voxeldata(), RenderData::cfra, copy_m4_m4(), ELEM, ELEM3, ELEM4, ImageUser::flag, Tex::id, Material::id, Tex::ima, IMA_ANIM_ALWAYS, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE, Object::imat, Object::imat_ren, invert_m4_m4(), Tex::iuser, localize_material(), localize_texture(), MA_TYPE_SURFACE, MA_TYPE_VOLUME, MAP_ALPHA, MAP_COL, MAP_DENSITY, MAP_REFLECTION_COL, MAP_TRANSMISSION_COL, MTex::mapto, Material::material_type, MAX_MTEX, Material::mtex, MTEX_ALPHAMIX, MTEX_NEGATIVE, MTEX_RGBTOINT, MTEX_STENCIL, NULL, MTex::object, Object::obmat, Scene::r, Render::scene, Material::septex, Image::source, MTex::tex, TEX_POINTDENSITY, TEX_VOXELDATA, MTex::texco, TEXCO_GLOB, TEXCO_OBJECT, TEXCO_ORCO, TEXCO_UV, MTex::texflag, Tex::type, unit_m4(), Render::viewinv, Render::viewmat, Render::winmat, Render::winx, and Render::winy.
Referenced by dynamicPaint_updateBrushMaterials().
void RE_sample_material_color | ( | Material * | mat, |
float | color[3], | ||
float * | alpha, | ||
const float | volume_co[3], | ||
const float | surface_co[3], | ||
int | face_index, | ||
short | hit_quad, | ||
DerivedMesh * | orcoDm, | ||
Object * | ob | ||
) |
Definition at line 3653 of file render_texture.c.
References ShadeInput::actuv, Material::alpha, ShadeInput::alpha, Material::b, ShadeInput::b, CD_MTFACE, MVert::co, ShadeInput::co, co, copy_v3_v3(), CustomData_get_active_layer_index(), CustomData_get_layer_index(), CustomData_number_of_layers(), CustomDataLayer::data, data, VolumeSettings::density, do_material_tex(), do_volume_tex(), DerivedMesh::faceData, Material::g, ShadeInput::g, DerivedMesh::getFaceArray, DerivedMesh::getVertArray, ShadeInput::gl, i, Object::imat, CustomData::layers, ShadeInput::lo, MA_TYPE_SURFACE, MA_TYPE_VOLUME, MAP_DENSITY, MAP_REFLECTION_COL, MAP_TRANSMISSION_COL, ShadeInput::mat, Material::material_type, mul_m4_v3(), CustomDataLayer::name, ShadeInputUV::name, normal_tri_v3(), ObjectInstanceRen::ob, ShadeInput::obi, Material::r, ShadeInput::r, VolumeSettings::reflection_col, textured_face_generate_uv(), ShadeInput::totuv, unit_m4(), ShadeInputUV::uv, MTFace::uv, ShadeInput::uv, MFace::v1, MFace::v2, MFace::v3, MFace::v4, Render::viewinv, and Material::vol.
Referenced by dynamicPaint_doMaterialTex().
void render_realtime_texture | ( | ShadeInput * | shi, |
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().
Definition at line 494 of file render_texture.c.
References BLI_gNoise(), copy_v3_v3(), Tex::noisebasis, Tex::noisesize, Tex::noisetype, TexResult::nor, Tex::stype, TEX_INT, TEX_NOISESOFT, TEX_NOR, tex_normal_derivate(), TEX_WALLOUT, TexResult::tin, and Tex::turbul.
Referenced by multitex().
Definition at line 167 of file render_texture.c.
References Tex::coba, do_colorband(), Tex::flag, TexResult::nor, TEX_COLORBAND, and TexResult::tin.
Referenced by clouds(), marble(), mg_distNoiseTex(), mg_HTerrainTex(), mg_mFractalOrfBmTex(), mg_ridgedOrHybridMFTex(), stucci(), voronoiTex(), and wood().
static float tex_saw | ( | float | a | ) | [static] |
Definition at line 290 of file render_texture.c.
References M_PI.
Referenced by marble_int(), and wood_int().
static float tex_sin | ( | float | a | ) | [static] |
Definition at line 282 of file render_texture.c.
References sin().
Referenced by marble_int(), and wood_int().
static float tex_tri | ( | float | a | ) | [static] |
Definition at line 301 of file render_texture.c.
References fabsf, floorf, and M_PI.
Referenced by marble_int(), and wood_int().
static void texco_mapping | ( | ShadeInput * | shi, |
Tex * | tex, | ||
MTex * | mtex, | ||
float * | co, | ||
float * | dx, | ||
float * | dy, | ||
float * | texvec, | ||
float * | dxt, | ||
float * | dyt | ||
) | [static] |
Definition at line 1592 of file render_texture.c.
References do_2d_mapping(), Tex::extend, ShadeInput::facenor, Tex::flag, floorf, MTex::ofs, ShadeInput::osatex, MTex::projx, MTex::projy, MTex::projz, MTex::size, TEX_IMAGE, TEX_REPEAT, TEX_REPEAT_XMIR, TEX_REPEAT_YMIR, Tex::texfilter, TXF_BOX, Tex::type, and ShadeInput::vlr.
Referenced by compatible_bump_compute(), do_material_tex(), and ntap_bump_compute().
Definition at line 727 of file render_texture.c.
References BLI_rand(), BRICONT, div, Tex::noisedepth, TEX_INT, TexResult::tin, and simple_enum_gen::val.
Referenced by multitex().
void texture_rgb_blend | ( | float | in[3], |
const float | tex[3], | ||
const float | out[3], | ||
float | fact, | ||
float | facg, | ||
int | blendtype | ||
) |
Definition at line 1383 of file render_texture.c.
References copy_v3_v3(), fabsf, MA_RAMP_COLOR, MA_RAMP_HUE, MA_RAMP_LINEAR, MA_RAMP_SAT, MA_RAMP_SOFT, MA_RAMP_VAL, MTEX_ADD, MTEX_BLEND, MTEX_BLEND_COLOR, MTEX_BLEND_HUE, MTEX_BLEND_SAT, MTEX_BLEND_VAL, MTEX_DARK, MTEX_DIFF, MTEX_DIV, MTEX_LIGHT, MTEX_LIN_LIGHT, MTEX_MUL, MTEX_OVERLAY, MTEX_SCREEN, MTEX_SOFT_LIGHT, MTEX_SUB, and ramp_blend().
float texture_value_blend | ( | float | tex, |
float | out, | ||
float | fact, | ||
float | facg, | ||
int | blendtype | ||
) |
Definition at line 1517 of file render_texture.c.
References fabsf, MTEX_ADD, MTEX_BLEND, MTEX_DARK, MTEX_DIFF, MTEX_DIV, MTEX_LIGHT, MTEX_LIN_LIGHT, MTEX_MUL, MTEX_OVERLAY, MTEX_SCREEN, MTEX_SOFT_LIGHT, MTEX_SUB, and SWAP.
static void textured_face_generate_uv | ( | float * | uv, |
float * | normal, | ||
float * | hit, | ||
float * | v1, | ||
float * | v2, | ||
float * | v3 | ||
) | [static] |
Definition at line 3511 of file render_texture.c.
References axis_dominant_v3(), and CLAMP().
Referenced by RE_sample_material_color().
Definition at line 651 of file render_texture.c.
References BRICONT, BRICONTRGB, cellNoiseV(), fabs(), fabsf, Tex::nabla, Tex::noisesize, TexResult::nor, Tex::ns_outscale, NULL, offs, TexResult::ta, TexResult::tb, TEX_INT, TEX_NOR, tex_normal_derivate(), TEX_RGB, TexResult::tg, TexResult::tin, TexResult::tr, Tex::vn_coltype, Tex::vn_distm, Tex::vn_mexp, Tex::vn_w1, Tex::vn_w2, Tex::vn_w3, Tex::vn_w4, and voronoi().
Referenced by multitex().
Definition at line 343 of file render_texture.c.
References BRICONT, Tex::nabla, TexResult::nor, NULL, TEX_INT, TEX_NOR, tex_normal_derivate(), TexResult::tin, and wood_int().
Referenced by multitex(), and xml_read_shader_graph().
static float wood_int | ( | Tex * | tex, |
float | x, | ||
float | y, | ||
float | z | ||
) | [static] |
Definition at line 312 of file render_texture.c.
References BLI_gNoise(), Tex::noisebasis, Tex::noisebasis2, Tex::noisesize, Tex::noisetype, sqrtf, Tex::stype, TEX_BAND, TEX_BANDNOISE, TEX_NOISESOFT, TEX_RING, TEX_RINGNOISE, tex_saw(), TEX_SIN, tex_sin(), TEX_TRI, tex_tri(), and Tex::turbul.
Referenced by wood().
Definition at line 127 of file pipeline.c.