Blender  V2.93
Functions | Variables
texture_procedural.c File Reference
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "BLI_math.h"
#include "BLI_noise.h"
#include "BLI_rand.h"
#include "BLI_utildefines.h"
#include "DNA_anim_types.h"
#include "DNA_image_types.h"
#include "DNA_light_types.h"
#include "DNA_material_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_texture_types.h"
#include "IMB_colormanagement.h"
#include "IMB_imbuf_types.h"
#include "BKE_image.h"
#include "BKE_node.h"
#include "BKE_colorband.h"
#include "BKE_material.h"
#include "BKE_scene.h"
#include "BKE_texture.h"
#include "MEM_guardedalloc.h"
#include "render_types.h"
#include "texture_common.h"
#include "RE_texture.h"

Go to the source code of this file.

Functions

void RE_texture_rng_init (void)
 
void RE_texture_rng_exit (void)
 
static void tex_normal_derivate (const Tex *tex, TexResult *texres)
 
static int blend (const Tex *tex, const float texvec[3], TexResult *texres)
 
static int clouds (const Tex *tex, const float texvec[3], TexResult *texres)
 
static float tex_sin (float a)
 
static float tex_saw (float a)
 
static float tex_tri (float a)
 
static float wood_int (const Tex *tex, float x, float y, float z)
 
static int wood (const Tex *tex, const float texvec[3], TexResult *texres)
 
static float marble_int (const Tex *tex, float x, float y, float z)
 
static int marble (const Tex *tex, const float texvec[3], TexResult *texres)
 
static int magic (const Tex *tex, const float texvec[3], TexResult *texres)
 
static int stucci (const Tex *tex, const float texvec[3], TexResult *texres)
 
static int mg_mFractalOrfBmTex (const Tex *tex, const float texvec[3], TexResult *texres)
 
static int mg_ridgedOrHybridMFTex (const Tex *tex, const float texvec[3], TexResult *texres)
 
static int mg_HTerrainTex (const Tex *tex, const float texvec[3], TexResult *texres)
 
static int mg_distNoiseTex (const Tex *tex, const float texvec[3], TexResult *texres)
 
static int voronoiTex (const Tex *tex, const float texvec[3], TexResult *texres)
 
static int texnoise (const Tex *tex, TexResult *texres, int thread)
 
static int cubemap_glob (const float n[3], float x, float y, float z, float *adr1, float *adr2)
 
static void do_2d_mapping (const MTex *mtex, float texvec[3], const float n[3], float dxt[3], float dyt[3])
 
static int multitex (Tex *tex, const float texvec[3], float dxt[3], float dyt[3], int osatex, TexResult *texres, const short thread, const short which_output, struct ImagePool *pool, const bool skip_load_image, const bool texnode_preview, const bool use_nodes)
 
static int multitex_nodes_intern (Tex *tex, const float texvec[3], float dxt[3], float dyt[3], int osatex, TexResult *texres, const short thread, short which_output, MTex *mtex, struct ImagePool *pool, const bool scene_color_manage, const bool skip_load_image, const bool texnode_preview, const bool use_nodes)
 
int multitex_nodes (Tex *tex, const float texvec[3], float dxt[3], float dyt[3], int osatex, TexResult *texres, const short thread, short which_output, MTex *mtex, struct ImagePool *pool)
 
int multitex_ext (Tex *tex, float texvec[3], float dxt[3], float dyt[3], int osatex, TexResult *texres, const short thread, struct ImagePool *pool, bool scene_color_manage, const bool skip_load_image)
 
int multitex_ext_safe (Tex *tex, const float texvec[3], TexResult *texres, struct ImagePool *pool, bool scene_color_manage, const bool skip_load_image)
 
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)
 
bool RE_texture_evaluate (const MTex *mtex, const float vec[3], const int thread, struct ImagePool *pool, const bool skip_load_image, const bool texnode_preview, float *r_intensity, float r_rgba[4])
 

Variables

static RNG_THREAD_ARRAYrandom_tex_array
 

Function Documentation

◆ blend()

static int blend ( const Tex tex,
const float  texvec[3],
TexResult texres 
)
static

◆ clouds()

static int clouds ( const Tex tex,
const float  texvec[3],
TexResult texres 
)
static

◆ cubemap_glob()

static int cubemap_glob ( const float  n[3],
float  x,
float  y,
float  z,
float adr1,
float adr2 
)
static

Definition at line 861 of file texture_procedural.c.

References copy_v3_v3(), fabsf, nor, NULL, ret, x, y, y1, and z.

Referenced by do_2d_mapping().

◆ do_2d_mapping()

static void do_2d_mapping ( const MTex mtex,
float  texvec[3],
const float  n[3],
float  dxt[3],
float  dyt[3] 
)
static

◆ magic()

static int magic ( const Tex tex,
const float  texvec[3],
TexResult texres 
)
static

◆ marble()

static int marble ( const Tex tex,
const float  texvec[3],
TexResult texres 
)
static

◆ marble_int()

static float marble_int ( const Tex tex,
float  x,
float  y,
float  z 
)
static

◆ mg_distNoiseTex()

static int mg_distNoiseTex ( const Tex tex,
const float  texvec[3],
TexResult texres 
)
static

