61 float r_rot_scale[2][2],
70 rescale_m4(mat, (
float[3]){1.0f / scale[0], 1.0f / scale[1], 0.0});
102 switch (color_type) {
110 gp_style = &gp_style_tmp;
115 memcpy(&gp_style_tmp, gp_style,
sizeof(*gp_style));
116 gp_style = &gp_style_tmp;
132 gp_style = &gp_style_tmp;
143 gp_style = &gp_style_tmp;
153 gp_style = &gp_style_tmp;
191 for (
int i = 0; i < mat_len; i++) {
196 int mat_id =
pool->used_count++;
310 for (
int i = 0; i < pool_id; i++) {
311 matpool = matpool->
next;
314 *r_ubo_mat = matpool->
ubo;
316 *r_tex_fill = matpool->
tex_fill[mat_id];
355 gp_light[1].
color[0] = -1.0f;
362 return 1.0f / (4.0f *
M_PI);
411 gp_light[1].
color[0] = -1.0f;
419 if (lightpool ==
NULL) {
466 if (*vldata ==
NULL) {
467 *vldata =
MEM_callocN(
sizeof(**vldata),
"GPENCIL_ViewLayerData");
typedef float(TangentPoint)[2]
void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock)
struct ImBuf * BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **r_lock)
struct GPUTexture * BKE_image_get_gpu_texture(struct Image *image, struct ImageUser *iuser, struct ImBuf *ibuf)
struct MaterialGPencilStyle * BKE_gpencil_material_settings(struct Object *ob, short act)
int BKE_object_material_count_eval(struct Object *ob)
#define BLI_BITMAP_SIZE(_num)
MINLINE int max_ii(int a, int b)
bool invert_m4(float R[4][4])
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 normalize_m4_m4(float R[4][4], const float M[4][4]) ATTR_NONNULL()
void copy_m4_m4(float m1[4][4], const float m2[4][4])
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 float normalize_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)
#define BLI_memblock_create(elem_size)
void * BLI_memblock_alloc(BLI_memblock *mblk) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define CLAMP3(vec, b, c)
#define GPENCIL_VERTEX_MODE(gpd)
@ GP_MATERIAL_GRADIENT_RADIAL
@ GP_MATERIAL_FILL_STYLE_GRADIENT
@ GP_MATERIAL_FILL_STYLE_TEXTURE
@ GP_MATERIAL_FILL_STYLE_SOLID
@ GP_MATERIAL_STROKE_STYLE_SOLID
@ GP_MATERIAL_STROKE_STYLE_TEXTURE
@ GP_MATERIAL_DISABLE_STENCIL
@ GP_MATERIAL_IS_STROKE_HOLDOUT
@ GP_MATERIAL_IS_FILL_HOLDOUT
@ 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)
struct GPUTexture GPUTexture
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 Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input 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 a color
void ** DRW_view_layer_engine_data_ensure(DrawEngineType *engine_type, void(*callback)(void *storage))
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
#define GPENCIL_MATERIAL_BUFFER_LEN
#define GPENCIL_LIGHT_BUFFER_LEN
static MaterialGPencilStyle * gpencil_viewport_material_overrides(GPENCIL_PrivateData *pd, Object *ob, int color_type, MaterialGPencilStyle *gp_style, const eV3DShadingLightingMode lighting_mode)
GPENCIL_LightPool * gpencil_light_pool_create(GPENCIL_PrivateData *pd, Object *UNUSED(ob))
void gpencil_light_pool_populate(GPENCIL_LightPool *lightpool, Object *ob)
static GPENCIL_MaterialPool * gpencil_material_pool_add(GPENCIL_PrivateData *pd)
GPENCIL_ViewLayerData * GPENCIL_view_layer_data_ensure(void)
static void gpencil_shade_color(float color[3])
GPENCIL_LightPool * gpencil_light_pool_add(GPENCIL_PrivateData *pd)
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])
void gpencil_light_pool_free(void *storage)
static struct GPUTexture * gpencil_image_texture_get(Image *image, bool *r_alpha_premult)
void gpencil_material_pool_free(void *storage)
static float light_power_get(const Light *la)
static void gpencil_view_layer_data_free(void *storage)
GPENCIL_MaterialPool * gpencil_material_pool_create(GPENCIL_PrivateData *pd, Object *ob, int *ofs)
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)
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