|
Blender V4.5
|
#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], 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, 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, 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], float dxt[3], float dyt[3], int osatex, TexResult *texres, const short thread, short which_output, const MTex *mtex, ImagePool *pool) |
| int | multitex_ext (Tex *tex, const float texvec[3], float dxt[3], float dyt[3], int osatex, 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_ARRAY * | random_tex_array |
Definition at line 53 of file texture_procedural.cc.
References atan2f, BRICONT, Tex::flag, 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 multitex().
Definition at line 115 of file texture_procedural.cc.
References BLI_noise_generic_turbulence(), BRICONT, BRICONTRGB, Tex::noisebasis, Tex::noisedepth, Tex::noisesize, Tex::noisetype, Tex::stype, TEX_COLOR, TEX_INT, TEX_NOISESOFT, TEX_RGB, TexResult::tin, and TexResult::trgba.
Referenced by multitex().
|
static |
Definition at line 583 of file texture_procedural.cc.
References copy_v3_v3(), cubemap_glob(), fabsf, ret, x, y, and z().
Referenced by cubemap_glob(), and do_2d_mapping().
|
static |
Definition at line 621 of file texture_procedural.cc.
References Tex::cropxmax, Tex::cropxmin, Tex::cropymax, Tex::cropymin, cubemap_glob(), do_2d_mapping(), ELEM, Tex::extend, Tex::flag, floor, map_to_sphere(), map_to_tube(), MTex::mapping, max, MTEX_FLAT, MTEX_SPHERE, MTEX_TUBE, MTex::tex, TEX_REPEAT, TEX_REPEAT_XMIR, TEX_REPEAT_YMIR, Tex::texfilter, TXF_BOX, wrap(), Tex::xrepeat, and Tex::yrepeat.
Referenced by do_2d_mapping(), multitex_nodes_intern(), and RE_texture_evaluate().
Definition at line 288 of file texture_procedural.cc.
References BRICONTRGB, cosf, Tex::noisedepth, sinf, TEX_RGB, TexResult::tin, TexResult::trgba, turb(), Tex::turbul, x, y, and z().
Referenced by multitex().
Definition at line 275 of file texture_procedural.cc.
References BRICONT, marble_int(), TEX_INT, and TexResult::tin.
Referenced by multitex().
|
static |
Definition at line 237 of file texture_procedural.cc.
References BLI_noise_generic_turbulence(), marble_int(), Tex::noisebasis, Tex::noisebasis2, Tex::noisedepth, Tex::noisesize, Tex::noisetype, sqrtf, Tex::stype, TEX_NOISESOFT, tex_saw(), TEX_SHARP, TEX_SHARPER, TEX_SIN, tex_sin(), TEX_SOFT, TEX_TRI, tex_tri(), Tex::turbul, x, y, and z().
Referenced by marble(), and marble_int().
Definition at line 471 of file texture_procedural.cc.
References BLI_noise_mg_variable_lacunarity(), BRICONT, Tex::dist_amount, mg_distNoiseTex(), Tex::noisebasis, Tex::noisebasis2, TEX_INT, and TexResult::tin.
Referenced by mg_distNoiseTex(), and multitex().
Definition at line 453 of file texture_procedural.cc.
References BLI_noise_mg_hetero_terrain(), BRICONT, Tex::mg_H, mg_HTerrainTex(), Tex::mg_lacunarity, Tex::mg_octaves, Tex::mg_offset, Tex::noisebasis, Tex::ns_outscale, TEX_INT, and TexResult::tin.
Referenced by mg_HTerrainTex(), and multitex().
Definition at line 401 of file texture_procedural.cc.
References BLI_noise_mg_fbm(), BLI_noise_mg_multi_fractal(), BRICONT, Tex::mg_H, Tex::mg_lacunarity, mg_mFractalOrfBmTex(), Tex::mg_octaves, Tex::noisebasis, Tex::ns_outscale, Tex::stype, TEX_INT, TEX_MFRACTAL, and TexResult::tin.
Referenced by mg_mFractalOrfBmTex(), and multitex().
Definition at line 426 of file texture_procedural.cc.
References BLI_noise_mg_hybrid_multi_fractal(), BLI_noise_mg_ridged_multi_fractal(), BRICONT, Tex::mg_gain, Tex::mg_H, Tex::mg_lacunarity, Tex::mg_octaves, Tex::mg_offset, mg_ridgedOrHybridMFTex(), Tex::noisebasis, Tex::ns_outscale, Tex::stype, TEX_INT, TEX_RIDGEDMF, and TexResult::tin.
Referenced by mg_ridgedOrHybridMFTex(), and multitex().
|
static |
Definition at line 873 of file texture_procedural.cc.
References BKE_colorband_evaluate(), BKE_image_tag_time(), blend(), clouds(), Tex::coba, copy_v3_v3(), copy_v4_v4(), Tex::flag, Tex::ima, imagewrap(), imagewraposa(), magic(), marble(), mg_distNoiseTex(), mg_HTerrainTex(), mg_mFractalOrfBmTex(), mg_ridgedOrHybridMFTex(), mul_v3_fl(), multitex(), Tex::nodetree, Tex::noisesize, ntreeTexExecTree(), stucci(), Tex::stype, TexResult::talpha, TEX_BLEND, TEX_CLOUDS, TEX_COLORBAND, TEX_DISTNOISE, TEX_FBM, TEX_HTERRAIN, TEX_HYBRIDMF, TEX_IMAGE, TEX_MAGIC, TEX_MARBLE, TEX_MFRACTAL, TEX_MUSGRAVE, TEX_NOISE, TEX_RGB, TEX_RIDGEDMF, TEX_STUCCI, TEX_VORONOI, TEX_WOOD, texnoise(), TexResult::tin, TexResult::trgba, Tex::type, Tex::use_nodes, voronoiTex(), and wood().
Referenced by multitex(), multitex_nodes_intern(), and RE_texture_evaluate().
| int multitex_ext | ( | struct Tex * | tex, |
| const float | texvec[3], | ||
| float | dxt[3], | ||
| float | dyt[3], | ||
| int | osatex, | ||
| 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 1149 of file texture_procedural.cc.
References multitex_ext(), and multitex_nodes_intern().
Referenced by do_texture_effector(), and multitex_ext().
| 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 1176 of file texture_procedural.cc.
References multitex_ext_safe(), and multitex_nodes_intern().
Referenced by BKE_texture_get_value_ex(), dynamic_paint_set_init_color_tex_to_imseq_cb(), dynamic_paint_set_init_color_tex_to_vcol_cb(), and multitex_ext_safe().
| 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, | ||
| const MTex * | mtex, | ||
| ImagePool * | pool ) |
Definition at line 1122 of file texture_procedural.cc.
References multitex_nodes(), and multitex_nodes_intern().
Referenced by colorfn(), do_proc(), multitex_nodes(), and multitex_nodes().
|
static |
Definition at line 997 of file texture_procedural.cc.
References BKE_image_pool_acquire_ibuf(), BKE_image_pool_release_ibuf(), ImBuf::byte_buffer, ImBufByteBuffer::colorspace, copy_v3_v3(), ImBufFloatBuffer::data, do_2d_mapping(), ImBuf::float_buffer, Tex::ima, IMB_colormanagement_colorspace_to_scene_linear_v3(), Tex::iuser, MAP_COL, MTex::mapping, MTex::mapto, MTEX_FLAT, multitex(), multitex_nodes_intern(), MTex::object, MTex::tex, TEX_IMAGE, TEX_RGB, MTex::texco, TEXCO_ORCO, TexResult::trgba, Tex::type, MTex::which_output, and zero_v3().
Referenced by multitex_ext(), multitex_ext_safe(), multitex_nodes(), and multitex_nodes_intern().
| 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] ) |
Definition at line 1284 of file texture_procedural.cc.
References MTex::b, copy_v3_fl3(), copy_v4_v4(), do_2d_mapping(), MTex::g, IMB_colormanagement_get_luminance(), multitex(), MTex::ofs, MTex::projx, MTex::projy, MTex::projz, MTex::r, RE_texture_evaluate(), MTex::size, MTex::tex, TEX_IMAGE, TexResult::tin, TexResult::trgba, Tex::type, and MTex::which_output.
Referenced by BKE_brush_sample_masktex(), BKE_brush_sample_tex_3d(), brush_gen_texture(), get_cpa_texture(), paint_get_tex_pixel(), psys_get_texture(), RE_texture_evaluate(), and RE_texture_evaluate().
| void RE_texture_rng_exit | ( | void | ) |
Definition at line 42 of file texture_procedural.cc.
References BLI_rng_threaded_free(), random_tex_array, and RE_texture_rng_exit().
Referenced by BKE_blender_free(), RE_texture_evaluate(), and RE_texture_rng_exit().
| void RE_texture_rng_init | ( | void | ) |
Definition at line 37 of file texture_procedural.cc.
References BLI_rng_threaded_new(), random_tex_array, and RE_texture_rng_init().
Referenced by main(), RE_texture_evaluate(), and RE_texture_rng_init().
Definition at line 364 of file texture_procedural.cc.
References BLI_noise_generic_noise(), Tex::noisebasis, Tex::noisesize, Tex::noisetype, Tex::stype, TEX_INT, TEX_NOISESOFT, TEX_WALLOUT, TexResult::tin, and Tex::turbul.
Referenced by multitex().
|
static |
Definition at line 162 of file texture_procedural.cc.
References b, M_PI, and tex_saw().
Referenced by marble_int(), tex_saw(), and wood_int().
|
static |
Definition at line 154 of file texture_procedural.cc.
References sinf, and tex_sin().
Referenced by marble_int(), tex_sin(), and wood_int().
|
static |
Definition at line 175 of file texture_procedural.cc.
References b, fabsf, floorf, M_PI, and tex_tri().
Referenced by marble_int(), tex_tri(), and wood_int().
Definition at line 557 of file texture_procedural.cc.
References BLI_rng_thread_rand(), BRICONT, Tex::noisedepth, random_tex_array, TEX_INT, texnoise(), and TexResult::tin.
Referenced by multitex(), and texnoise().
| float texture_value_blend | ( | float | tex, |
| float | out, | ||
| float | fact, | ||
| float | facg, | ||
| int | blendtype ) |
| in | Destination |
| tex | Texture. |
| out | Previous color. |
| fact | Texture strength. |
| facg | Button strength value. |
Definition at line 1201 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, out, and texture_value_blend().
Referenced by get_cpa_texture(), psys_get_texture(), RE_texture_evaluate(), and texture_value_blend().
Definition at line 489 of file texture_procedural.cc.
References BLI_noise_cell_v3(), BLI_noise_voronoi(), BRICONT, BRICONTRGB, dot_v4v4(), ELEM, fabsf, Tex::ns_outscale, TEX_COL1, TEX_COL2, TEX_COL3, TEX_INT, TEX_RGB, TexResult::tin, TexResult::trgba, Tex::vn_coltype, Tex::vn_distm, Tex::vn_mexp, Tex::vn_w1, Tex::vn_w2, Tex::vn_w3, Tex::vn_w4, and voronoiTex().
Referenced by multitex(), and voronoiTex().
Definition at line 225 of file texture_procedural.cc.
References BRICONT, TEX_INT, TexResult::tin, and wood_int().
Referenced by multitex().
|
static |
Definition at line 186 of file texture_procedural.cc.
References BLI_noise_generic_noise(), 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(), Tex::turbul, wood_int(), x, y, and z().
Referenced by wood(), and wood_int().
|
static |
Definition at line 35 of file texture_procedural.cc.
Referenced by RE_texture_rng_exit(), RE_texture_rng_init(), and texnoise().