◆ mg_HTerrainTex()

static int mg_HTerrainTex ( const Tex tex,
const float  texvec[3],
TexResult texres 
)
static

◆ mg_mFractalOrfBmTex()

static int mg_mFractalOrfBmTex ( const Tex tex,
const float  texvec[3],
TexResult texres 
)
static

◆ mg_ridgedOrHybridMFTex()

static int mg_ridgedOrHybridMFTex ( const Tex tex,
const float  texvec[3],
TexResult texres 
)
static

◆ multitex()

static int multitex ( Tex tex,
const float  texvec[3],
float  dxt[3],
float  dyt[3],
int  osatex,
TexResult texres,
const short  thread,
const short  which_output,
struct ImagePool pool,
const bool  skip_load_image,
const bool  texnode_preview,
const bool  use_nodes 
)
static

◆ multitex_ext()

int multitex_ext ( Tex tex,
float  texvec[3],
float  dxt[3],
float  dyt[3],
int  osatex,
TexResult texres,
const short  thread,
struct ImagePool pool,
bool  scene_color_manage,
const bool  skip_load_image 
)
Warning
if the texres's values are not declared zero, check the return value to be sure the color values are set before using the r/g/b values, otherwise you may use uninitialized values - Campbell

Use it for stuff which is out of render pipeline.

Definition at line 1439 of file texture_procedural.c.

References multitex_nodes_intern(), NULL, blender::compositor::pool, and tex.

Referenced by do_texture_effector(), and blender::compositor::TextureBaseOperation::executePixelSampled().

◆ multitex_ext_safe()

int multitex_ext_safe ( Tex tex,
const float  texvec[3],
TexResult texres,
struct ImagePool pool,
bool  scene_color_manage,
const bool  skip_load_image 
)

◆ multitex_nodes()

int multitex_nodes ( Tex tex,
const float  texvec[3],
float  dxt[3],
float  dyt[3],
int  osatex,
TexResult texres,
const short  thread,
short  which_output,
MTex mtex,
struct ImagePool pool 
)

Definition at line 1405 of file texture_procedural.c.

References multitex_nodes_intern(), blender::compositor::pool, and tex.

Referenced by do_proc().

◆ multitex_nodes_intern()

static int multitex_nodes_intern ( Tex tex,
const float  texvec[3],
float  dxt[3],
float  dyt[3],
int  osatex,
TexResult texres,
const short  thread,
short  which_output,
MTex mtex,
struct ImagePool pool,
const bool  scene_color_manage,
const bool  skip_load_image,
const bool  texnode_preview,
const bool  use_nodes 
)
static

◆ RE_texture_evaluate()

bool RE_texture_evaluate ( const MTex mtex,
const float  vec[3],
const int  thread,
struct ImagePool pool,
const bool  skip_load_image,
const bool  texnode_preview,
float r_intensity,
float  r_rgba[4] 
)

◆ RE_texture_rng_exit()

void RE_texture_rng_exit ( void  )

Definition at line 69 of file texture_procedural.c.

References BLI_rng_threaded_free(), NULL, and random_tex_array.

Referenced by BKE_blender_free().

◆ RE_texture_rng_init()

void RE_texture_rng_init ( void  )

Definition at line 64 of file texture_procedural.c.

References BLI_rng_threaded_new(), and random_tex_array.

Referenced by main().

◆ stucci()

static int stucci ( const Tex tex,
const float  texvec[3],
TexResult texres 
)
static

◆ tex_normal_derivate()

static void tex_normal_derivate ( const Tex tex,
TexResult texres 
)
static

◆ tex_saw()

static float tex_saw ( float  a)
static

Definition at line 249 of file texture_procedural.c.

References Freestyle::a, and M_PI.

Referenced by marble_int(), and wood_int().

◆ tex_sin()

static float tex_sin ( float  a)
static

Definition at line 241 of file texture_procedural.c.

References Freestyle::a, and sinf.

Referenced by marble_int(), and wood_int().

◆ tex_tri()

static float tex_tri ( float  a)
static

Definition at line 262 of file texture_procedural.c.

References Freestyle::a, fabsf, floorf, and M_PI.

Referenced by marble_int(), and wood_int().

◆ texnoise()

static int texnoise ( const Tex tex,
TexResult texres,
int  thread 
)
static

◆ texture_rgb_blend()

void texture_rgb_blend ( float  in[3],
const float  tex[3],
const float  out[3],
float  fact,
float  facg,
int  blendtype 
)

◆ texture_value_blend()

float texture_value_blend ( float  tex,
float  out,
float  fact,
float  facg,
int  blendtype 
)

◆ voronoiTex()

static int voronoiTex ( const Tex tex,
const float  texvec[3],
TexResult texres 
)
static

◆ wood()

static int wood ( const Tex tex,
const float  texvec[3],
TexResult texres 
)
static

◆ wood_int()

static float wood_int ( const Tex tex,
float  x,
float  y,
float  z 
)
static

Variable Documentation

◆ random_tex_array

RNG_THREAD_ARRAY* random_tex_array
static

Definition at line 62 of file texture_procedural.c.

Referenced by RE_texture_rng_exit(), RE_texture_rng_init(), and texnoise().