Blender
V3.3
|
#include "DRW_render.h"
#include "DNA_light_types.h"
#include "BKE_image.h"
#include "BLI_hash.h"
#include "BLI_math_color.h"
#include "BLI_memblock.h"
#include "GPU_uniform_buffer.h"
#include "IMB_imbuf_types.h"
#include "gpencil_engine.h"
Go to the source code of this file.
|
static |
Definition at line 40 of file gpencil_draw_data.c.
References BKE_image_acquire_ibuf(), BKE_image_get_gpu_texture(), BKE_image_release_ibuf(), IMA_ALPHA_PREMUL, image(), lock, NULL, and ImBuf::rect.
Referenced by gpencil_material_pool_create().
void gpencil_light_ambient_add | ( | GPENCIL_LightPool * | lightpool, |
const float | color[3] | ||
) |
Definition at line 342 of file gpencil_draw_data.c.
References gpLight::color, color, copy_v3_v3(), GP_LIGHT_TYPE_AMBIENT, GPENCIL_LIGHT_BUFFER_LEN, GPENCIL_LightPool::light_data, GPENCIL_LightPool::light_used, and gpLight::type.
Referenced by GPENCIL_engine_init().
GPENCIL_LightPool* gpencil_light_pool_add | ( | GPENCIL_PrivateData * | pd | ) |
Definition at line 329 of file gpencil_draw_data.c.
References BLI_memblock_alloc(), gpLight::color, GPENCIL_PrivateData::gp_light_pool, GPU_uniformbuf_create, GPENCIL_PrivateData::last_light_pool, GPENCIL_LightPool::light_data, GPENCIL_LightPool::light_used, NULL, and GPENCIL_LightPool::ubo.
Referenced by GPENCIL_engine_init(), and gpencil_light_pool_create().
GPENCIL_LightPool* gpencil_light_pool_create | ( | GPENCIL_PrivateData * | pd, |
Object * | UNUSEDob | ||
) |
Definition at line 415 of file gpencil_draw_data.c.
References gpencil_light_pool_add(), GPENCIL_PrivateData::last_light_pool, and NULL.
Definition at line 434 of file gpencil_draw_data.c.
References DRW_UBO_FREE_SAFE, and GPENCIL_LightPool::ubo.
Referenced by GPENCIL_engine_init(), and gpencil_view_layer_data_free().
void gpencil_light_pool_populate | ( | GPENCIL_LightPool * | lightpool, |
Object * | ob | ||
) |
Definition at line 371 of file gpencil_draw_data.c.
References gpLight::color, copy_m4_m4(), copy_v3_v3(), copy_v4_v4(), cosf, Object::data, Light::energy, float(), gpLight::forward, GP_LIGHT_TYPE_POINT, GP_LIGHT_TYPE_SPOT, GP_LIGHT_TYPE_SUN, GPENCIL_LIGHT_BUFFER_LEN, if(), Object::imat, invert_m4(), LA_AREA, LA_SPOT, LA_SUN, GPENCIL_LightPool::light_data, light_power_get(), GPENCIL_LightPool::light_used, M_PI_2, mul_v3_fl(), normalize_m4_m4(), normalize_v3_v3(), Object::obmat, gpLight::position, Light::r, gpLight::right, gpLight::spot_blend, gpLight::spot_size, Light::spotblend, Light::spotsize, gpLight::type, and Light::type.
Referenced by GPENCIL_cache_populate().
|
static |
Definition at line 28 of file gpencil_draw_data.c.
References BLI_memblock_alloc(), GPENCIL_PrivateData::gp_material_pool, GPU_uniformbuf_create, GPENCIL_PrivateData::last_material_pool, GPENCIL_MaterialPool::mat_data, GPENCIL_MaterialPool::next, NULL, GPENCIL_MaterialPool::ubo, and GPENCIL_MaterialPool::used_count.
Referenced by gpencil_material_pool_create().
GPENCIL_MaterialPool* gpencil_material_pool_create | ( | GPENCIL_PrivateData * | pd, |
Object * | ob, | ||
int * | ofs | ||
) |
Creates a linked list of material pool containing all materials assigned for a given object. We merge the material pools together if object does not contain a huge amount of materials. Also return an offset to the first material of the object in the UBO.
Definition at line 165 of file gpencil_draw_data.c.
References MaterialGPencilStyle::alignment_mode, gpMaterial::alignment_rot, MaterialGPencilStyle::alignment_rotation, BKE_gpencil_material_settings(), BKE_object_material_count_eval(), copy_v4_v4(), cosf, Object::data, gpMaterial::fill_color, gpMaterial::fill_mix_color, MaterialGPencilStyle::fill_rgba, MaterialGPencilStyle::fill_style, gpMaterial::fill_texture_mix, gpMaterial::fill_uv_offset, gpMaterial::fill_uv_rot_scale, gpMaterial::flag, MaterialGPencilStyle::flag, GP_FILL_GRADIENT_RADIAL, GP_FILL_GRADIENT_USE, GP_FILL_HOLDOUT, GP_FILL_TEXTURE_CLIP, GP_FILL_TEXTURE_PREMUL, GP_FILL_TEXTURE_USE, GP_MATERIAL_DISABLE_STENCIL, GP_MATERIAL_FILL_STYLE_GRADIENT, GP_MATERIAL_FILL_STYLE_TEXTURE, GP_MATERIAL_FLIP_FILL, GP_MATERIAL_FOLLOW_FIXED, GP_MATERIAL_FOLLOW_OBJ, GP_MATERIAL_FOLLOW_PATH, GP_MATERIAL_GRADIENT_RADIAL, GP_MATERIAL_IS_FILL_HOLDOUT, GP_MATERIAL_IS_STROKE_HOLDOUT, GP_MATERIAL_MODE_DOT, GP_MATERIAL_MODE_LINE, GP_MATERIAL_STROKE_STYLE_TEXTURE, GP_MATERIAL_TEX_CLAMP, GP_STROKE_ALIGNMENT_FIXED, GP_STROKE_ALIGNMENT_OBJECT, GP_STROKE_ALIGNMENT_STROKE, GP_STROKE_DOTS, GP_STROKE_HOLDOUT, GP_STROKE_OVERLAP, GP_STROKE_TEXTURE_PREMUL, GP_STROKE_TEXTURE_USE, gpencil_image_texture_get(), GPENCIL_MATERIAL_BUFFER_LEN, gpencil_material_pool_add(), gpencil_uv_transform_get(), GPENCIL_VERTEX_MODE, gpencil_viewport_material_overrides(), MaterialGPencilStyle::gradient_type, MaterialGPencilStyle::ima, GPENCIL_PrivateData::last_material_pool, View3DShading::light, max_ii(), MaterialGPencilStyle::mix_factor, MaterialGPencilStyle::mix_rgba, MaterialGPencilStyle::mix_stroke_factor, MaterialGPencilStyle::mode, NULL, blender::compositor::pool, View3D::shading, MaterialGPencilStyle::sima, sinf, gpMaterial::stroke_color, MaterialGPencilStyle::stroke_rgba, MaterialGPencilStyle::stroke_style, gpMaterial::stroke_texture_mix, gpMaterial::stroke_u_scale, swap_v4_v4(), MaterialGPencilStyle::texture_angle, MaterialGPencilStyle::texture_offset, MaterialGPencilStyle::texture_pixsize, MaterialGPencilStyle::texture_scale, GPENCIL_MaterialPool::used_count, GPENCIL_PrivateData::v3d, GPENCIL_PrivateData::v3d_color_type, V3D_LIGHTING_STUDIO, and V3D_SHADING_VERTEX_COLOR.
Referenced by GPENCIL_cache_populate().
Definition at line 428 of file gpencil_draw_data.c.
References DRW_UBO_FREE_SAFE, and GPENCIL_MaterialPool::ubo.
Referenced by GPENCIL_engine_init(), and gpencil_view_layer_data_free().
void gpencil_material_resources_get | ( | GPENCIL_MaterialPool * | first_pool, |
int | mat_id, | ||
GPUTexture ** | r_tex_stroke, | ||
GPUTexture ** | r_tex_fill, | ||
GPUUniformBuf ** | r_ubo_mat | ||
) |
Definition at line 302 of file gpencil_draw_data.c.
References GPENCIL_MATERIAL_BUFFER_LEN, GPENCIL_MaterialPool::next, GPENCIL_MaterialPool::tex_fill, GPENCIL_MaterialPool::tex_stroke, and GPENCIL_MaterialPool::ubo.
Referenced by gpencil_layer_cache_populate(), and gpencil_stroke_cache_populate().
Definition at line 79 of file gpencil_draw_data.c.
References add_v3_fl(), CLAMP3, and color.
Referenced by gpencil_viewport_material_overrides().
|
static |
Definition at line 58 of file gpencil_draw_data.c.
References copy_v2_v2(), rescale_m4(), rotate_m4(), translate_m4(), and unit_m4().
Referenced by gpencil_material_pool_create().
GPENCIL_ViewLayerData* GPENCIL_view_layer_data_ensure | ( | void | ) |
Definition at line 458 of file gpencil_draw_data.c.
References BLI_BITMAP_SIZE, BLI_memblock_create, draw_engine_gpencil_type, DRW_view_layer_engine_data_ensure(), GP_MAX_MASKBITS, gpencil_view_layer_data_free(), MEM_callocN, and NULL.
Referenced by GPENCIL_engine_init().
Definition at line 446 of file gpencil_draw_data.c.
References BLI_memblock_destroy(), GPENCIL_ViewLayerData::gp_layer_pool, GPENCIL_ViewLayerData::gp_light_pool, GPENCIL_ViewLayerData::gp_maskbit_pool, GPENCIL_ViewLayerData::gp_material_pool, GPENCIL_ViewLayerData::gp_object_pool, GPENCIL_ViewLayerData::gp_vfx_pool, gpencil_light_pool_free(), gpencil_material_pool_free(), and NULL.
Referenced by GPENCIL_view_layer_data_ensure().
|
static |
Definition at line 93 of file gpencil_draw_data.c.
References Object::color, copy_v3_v3(), copy_v4_fl(), copy_v4_v4(), MaterialGPencilStyle::fill_rgba, MaterialGPencilStyle::fill_style, GP_MATERIAL_FILL_STYLE_GRADIENT, GP_MATERIAL_FILL_STYLE_SOLID, GP_MATERIAL_FILL_STYLE_TEXTURE, GP_MATERIAL_STROKE_STYLE_SOLID, GP_MATERIAL_STROKE_STYLE_TEXTURE, gpencil_shade_color(), MaterialGPencilStyle::ima, MaterialGPencilStyle::mix_factor, MaterialGPencilStyle::mix_stroke_factor, MaterialGPencilStyle::sima, MaterialGPencilStyle::stroke_rgba, MaterialGPencilStyle::stroke_style, V3D_LIGHTING_FLAT, V3D_SHADING_MATERIAL_COLOR, V3D_SHADING_OBJECT_COLOR, V3D_SHADING_RANDOM_COLOR, V3D_SHADING_SINGLE_COLOR, V3D_SHADING_TEXTURE_COLOR, V3D_SHADING_VERTEX_COLOR, and GPENCIL_PrivateData::v3d_single_color.
Referenced by gpencil_material_pool_create().
Definition at line 359 of file gpencil_draw_data.c.
References ELEM, LA_AREA, LA_LOCAL, LA_SPOT, M_PI, and Light::type.
Referenced by gpencil_light_pool_populate().