33 matpool->
next =
nullptr;
35 if (matpool->
ubo ==
nullptr) {
45 GPUTexture *gpu_tex =
nullptr;
56 float r_rot_scale[2][2],
105 gp_style = &gp_style_tmp;
110 gp_style_tmp = blender::dna::shallow_copy(*gp_style);
111 gp_style = &gp_style_tmp;
127 gp_style = &gp_style_tmp;
138 gp_style = &gp_style_tmp;
148 gp_style = &gp_style_tmp;
163 const bool is_vertex_mode)
188 for (
int i = 0; i < mat_len; i++) {
193 int mat_id = pool->used_count++;
195 gpMaterial *mat_data = &pool->mat_data[mat_id];
251 pool->tex_stroke[mat_id] =
nullptr;
275 pool->tex_fill[mat_id] =
nullptr;
291 pool->tex_fill[mat_id] =
nullptr;
302 GPUTexture **r_tex_stroke,
303 GPUTexture **r_tex_fill,
304 GPUUniformBuf **r_ubo_mat)
309 for (
int i = 0; i < pool_id; i++) {
310 matpool = matpool->
next;
313 *r_ubo_mat = matpool->
ubo;
315 *r_tex_fill = matpool->
tex_fill[mat_id];
335 if (lightpool->
ubo ==
nullptr) {
355 gp_light[1].color[0] = -1.0f;
362 return 1.0f / (4.0f *
M_PI);
380 float(*mat)[4] =
reinterpret_cast<float(*)[4]
>(&gp_light->right);
383 copy_m4_m4(mat, ob->world_to_object().ptr());
384 gp_light->type = GP_LIGHT_TYPE_SPOT;
385 gp_light->spot_size = cosf(la->spotsize * 0.5f);
386 gp_light->spot_blend = (1.0f - gp_light->spot_size) * la->spotblend;
390 normalize_m4_m4(mat, ob->object_to_world().ptr());
392 gp_light->type = GP_LIGHT_TYPE_SPOT;
393 gp_light->spot_size = cosf(M_PI_2);
394 gp_light->spot_blend = (1.0f - gp_light->spot_size) * 1.0f;
397 normalize_v3_v3(gp_light->forward, ob->object_to_world().ptr()[2]);
398 gp_light->type = GP_LIGHT_TYPE_SUN;
401 gp_light->type = GP_LIGHT_TYPE_POINT;
403 copy_v4_v4(gp_light->position, ob->object_to_world().location());
411 gp_light[1].color[0] = -1.0f;
419 if (lightpool ==
nullptr) {
466 if (*vldata ==
nullptr) {
468 MEM_callocN(
sizeof(**vldata),
"GPENCIL_ViewLayerData"));
GPUTexture * BKE_image_get_gpu_texture(Image *image, ImageUser *iuser)
int BKE_object_material_count_eval(const struct Object *ob)
struct MaterialGPencilStyle * BKE_gpencil_material_settings(struct Object *ob, short act)
#define BLI_BITMAP_SIZE(_num)
MINLINE int max_ii(int a, int b)
void unit_m4(float m[4][4])
void translate_m4(float mat[4][4], float Tx, float Ty, float Tz)
void rescale_m4(float mat[4][4], const float scale[3])
void rotate_m4(float mat[4][4], char axis, float angle)
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void swap_v4_v4(float a[4], float b[4])
MINLINE void add_v3_fl(float r[3], float f)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void copy_v4_fl(float r[4], float f)
void BLI_memblock_destroy(BLI_memblock *mblk, MemblockValFreeFP free_callback) ATTR_NONNULL(1)
void * BLI_memblock_alloc(BLI_memblock *mblk) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define BLI_memblock_create(elem_size)
#define CLAMP3(vec, b, c)
@ GP_MATERIAL_FILL_STYLE_GRADIENT
@ GP_MATERIAL_FILL_STYLE_TEXTURE
@ GP_MATERIAL_FILL_STYLE_SOLID
@ GP_MATERIAL_DISABLE_STENCIL
@ GP_MATERIAL_IS_STROKE_HOLDOUT
@ GP_MATERIAL_IS_FILL_HOLDOUT
@ GP_MATERIAL_STROKE_STYLE_SOLID
@ GP_MATERIAL_STROKE_STYLE_TEXTURE
@ GP_MATERIAL_GRADIENT_RADIAL
@ GP_MATERIAL_FOLLOW_PATH
@ GP_MATERIAL_FOLLOW_FIXED
@ V3D_SHADING_TEXTURE_COLOR
@ V3D_SHADING_VERTEX_COLOR
@ V3D_SHADING_MATERIAL_COLOR
@ V3D_SHADING_OBJECT_COLOR
@ V3D_SHADING_RANDOM_COLOR
@ V3D_SHADING_SINGLE_COLOR
#define DRW_UBO_FREE_SAFE(ubo)
Contains defines and structs used throughout the imbuf module.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert Invert a color
input_tx image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "preview_img") .compute_source("compositor_compute_preview.glsl") .do_static_compilation(true)
void ** DRW_view_layer_engine_data_ensure(DrawEngineType *engine_type, void(*callback)(void *storage))
draw_view in_light_buf[] float
#define GPENCIL_MATERIAL_BUFFER_LEN
#define GPENCIL_LIGHT_BUFFER_LEN
GPENCIL_MaterialPool * gpencil_material_pool_create(GPENCIL_PrivateData *pd, Object *ob, int *ofs, const bool is_vertex_mode)
void gpencil_light_pool_populate(GPENCIL_LightPool *lightpool, Object *ob)
GPENCIL_LightPool * gpencil_light_pool_add(GPENCIL_PrivateData *pd)
static void gpencil_shade_color(float color[3])
GPENCIL_LightPool * gpencil_light_pool_create(GPENCIL_PrivateData *pd, Object *)
static GPENCIL_MaterialPool * gpencil_material_pool_add(GPENCIL_PrivateData *pd)
static MaterialGPencilStyle * gpencil_viewport_material_overrides(GPENCIL_PrivateData *pd, Object *ob, int color_type, MaterialGPencilStyle *gp_style, const eV3DShadingLightingMode lighting_mode)
static void gpencil_uv_transform_get(const float ofs[2], const float scale[2], const float rotation, float r_rot_scale[2][2], float r_offset[2])
GPENCIL_ViewLayerData * GPENCIL_view_layer_data_ensure()
static GPUTexture * gpencil_image_texture_get(Image *image, bool *r_alpha_premult)
void gpencil_light_pool_free(void *storage)
void gpencil_material_pool_free(void *storage)
static float light_power_get(const Light *la)
static void gpencil_view_layer_data_free(void *storage)
void gpencil_light_ambient_add(GPENCIL_LightPool *lightpool, const float color[3])
void gpencil_material_resources_get(GPENCIL_MaterialPool *first_pool, int mat_id, GPUTexture **r_tex_stroke, GPUTexture **r_tex_fill, GPUUniformBuf **r_ubo_mat)
DrawEngineType draw_engine_gpencil_type
@ GP_STROKE_TEXTURE_PREMUL
@ GP_STROKE_ALIGNMENT_STROKE
@ GP_STROKE_ALIGNMENT_OBJECT
@ GP_FILL_GRADIENT_RADIAL
@ GP_STROKE_ALIGNMENT_FIXED
void *(* MEM_callocN)(size_t len, const char *str)
VecBase< float, 3 > float3
gpLight light_data[GPENCIL_LIGHT_BUFFER_LEN]
struct GPUUniformBuf * ubo
gpMaterial mat_data[GPENCIL_MATERIAL_BUFFER_LEN]
struct GPUTexture * tex_fill[GPENCIL_MATERIAL_BUFFER_LEN]
struct GPUUniformBuf * ubo
struct GPENCIL_MaterialPool * next
struct GPUTexture * tex_stroke[GPENCIL_MATERIAL_BUFFER_LEN]
GPENCIL_LightPool * last_light_pool
float v3d_single_color[3]
struct BLI_memblock * gp_material_pool
struct BLI_memblock * gp_light_pool
GPENCIL_MaterialPool * last_material_pool
struct BLI_memblock * gp_vfx_pool
struct BLI_memblock * gp_material_pool
struct BLI_memblock * gp_maskbit_pool
struct BLI_memblock * gp_light_pool
struct BLI_memblock * gp_layer_pool
struct BLI_memblock * gp_object_pool