Blender  V2.59
Classes | Typedefs | Functions | Variables
render_texture.c File Reference
#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_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_global.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_library.h"
#include "BKE_texture.h"
#include "BKE_key.h"
#include "BKE_ipo.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 "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, float *tex, float *out, 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)
void do_volume_tex (ShadeInput *shi, float *xyz, int mapto_flag, float *col, float *val)
void do_halo_tex (HaloRen *har, float xn, float yn, float *colf)
void do_sky_tex (float *rco, float *lo, float *dxyview, float *hor, float *zen, float *blend, int skyflag, short thread)
void do_lamp_tex (LampRen *la, float *lavec, ShadeInput *shi, float *colf, int effect)
int externtex (MTex *mtex, float *vec, float *tin, float *tr, float *tg, float *tb, float *ta, const int thread)
void render_realtime_texture (ShadeInput *shi, Image *ima)

Variables

struct Render R

Detailed Description

Definition in file render_texture.c.


Typedef Documentation

typedef struct NTapBump NTapBump

Function Documentation

static int blend ( Tex tex,
float *  texvec,
TexResult texres 
) [static]
static int clouds ( Tex tex,
float *  texvec,
TexResult texres 
) [static]
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]
static void compatible_bump_init ( CompatibleBump compat_bump) [static]

Definition at line 1683 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]
static int cubemap ( MTex mtex,
VlakRen vlr,
float *  n,
float  x,
float  y,
float  z,
float *  adr1,
float *  adr2 
) [static]
static int cubemap_glob ( float *  n,
float  x,
float  y,
float  z,
float *  adr1,
float *  adr2 
) [static]

Definition at line 814 of file render_texture.c.

References fabs(), mul_mat3_m4_v3(), NULL, R, and VECCOPY.

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 910 of file render_texture.c.

References fabs(), Object::imat, mul_mat3_m4_v3(), NULL, and VECCOPY.

Referenced by do_2d_mapping().

static void do_2d_mapping ( MTex mtex,
float *  t,
VlakRen vlr,
float *  n,
float *  dxt,
float *  dyt 
) [static]
void do_halo_tex ( HaloRen har,
float  xn,
float  yn,
float *  colf 
)
void do_lamp_tex ( LampRen la,
float *  lavec,
ShadeInput shi,
float *  colf,
int  effect 
)
void do_material_tex ( ShadeInput shi)

Definition at line 2110 of file render_texture.c.

References ShadeInput::actuv, ShadeInput::alpha, MTex::alphafac, ShadeInput::amb, ShadeInput::ambb, MTex::ambfac, ShadeInput::ambg, ShadeInput::ambr, MTex::b, B, BKE_image_get_ibuf(), MTex::blendtype, calc_R_ref(), ShadeInput::co, co, MTex::colfac, MTex::colspecfac, compatible_bump_compute(), compatible_bump_init(), compatible_bump_uv_derivs(), 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, fabs(), MTex::g, ShadeInput::gl, ShadeInput::har, MTex::hardfac, i, Tex::ima, Tex::imaflag, Object::imat_ren, INPR, Tex::iuser, 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_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, MTex::r, ShadeInput::r, R, R_COLOR_MANAGEMENT, R_NO_TEX, ShadeInput::ray_mirror, MTex::raymirrfac, ImBuf::rect_float, ShadeInput::ref, ShadeInput::refcol, ShadeInput::refl, 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_ENVMAP, TEX_IMAGE, TEX_NOR, TEX_NORMALMAP, 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, VECADD, VECCOPY, ShadeInput::vlr, ShadeInput::vn, MTex::warpfac, and ShadeInput::winco.

void do_sky_tex ( float *  rco,
float *  lo,
float *  dxyview,
float *  hor,
float *  zen,
float *  blend,
int  skyflag,
short  thread 
)
void do_volume_tex ( ShadeInput shi,
float *  xyz,
int  mapto_flag,
float *  col,
float *  val 
)
static void end_render_texture ( Tex tex) [static]

Definition at line 145 of file render_texture.c.

References Tex::nodetree, ntreeEndExecTree(), and Tex::use_nodes.

Referenced by end_render_textures().

void end_render_textures ( Render re)

Definition at line 151 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,
float *  vec,
float *  tin,
float *  tr,
float *  tg,
float *  tb,
float *  ta,
const int  thread 
)
static void init_render_texture ( Render re,
Tex tex 
) [static]
void init_render_textures ( Render re)
static int magic ( Tex tex,
float *  texvec,
TexResult texres 
) [static]
static int marble ( Tex tex,
float *  texvec,
TexResult texres 
) [static]
static float marble_int ( Tex tex,
float  x,
float  y,
float  z 
) [static]
static float mg_distNoiseTex ( Tex tex,
float *  texvec,
TexResult texres 
) [static]
static float mg_HTerrainTex ( Tex tex,
float *  texvec,
TexResult texres 
) [static]
static float mg_mFractalOrfBmTex ( Tex tex,
float *  texvec,
TexResult texres 
) [static]
static float mg_ridgedOrHybridMFTex ( Tex tex,
float *  texvec,
TexResult texres 
) [static]
static int multitex ( Tex tex,
float *  texvec,
float *  dxt,
float *  dyt,
int  osatex,
TexResult texres,
short  thread,
short  which_output 
) [static]
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 
)

Definition at line 1361 of file render_texture.c.

References multitex_nodes(), NULL, and Tex::use_nodes.

Referenced by get_texture_value().

int multitex_mtex ( ShadeInput shi,
MTex mtex,
float *  texvec,
float *  dxt,
float *  dyt,
TexResult texres 
)
int multitex_nodes ( Tex tex,
float *  texvec,
float *  dxt,
float *  dyt,
int  osatex,
TexResult texres,
short  thread,
short  which_output,
ShadeInput shi,
MTex mtex 
)
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]
static void ntap_bump_init ( NTapBump ntap_bump) [static]

Definition at line 1897 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]
void render_realtime_texture ( ShadeInput shi,
Image ima 
)
static int stucci ( Tex tex,
float *  texvec,
TexResult texres 
) [static]
static void tex_normal_derivate ( Tex tex,
TexResult texres 
) [static]
static float tex_saw ( float  a) [static]

Definition at line 286 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 278 of file render_texture.c.

References sin().

Referenced by marble_int(), and wood_int().

static float tex_tri ( float  a) [static]

Definition at line 297 of file render_texture.c.

References fabs(), 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]
static int texnoise ( Tex tex,
TexResult texres 
) [static]

Definition at line 723 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,
float *  tex,
float *  out,
float  fact,
float  facg,
int  blendtype 
)
float texture_value_blend ( float  tex,
float  out,
float  fact,
float  facg,
int  blendtype 
)
static float voronoiTex ( Tex tex,
float *  texvec,
TexResult texres 
) [static]
static int wood ( Tex tex,
float *  texvec,
TexResult texres 
) [static]
static float wood_int ( Tex tex,
float  x,
float  y,
float  z 
) [static]

Variable Documentation

struct Render R

Definition at line 127 of file pipeline.c.