Blender
V3.3
|
#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_colorband.h"
#include "BKE_image.h"
#include "BKE_material.h"
#include "BKE_node.h"
#include "BKE_scene.h"
#include "BKE_texture.h"
#include "NOD_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 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) |
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_ARRAY * | random_tex_array |
Definition at line 64 of file texture_procedural.c.
References atan2f, BRICONT, Tex::flag, float(), M_PI, sqrtf, Tex::stype, t, tex, 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(), b_bone_deform(), BKE_brush_debug_print_state(), BKE_defvert_weight_to_rgb(), BKE_pchan_bbone_deform_segment_index(), blo_do_versions_280(), brush_defaults(), calculate_average_color(), checker_board_color_tint(), checker_board_grid_fill(), blender::compositor::HueSaturationValueCorrectNode::convert_to_operations(), blender::compositor::HueSaturationValueNode::convert_to_operations(), do_vpaint_brush_blur_loops(), do_vpaint_brush_blur_verts(), drw_state_set(), edbm_blend_from_shape_exec(), blender::gpu::shader::ShaderCreateInfo::fragment_out(), GEO_uv_parametrizer_stretch_blend(), get_cpa_texture(), GPU_blend(), GPU_state_set(), load_main_from_memory(), multitex(), NODE_DEFINE(), blender::nodes::node_shader_tex_image_cc::node_shader_gpu_tex_image(), p_flush_uvs_blend(), paint_2d_do_making_brush(), paint_2d_op(), psys_get_texture(), pygpu_state_blend_get(), rna_def_modifier_type_common(), subsurface_random_walk_remap(), svm_node_layer_weight(), svm_node_tex_image_box(), UI_GetThemeColorBlendShade3ubv(), vpaint_blend(), wm_draw_region_blend(), and wpaint_blend().
Definition at line 128 of file texture_procedural.c.
References BLI_noise_generic_turbulence(), BRICONT, BRICONTRGB, Tex::noisebasis, Tex::noisedepth, Tex::noisesize, Tex::noisetype, Tex::stype, tex, TEX_COLOR, TEX_INT, TEX_NOISESOFT, TEX_RGB, TexResult::tin, and TexResult::trgba.
Referenced by multitex().
|
static |
Definition at line 599 of file texture_procedural.c.
References copy_v3_v3(), fabsf, nor, NULL, ret, x, y, y1, and z.
Referenced by do_2d_mapping().
|
static |
Definition at line 637 of file texture_procedural.c.
References blender::compositor::area(), Tex::cropxmax, Tex::cropxmin, Tex::cropymax, Tex::cropymin, cubemap_glob(), ELEM, Tex::extend, Tex::flag, blender::math::floor(), map_to_sphere(), map_to_tube(), MTex::mapping, max, MTEX_FLAT, MTEX_SPHERE, MTEX_TUBE, SWAP, tex, MTex::tex, TEX_REPEAT, TEX_REPEAT_XMIR, TEX_REPEAT_YMIR, Tex::texfilter, TXF_BOX, blender::bke::image::partial_update::wrap(), Tex::xrepeat, and Tex::yrepeat.
Referenced by multitex_nodes_intern(), and RE_texture_evaluate().
Definition at line 301 of file texture_procedural.c.
References BRICONTRGB, cosf, Tex::noisedepth, sinf, tex, TEX_RGB, TexResult::tin, TexResult::trgba, turb(), Tex::turbul, x, y, and z.
Referenced by add_node(), BLI_file_magic_is_zstd(), imb_is_a_hdr(), imb_is_a_jpeg(), imb_is_a_photoshop(), multitex(), blender::tests::TEST(), and zstd_read_seek_table().
Definition at line 288 of file texture_procedural.c.
References BRICONT, marble_int(), tex, TEX_INT, and TexResult::tin.
Referenced by multitex().
Definition at line 250 of file texture_procedural.c.
References BLI_noise_generic_turbulence(), float(), Tex::noisebasis, Tex::noisebasis2, Tex::noisedepth, Tex::noisesize, Tex::noisetype, sqrtf, Tex::stype, tex, 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().
Definition at line 486 of file texture_procedural.c.
References BLI_noise_mg_variable_lacunarity(), BRICONT, Tex::dist_amount, Tex::noisebasis, Tex::noisebasis2, tex, TEX_INT, and TexResult::tin.
Referenced by multitex().
Definition at line 468 of file texture_procedural.c.
References BLI_noise_mg_hetero_terrain(), BRICONT, Tex::mg_H, Tex::mg_lacunarity, Tex::mg_octaves, Tex::mg_offset, Tex::noisebasis, Tex::ns_outscale, tex, TEX_INT, and TexResult::tin.
Referenced by multitex().
|
static |
Definition at line 416 of file texture_procedural.c.
References BLI_noise_mg_fbm(), BLI_noise_mg_multi_fractal(), BRICONT, float(), Tex::mg_H, Tex::mg_lacunarity, Tex::mg_octaves, Tex::noisebasis, Tex::ns_outscale, Tex::stype, tex, TEX_INT, TEX_MFRACTAL, and TexResult::tin.
Referenced by multitex().
|
static |
Definition at line 441 of file texture_procedural.c.
References BLI_noise_mg_hybrid_multi_fractal(), BLI_noise_mg_ridged_multi_fractal(), BRICONT, float(), Tex::mg_gain, Tex::mg_H, Tex::mg_lacunarity, Tex::mg_octaves, Tex::mg_offset, Tex::noisebasis, Tex::ns_outscale, Tex::stype, tex, TEX_INT, TEX_RIDGEDMF, and TexResult::tin.
Referenced by multitex().
|
static |
Definition at line 891 of file texture_procedural.c.
References BKE_colorband_evaluate(), BKE_image_tag_time(), blend(), clouds(), Tex::coba, col, 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(), Tex::nodetree, Tex::noisesize, ntreeTexExecTree(), NULL, blender::compositor::pool, stucci(), Tex::stype, TexResult::talpha, tex, 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_nodes_intern(), and RE_texture_evaluate().
int multitex_ext | ( | struct Tex * | tex, |
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 | ||
) |
Use it for stuff which is out of render pipeline.
Definition at line 1161 of file texture_procedural.c.
References multitex_nodes_intern(), NULL, blender::compositor::pool, and tex.
Referenced by do_texture_effector(), blender::compositor::TextureBaseOperation::execute_pixel_sampled(), and blender::compositor::TextureBaseOperation::update_memory_buffer_partial().
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 1188 of file texture_procedural.c.
References multitex_nodes_intern(), NULL, blender::compositor::pool, and tex.
Referenced by BKE_texture_get_value_ex(), and dynamic_paint_set_init_color_tex_to_imseq_cb().
int multitex_nodes | ( | struct Tex * | tex, |
const float | texvec[3], | ||
float | dxt[3], | ||
float | dyt[3], | ||
int | osatex, | ||
struct TexResult * | texres, | ||
short | thread, | ||
short | which_output, | ||
struct MTex * | mtex, | ||
struct ImagePool * | pool | ||
) |
Only for internal node usage.
this is called from the shader and texture nodes Use it from render pipeline only!
Definition at line 1134 of file texture_procedural.c.
References multitex_nodes_intern(), blender::compositor::pool, and tex.
Referenced by do_proc().
|
static |
Definition at line 1015 of file texture_procedural.c.
References BKE_image_pool_acquire_ibuf(), BKE_image_pool_release_ibuf(), copy_v3_v3(), do_2d_mapping(), Tex::ima, IMB_colormanagement_colorspace_to_scene_linear_v3(), Tex::iuser, MAP_COL, MTex::mapping, MTex::mapto, MTEX_FLAT, multitex(), NULL, MTex::object, blender::compositor::pool, ImBuf::rect_colorspace, ImBuf::rect_float, tex, 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(), and multitex_nodes().
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] | ||
) |
Definition at line 1302 of file texture_procedural.c.
References MTex::b, copy_v3_fl3(), copy_v4_v4(), do_2d_mapping(), MTex::g, IMB_colormanagement_get_luminance(), multitex(), NULL, MTex::ofs, blender::compositor::pool, MTex::projx, MTex::projy, MTex::projz, MTex::r, usdtokens::rgb(), MTex::size, tex, 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(), paint_get_tex_pixel_col(), and psys_get_texture().
Definition at line 53 of file texture_procedural.c.
References BLI_rng_threaded_free(), NULL, and random_tex_array.
Referenced by BKE_blender_free().
Definition at line 48 of file texture_procedural.c.
References BLI_rng_threaded_new(), and random_tex_array.
Referenced by main().
Definition at line 377 of file texture_procedural.c.
References BLI_noise_generic_noise(), Tex::noisebasis, Tex::noisesize, Tex::noisetype, Tex::stype, tex, TEX_INT, TEX_NOISESOFT, TEX_WALLOUT, TexResult::tin, and Tex::turbul.
Referenced by multitex().
Definition at line 175 of file texture_procedural.c.
References Freestyle::a, usdtokens::b(), and M_PI.
Referenced by marble_int(), and wood_int().
Definition at line 167 of file texture_procedural.c.
References Freestyle::a, and sinf.
Referenced by marble_int(), and wood_int().
Definition at line 188 of file texture_procedural.c.
References Freestyle::a, usdtokens::b(), fabsf, floorf, and M_PI.
Referenced by marble_int(), and wood_int().
Definition at line 573 of file texture_procedural.c.
References BLI_rng_thread_rand(), BRICONT, float(), Tex::noisedepth, random_tex_array, tex, TEX_INT, and TexResult::tin.
Referenced by multitex().
in | Destination |
tex | Texture. |
out | Previous color. |
fact | Texture strength. |
facg | Button strength value. |
Definition at line 1213 of file texture_procedural.c.
References ATTR_FALLTHROUGH, col, fabsf, 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, usdtokens::out(), SWAP, and tex.
Referenced by get_cpa_texture(), and psys_get_texture().
Definition at line 504 of file texture_procedural.c.
References BLI_noise_cell_v3(), BLI_noise_voronoi(), BRICONT, BRICONTRGB, dot_v4v4(), fabsf, Tex::ns_outscale, tex, 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, and Tex::vn_w4.
Referenced by multitex().
Definition at line 238 of file texture_procedural.c.
References BRICONT, tex, TEX_INT, TexResult::tin, and wood_int().
Referenced by multitex().
Definition at line 199 of file texture_procedural.c.
References BLI_noise_generic_noise(), float(), Tex::noisebasis, Tex::noisebasis2, Tex::noisesize, Tex::noisetype, sqrtf, Tex::stype, tex, TEX_BAND, TEX_BANDNOISE, TEX_NOISESOFT, TEX_RING, TEX_RINGNOISE, tex_saw(), TEX_SIN, tex_sin(), TEX_TRI, tex_tri(), Tex::turbul, x, y, and z.
Referenced by wood().
|
static |
Definition at line 46 of file texture_procedural.c.
Referenced by RE_texture_rng_exit(), RE_texture_rng_init(), and texnoise().