96 float winmat[4][4], persmat[4][4];
112 float distance_factor = world_pixel_scale * scale * winmat[1][1] * vp_size[1] /
w;
119 if (blur_size[0] > 0.0f) {
125 if (blur_size[1] > 0.0f) {
170 float winmat[4][4], persmat[4][4];
172 float blur_size[2] = {fx->
blur[0], fx->
blur[1]};
183 float distance_factor = (world_pixel_scale * scale * winmat[1][1] * vp_size[1]) /
w;
242 float persmat[4][4], winmat[4][4], ob_center[3], pixsize_uniform[2];
247 float pixel_size[2] = {fx->
size[0], fx->
size[1]};
264 mul_v2_fl(pixel_size, (world_pixel_scale * scale * winmat[1][1] * vp_size[1]) /
w);
274 if (pixel_size[0] > vp_size_inv[0]) {
275 copy_v2_fl2(pixsize_uniform, pixel_size[0], vp_size_inv[1]);
280 int samp_count = (pixel_size[0] / vp_size_inv[0] > 3.0) ? 2 : 1;
285 if (pixel_size[1] > vp_size_inv[1]) {
286 copy_v2_fl2(pixsize_uniform, vp_size_inv[0], pixel_size[1]);
290 int samp_count = (pixel_size[1] / vp_size_inv[1] > 3.0) ? 2 : 1;
303 float uv_mat[4][4], winmat[4][4], persmat[4][4], rot_center[3];
304 float wave_ofs[3], wave_dir[3], wave_phase, blur_dir[2], tmp[2];
306 float blur_size[2] = {fx->
blur[0], fx->
blur[1]};
311 const float ratio = vp_size_inv[1] / vp_size_inv[0];
322 float distance_factor = (world_pixel_scale * scale * winmat[1][1] * vp_size[1]) /
w;
327 rot_center[0] = rot_center[0] * 0.5f + 0.5f;
328 rot_center[1] = rot_center[1] * 0.5f + 0.5f;
332 translate_m4(uv_mat, rot_center[0], rot_center[1], 0.0f);
335 rescale_m4(uv_mat, (
float[3]){1.0f / ratio, 1.0f, 1.0f});
337 rescale_m4(uv_mat, (
float[3]){ratio, 1.0f, 1.0f});
338 translate_m4(uv_mat, -rot_center[0], -rot_center[1], 0.0f);
354 SWAP(
float, wave_ofs[0], wave_ofs[1]);
355 wave_ofs[1] *= -1.0f;
372 copy_v2_fl2(blur_dir, blur_size[0] * vp_size_inv[0], 0.0f);
481 float winmat[4][4], persmat[4][4], wave_center[3];
482 float wave_ofs[3], wave_dir[3], wave_phase;
495 float distance_factor = (world_pixel_scale * scale * winmat[1][1] * vp_size[1]) /
w;
497 wave_center[0] = wave_center[0] * 0.5f + 0.5f;
498 wave_center[1] = wave_center[1] * 0.5f + 0.5f;
510 SWAP(
float, wave_ofs[0], wave_ofs[1]);
511 wave_ofs[1] *= -1.0f;
540 float winmat[4][4], persmat[4][4], swirl_center[3];
554 float distance_factor = (world_pixel_scale * scale * winmat[1][1] * vp_size[1]) /
w;
560 float radius = fx->
radius * distance_factor;
587 .target_fb = &fbl->layer_fb,
588 .source_fb = &fbl->object_fb,
589 .target_color_tx = &pd->color_layer_tx,
590 .source_color_tx = &pd->color_object_tx,
591 .target_reveal_tx = &pd->reveal_layer_tx,
592 .source_reveal_tx = &pd->reveal_object_tx,
595 if (!pd->simplify_fx) {
633 if ((!pd->simplify_fx && tgp_ob->vfx.first !=
NULL) || tgp_ob->do_mat_holdout) {
635 iter.target_fb = &fbl->gpencil_fb;
652 pd->use_object_fb =
true;
653 pd->use_layer_fb =
true;
Camera data-block and utility functions.
Single link-list utility macros. (header only api).
#define BLI_LINKS_APPEND(list, link)
#define LISTBASE_FOREACH(type, var, list)
MINLINE float max_ff(float a, float b)
MINLINE int min_ii(int a, int b)
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])
float mat4_to_scale(const float M[4][4])
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
void rotate_m4(float mat[4][4], char axis, float angle)
MINLINE void copy_v2_fl2(float v[2], float x, float y)
MINLINE void madd_v2_v2fl(float r[2], const float a[2], float f)
MINLINE void mul_v2_v2(float r[2], const float a[2])
MINLINE void mul_v2_fl(float r[2], 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 add_v2_fl(float r[2], float f)
MINLINE void zero_v2(float r[2])
MINLINE float mul_project_m4_v3_zfac(const float mat[4][4], const float co[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float dot_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
void rotate_v2_v2fl(float r[2], const float p[2], float angle)
MINLINE void copy_v2_fl(float r[2], float f)
void * BLI_memblock_alloc(BLI_memblock *mblk) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define GPENCIL_ANY_EDIT_MODE(gpd)
@ eShaderFxGlowMode_Luminance
@ eShaderFxRimMode_Multiply
@ eShaderFxRimMode_Normal
@ eShaderFxRimMode_Overlay
@ eShaderFxRimMode_Subtract
@ eShaderFxRimMode_Divide
@ FX_PIXEL_FILTER_NEAREST
@ DRW_STATE_BLEND_ADD_FULL
@ DRW_STATE_BLEND_ALPHA_PREMUL
struct GPUFrameBuffer GPUFrameBuffer
struct GPUShader GPUShader
struct GPUTexture GPUTexture
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
const float * DRW_viewport_size_get(void)
const float * DRW_viewport_invert_size_get(void)
void DRW_shgroup_uniform_float_copy(DRWShadingGroup *shgroup, const char *name, const float value)
void DRW_view_persmat_get(const DRWView *view, float mat[4][4], bool inverse)
void DRW_shgroup_state_disable(DRWShadingGroup *shgroup, DRWState state)
void DRW_shgroup_state_enable(DRWShadingGroup *shgroup, DRWState state)
void DRW_shgroup_uniform_vec3_copy(DRWShadingGroup *shgroup, const char *name, const float *value)
void DRW_shgroup_call_procedural_triangles(DRWShadingGroup *shgroup, Object *ob, uint tri_count)
void DRW_view_winmat_get(const DRWView *view, float mat[4][4], bool inverse)
void DRW_shgroup_uniform_int_copy(DRWShadingGroup *shgroup, const char *name, const int value)
DRWShadingGroup * DRW_shgroup_create(struct GPUShader *shader, DRWPass *pass)
DRWShadingGroup * DRW_shgroup_create_sub(DRWShadingGroup *shgroup)
void DRW_shgroup_uniform_vec4_copy(DRWShadingGroup *shgroup, const char *name, const float *value)
void DRW_shgroup_uniform_texture_ref(DRWShadingGroup *shgroup, const char *name, GPUTexture **tex)
DRWPass * DRW_pass_create(const char *name, DRWState state)
void DRW_shgroup_uniform_bool_copy(DRWShadingGroup *shgroup, const char *name, const bool value)
void DRW_shgroup_uniform_vec2_copy(DRWShadingGroup *shgroup, const char *name, const float *value)
struct GPUShader * GPENCIL_shader_fx_colorize_get(void)
struct GPUShader * GPENCIL_shader_fx_composite_get(void)
#define GPENCIL_PIXEL_FACTOR
struct GPUShader * GPENCIL_shader_fx_shadow_get(void)
struct GPUShader * GPENCIL_shader_fx_transform_get(void)
struct GPUShader * GPENCIL_shader_fx_rim_get(void)
struct GPUShader * GPENCIL_shader_fx_pixelize_get(void)
struct GPUShader * GPENCIL_shader_fx_blur_get(void)
struct GPUShader * GPENCIL_shader_fx_glow_get(void)
void gpencil_vfx_cache_populate(GPENCIL_Data *vedata, Object *ob, GPENCIL_tObject *tgp_ob)
static void gpencil_vfx_pixelize(PixelShaderFxData *fx, Object *ob, gpIterVfxData *iter)
static void gpencil_vfx_flip(FlipShaderFxData *fx, Object *UNUSED(ob), gpIterVfxData *iter)
static bool effect_is_active(bGPdata *gpd, ShaderFxData *fx, bool is_viewport)
static void gpencil_vfx_shadow(ShadowShaderFxData *fx, Object *ob, gpIterVfxData *iter)
static void gpencil_vfx_rim(RimShaderFxData *fx, Object *ob, gpIterVfxData *iter)
static DRWShadingGroup * gpencil_vfx_pass_create(const char *name, DRWState state, gpIterVfxData *iter, GPUShader *sh)
static void gpencil_vfx_wave(WaveShaderFxData *fx, Object *ob, gpIterVfxData *iter)
static void gpencil_vfx_blur(BlurShaderFxData *fx, Object *ob, gpIterVfxData *iter)
static void gpencil_vfx_glow(GlowShaderFxData *fx, Object *UNUSED(ob), gpIterVfxData *iter)
static void gpencil_vfx_swirl(SwirlShaderFxData *fx, Object *UNUSED(ob), gpIterVfxData *iter)
static void gpencil_vfx_colorize(ColorizeShaderFxData *fx, Object *UNUSED(ob), gpIterVfxData *iter)
struct gpIterVfxData gpIterVfxData
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
ccl_gpu_kernel_postfix ccl_global float int int int int sh
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
struct GPENCIL_StorageList * stl
struct GPENCIL_FramebufferList * fbl
struct BLI_memblock * gp_vfx_pool
struct GPENCIL_PrivateData * pd
struct GPENCIL_tObject::@218 vfx
GPUFrameBuffer ** target_fb
GPUFrameBuffer ** source_fb
GPUTexture ** target_reveal_tx
GPUFrameBuffer ** target_fb
GPUTexture ** source_reveal_tx
GPUTexture ** source_color_tx
GPUTexture ** target_color_tx