Blender V5.0
texture_procedural.cc File Reference
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "BLI_math_geom.h"
#include "BLI_noise.h"
#include "BLI_rand.h"
#include "BLI_utildefines.h"
#include "DNA_material_types.h"
#include "DNA_node_types.h"
#include "DNA_texture_types.h"
#include "IMB_colormanagement.hh"
#include "IMB_imbuf_types.hh"
#include "BKE_colorband.hh"
#include "BKE_image.hh"
#include "NOD_texture.h"
#include "texture_common.h"
#include "RE_texture.h"

Go to the source code of this file.

Functions

void RE_texture_rng_init ()
void RE_texture_rng_exit ()
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])
static int multitex (Tex *tex, const float texvec[3], TexResult *texres, const short thread, const short which_output, 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], TexResult *texres, const short thread, short which_output, const MTex *mtex, 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], TexResult *texres, const short thread, short which_output, const MTex *mtex, ImagePool *pool)
int multitex_ext (Tex *tex, const float texvec[3], TexResult *texres, const short thread, ImagePool *pool, bool scene_color_manage, const bool skip_load_image)
int multitex_ext_safe (Tex *tex, const float texvec[3], TexResult *texres, ImagePool *pool, bool scene_color_manage, const bool skip_load_image)
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, 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()

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

Definition at line 53 of file texture_procedural.cc.

References atan2f, BRICONT, Tex::flag, float, M_PI, sqrtf, Tex::stype, TEX_DIAG, TEX_EASE, TEX_FLIPBLEND, TEX_HALO, TEX_INT, TEX_LIN, TEX_QUAD, TEX_RAD, TexResult::tin, x, and y.

Referenced by armdef_accumulate_bone(), blender::bke::b_bone_deform(), BKE_brush_debug_print_state(), BKE_defvert_weight_to_rgb(), BKE_pchan_bbone_deform_clamp_segment_index(), blender::animrig::blend_layer_results(), blo_do_versions_280(), brush_defaults(), btw_smooth_exec(), calculate_average_color(), checker_board_color_tint(), checker_board_grid_fill(), do_vpaint_brush_blur_loops(), do_vpaint_brush_blur_verts(), blender::seq::do_wipe_effect(), ease_fcurve_segment(), edbm_blend_from_shape_exec(), blender::seq::effect_handle_for_blend_mode_get(), blender::gpu::shader::ShaderCreateInfo::fragment_out(), get_cpa_texture(), slim::get_interactive_result_blended_with_original(), GPU_blend(), GPU_state_set(), load_main_from_memory(), multitex(), NODE_DEFINE(), blender::nodes::node_shader_tex_image_cc::node_shader_gpu_tex_image(), blender::geometry::p_flush_uvs(), paint_2d_do_making_brush(), paint_2d_op(), ProcDef(), ProcNoInputs(), psys_get_texture(), pygpu_state_blend_get(), rna_def_modifier_type_common(), svm_node_layer_weight(), svm_node_tex_image_box(), TexDef(), slim::MatrixTransferChart::transfer_uvs_blended(), UI_GetThemeColorBlendShade3ubv(), blender::geometry::uv_parametrizer_slim_stretch_iteration(), blender::geometry::uv_parametrizer_stretch_blend(), vpaint_blend(), wm_draw_region_blend(), wpaint_blend(), and slim::MatrixTransferChart::~MatrixTransferChart().

◆ clouds()

◆ cubemap_glob()

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

Definition at line 583 of file texture_procedural.cc.

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

Referenced by do_2d_mapping().

◆ do_2d_mapping()

◆ magic()

◆ marble()

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

Definition at line 275 of file texture_procedural.cc.

References BRICONT, marble_int(), TEX_INT, and TexResult::tin.

Referenced by multitex(), ProcDef(), and TexDef().

◆ marble_int()

◆ mg_distNoiseTex()

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

◆ mg_HTerrainTex()

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

◆ mg_mFractalOrfBmTex()

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

◆ mg_ridgedOrHybridMFTex()

◆ multitex()

◆ multitex_ext()

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

WARNING(@ideasman42): 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.

Use it for stuff which is out of render pipeline.

Definition at line 923 of file texture_procedural.cc.

References multitex_nodes_intern().

Referenced by do_texture_effector().

◆ multitex_ext_safe()

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

Nodes disabled. extern-tex doesn't support nodes (#ntreeBeginExec() can't be called when rendering is going on).

Use it for stuff which is out of render pipeline.

Definition at line 944 of file texture_procedural.cc.

References multitex_nodes_intern().

Referenced by BKE_texture_get_value_ex(), dynamic_paint_set_init_color_tex_to_imseq_cb(), and dynamic_paint_set_init_color_tex_to_vcol_cb().

◆ multitex_nodes()

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

Definition at line 911 of file texture_procedural.cc.

References multitex_nodes_intern().

Referenced by colorfn(), and do_proc().

◆ multitex_nodes_intern()

int multitex_nodes_intern ( Tex * tex,
const float texvec[3],
TexResult * texres,
const short thread,
short which_output,
const MTex * mtex,
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,
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 42 of file texture_procedural.cc.

References BLI_rng_threaded_free(), and random_tex_array.

Referenced by BKE_blender_free().

◆ RE_texture_rng_init()

void RE_texture_rng_init ( void )

Definition at line 37 of file texture_procedural.cc.

References BLI_rng_threaded_new(), and random_tex_array.

Referenced by main().

◆ stucci()

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

◆ tex_saw()

float tex_saw ( float a)
static

Definition at line 162 of file texture_procedural.cc.

References b, and M_PI.

Referenced by marble_int(), and wood_int().

◆ tex_sin()

float tex_sin ( float a)
static

Definition at line 154 of file texture_procedural.cc.

References sinf.

Referenced by marble_int(), and wood_int().

◆ tex_tri()

float tex_tri ( float a)
static

Definition at line 175 of file texture_procedural.cc.

References b, fabsf, floorf, and M_PI.

Referenced by marble_int(), and wood_int().

◆ texnoise()

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

◆ texture_value_blend()

float texture_value_blend ( float tex,
float out,
float fact,
float facg,
int blendtype )
Parameters
inDestination
texTexture.
outPrevious color.
factTexture strength.
facgButton strength value.

Definition at line 957 of file texture_procedural.cc.

References ATTR_FALLTHROUGH, fabsf, in, max_ff(), min_ff(), 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 out.

Referenced by get_cpa_texture(), and psys_get_texture().

◆ voronoiTex()

◆ wood()

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

Definition at line 225 of file texture_procedural.cc.

References BRICONT, TEX_INT, TexResult::tin, and wood_int().

Referenced by multitex(), ProcDef(), and TexDef().

◆ wood_int()

Variable Documentation

◆ random_tex_array

RNG_THREAD_ARRAY* random_tex_array
static

Definition at line 35 of file texture_procedural.cc.

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