[Bf-blender-cvs] [7000eb00f86] master: Merge branch 'blender-v2.92-release'
Antonio Vazquez
noreply at git.blender.org
Thu Jan 28 10:37:29 CET 2021
Commit: 7000eb00f86ea522e8661b7e431091968c9cac41
Author: Antonio Vazquez
Date: Thu Jan 28 10:37:19 2021 +0100
Branches: master
https://developer.blender.org/rB7000eb00f86ea522e8661b7e431091968c9cac41
Merge branch 'blender-v2.92-release'
===================================================================
===================================================================
diff --cc source/blender/draw/engines/gpencil/gpencil_engine.c
index b6f0817adb3,153dcfb6ea7..f437223aae3
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@@ -16,9 -16,9 +16,9 @@@
* Copyright 2017, Blender Foundation.
*/
--/** \file
-- * \ingroup draw
-- */
++ /** \file
++ * \ingroup draw
++ */
#include "DRW_engine.h"
#include "DRW_render.h"
@@@ -53,931 -53,937 +53,948 @@@
#include "UI_resources.h"
--/* *********** FUNCTIONS *********** */
++ /* *********** FUNCTIONS *********** */
--void GPENCIL_engine_init(void *ved)
++void GPENCIL_engine_init(void* ved)
{
-- GPENCIL_Data *vedata = (GPENCIL_Data *)ved;
-- GPENCIL_StorageList *stl = vedata->stl;
-- GPENCIL_TextureList *txl = vedata->txl;
-- GPENCIL_FramebufferList *fbl = vedata->fbl;
-- DefaultTextureList *dtxl = DRW_viewport_texture_list_get();
-- DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get();
-- const DRWContextState *ctx = DRW_context_state_get();
-- const View3D *v3d = ctx->v3d;
--
-- if (!stl->pd) {
-- stl->pd = MEM_callocN(sizeof(GPENCIL_PrivateData), "GPENCIL_PrivateData");
-- }
--
-- if (txl->dummy_texture == NULL) {
-- const float pixels[1][4] = {{1.0f, 0.0f, 1.0f, 1.0f}};
-- txl->dummy_texture = DRW_texture_create_2d(1, 1, GPU_RGBA8, DRW_TEX_WRAP, (float *)pixels);
-- }
--
-- GPENCIL_ViewLayerData *vldata = GPENCIL_view_layer_data_ensure();
--
-- /* Resize and reset memblocks. */
-- BLI_memblock_clear(vldata->gp_light_pool, gpencil_light_pool_free);
-- BLI_memblock_clear(vldata->gp_material_pool, gpencil_material_pool_free);
-- BLI_memblock_clear(vldata->gp_object_pool, NULL);
-- BLI_memblock_clear(vldata->gp_layer_pool, NULL);
-- BLI_memblock_clear(vldata->gp_vfx_pool, NULL);
-- BLI_memblock_clear(vldata->gp_maskbit_pool, NULL);
--
-- stl->pd->gp_light_pool = vldata->gp_light_pool;
-- stl->pd->gp_material_pool = vldata->gp_material_pool;
-- stl->pd->gp_maskbit_pool = vldata->gp_maskbit_pool;
-- stl->pd->gp_object_pool = vldata->gp_object_pool;
-- stl->pd->gp_layer_pool = vldata->gp_layer_pool;
-- stl->pd->gp_vfx_pool = vldata->gp_vfx_pool;
-- stl->pd->view_layer = ctx->view_layer;
-- stl->pd->scene = ctx->scene;
-- stl->pd->v3d = ctx->v3d;
-- stl->pd->last_light_pool = NULL;
-- stl->pd->last_material_pool = NULL;
-- stl->pd->tobjects.first = NULL;
-- stl->pd->tobjects.last = NULL;
-- stl->pd->tobjects_infront.first = NULL;
-- stl->pd->tobjects_infront.last = NULL;
-- stl->pd->sbuffer_tobjects.first = NULL;
-- stl->pd->sbuffer_tobjects.last = NULL;
-- stl->pd->dummy_tx = txl->dummy_texture;
-- stl->pd->draw_depth_only = !DRW_state_is_fbo();
-- stl->pd->draw_wireframe = (v3d && v3d->shading.type == OB_WIRE) && !stl->pd->draw_depth_only;
-- stl->pd->scene_depth_tx = stl->pd->draw_depth_only ? txl->dummy_texture : dtxl->depth;
-- stl->pd->scene_fb = dfbl->default_fb;
-- stl->pd->is_render = txl->render_depth_tx || (v3d && v3d->shading.type == OB_RENDER);
-- stl->pd->is_viewport = (v3d != NULL);
-- stl->pd->global_light_pool = gpencil_light_pool_add(stl->pd);
-- stl->pd->shadeless_light_pool = gpencil_light_pool_add(stl->pd);
-- /* Small HACK: we don't want the global pool to be reused,
-- * so we set the last light pool to NULL. */
-- stl->pd->last_light_pool = NULL;
--
-- bool use_scene_lights = false;
-- bool use_scene_world = false;
--
-- if (v3d) {
-- use_scene_lights = ((v3d->shading.type == OB_MATERIAL) &&
-- (v3d->shading.flag & V3D_SHADING_SCENE_LIGHTS)) ||
-- ((v3d->shading.type == OB_RENDER) &&
-- (v3d->shading.flag & V3D_SHADING_SCENE_LIGHTS_RENDER));
--
-- use_scene_world = ((v3d->shading.type == OB_MATERIAL) &&
-- (v3d->shading.flag & V3D_SHADING_SCENE_WORLD)) ||
-- ((v3d->shading.type == OB_RENDER) &&
-- (v3d->shading.flag & V3D_SHADING_SCENE_WORLD_RENDER));
--
-- stl->pd->v3d_color_type = (v3d->shading.type == OB_SOLID) ? v3d->shading.color_type : -1;
-- /* Special case: If Vertex Paint mode, use always Vertex mode. */
-- if (v3d->shading.type == OB_SOLID && ctx->obact && ctx->obact->type == OB_GPENCIL &&
-- ctx->obact->mode == OB_MODE_VERTEX_GPENCIL) {
-- stl->pd->v3d_color_type = V3D_SHADING_VERTEX_COLOR;
-- }
--
-- copy_v3_v3(stl->pd->v3d_single_color, v3d->shading.single_color);
--
-- /* For non active frame, use only lines in multiedit mode. */
-- const bool overlays_on = (v3d->flag2 & V3D_HIDE_OVERLAYS) == 0;
-- stl->pd->use_multiedit_lines_only = !overlays_on ||
-- (v3d->gp_flag & V3D_GP_SHOW_MULTIEDIT_LINES) != 0;
--
-- const bool shmode_xray_support = v3d->shading.type <= OB_SOLID;
-- stl->pd->xray_alpha = (shmode_xray_support && XRAY_ENABLED(v3d)) ? XRAY_ALPHA(v3d) : 1.0f;
-- }
-- else if (stl->pd->is_render) {
-- use_scene_lights = true;
-- use_scene_world = true;
-- stl->pd->use_multiedit_lines_only = false;
-- stl->pd->xray_alpha = 1.0f;
-- stl->pd->v3d_color_type = -1;
-- }
--
-- stl->pd->use_lighting = (v3d && v3d->shading.type > OB_SOLID) || stl->pd->is_render;
-- stl->pd->use_lights = use_scene_lights;
--
-- if (txl->render_depth_tx != NULL) {
-- stl->pd->scene_depth_tx = txl->render_depth_tx;
-- stl->pd->scene_fb = fbl->render_fb;
-- }
--
-- gpencil_light_ambient_add(stl->pd->shadeless_light_pool, (float[3]){1.0f, 1.0f, 1.0f});
--
-- World *world = ctx->scene->world;
-- if (world != NULL && use_scene_world) {
-- gpencil_light_ambient_add(stl->pd->global_light_pool, &world->horr);
-- }
-- else if (v3d) {
-- float world_light[3];
-- copy_v3_fl(world_light, v3d->shading.studiolight_intensity);
-- gpencil_light_ambient_add(stl->pd->global_light_pool, world_light);
-- }
--
-- float viewmatinv[4][4];
-- DRW_view_viewmat_get(NULL, viewmatinv, true);
-- copy_v3_v3(stl->pd->camera_z_axis, viewmatinv[2]);
-- copy_v3_v3(stl->pd->camera_pos, viewmatinv[3]);
-- stl->pd->camera_z_offset = dot_v3v3(viewmatinv[3], viewmatinv[2]);
--
-- if (ctx && ctx->rv3d && v3d) {
-- stl->pd->camera = (ctx->rv3d->persp == RV3D_CAMOB) ? v3d->camera : NULL;
-- }
-- else {
-- stl->pd->camera = NULL;
-- }
++ GPENCIL_Data* vedata = (GPENCIL_Data*)ved;
++ GPENCIL_StorageList* stl = vedata->stl;
++ GPENCIL_TextureList* txl = vedata->txl;
++ GPENCIL_FramebufferList* fbl = vedata->fbl;
++ DefaultTextureList* dtxl = DRW_viewport_texture_list_get();
++ DefaultFramebufferList* dfbl = DRW_viewport_framebuffer_list_get();
++ const DRWContextState* ctx = DRW_context_state_get();
++ const View3D* v3d = ctx->v3d;
++
++ if (!stl->pd) {
++ stl->pd = MEM_callocN(sizeof(GPENCIL_PrivateData), "GPENCIL_PrivateData");
++ }
++
++ if (txl->dummy_texture == NULL) {
++ const float pixels[1][4] = { {1.0f, 0.0f, 1.0f, 1.0f} };
++ txl->dummy_texture = DRW_texture_create_2d(1, 1, GPU_RGBA8, DRW_TEX_WRAP, (float*)pixels);
++ }
++
++ GPENCIL_ViewLayerData* vldata = GPENCIL_view_layer_data_ensure();
++
++ /* Resize and reset memblocks. */
++ BLI_memblock_clear(vldata->gp_light_pool, gpencil_light_pool_free);
++ BLI_memblock_clear(vldata->gp_material_pool, gpencil_material_pool_free);
++ BLI_memblock_clear(vldata->gp_object_pool, NULL);
++ BLI_memblock_clear(vldata->gp_layer_pool, NULL);
++ BLI_memblock_clear(vldata->gp_vfx_pool, NULL);
++ BLI_memblock_clear(vldata->gp_maskbit_pool, NULL);
++
++ stl->pd->gp_light_pool = vldata->gp_light_pool;
++ stl->pd->gp_material_pool = vldata->gp_material_pool;
++ stl->pd->gp_maskbit_pool = vldata->gp_maskbit_pool;
++ stl->pd->gp_object_pool = vldata->gp_object_pool;
++ stl->pd->gp_layer_pool = vldata->gp_layer_pool;
++ stl->pd->gp_vfx_pool = vldata->gp_vfx_pool;
++ stl->pd->view_layer = ctx->view_layer;
++ stl->pd->scene = ctx->scene;
++ stl->pd->v3d = ctx->v3d;
++ stl->pd->last_light_pool = NULL;
++ stl->pd->last_material_pool = NULL;
++ stl->pd->tobjects.first = NULL;
++ stl->pd->tobjects.last = NULL;
++ stl->pd->tobjects_infront.first = NULL;
++ stl->pd->tobjects_infront.last = NULL;
++ stl->pd->sbuffer_tobjects.first = NULL;
++ stl->pd->sbuffer_tobjects.last = NULL;
++ stl->pd->dummy_tx = txl->dummy_texture;
++ stl->pd->draw_depth_only = !DRW_state_is_fbo();
++ stl->pd->draw_wireframe = (v3d && v3d->shading.type == OB_WIRE) && !stl->pd->draw_depth_only;
++ stl->pd->scene_depth_tx = stl->pd->draw_depth_only ? txl->dummy_texture : dtxl->depth;
++ stl->pd->scene_fb = dfbl->default_fb;
++ stl->pd->is_render = txl->render_depth_tx || (v3d && v3d->shading.type == OB_RENDER);
++ stl->pd->is_viewport = (v3d != NULL);
++ stl->pd->global_light_pool = gpencil_light_pool_add(stl->pd);
++ stl->pd->shadeless_light_pool = gpencil_light_pool_add(stl->pd);
++ /* Small HACK: we don't want the global pool to be reused,
++ * so we set the last light pool to NULL. */
++ stl->pd->last_light_pool = NULL;
++
++ bool use_scene_lights = false;
++ bool use_scene_world = false;
++
++ if (v3d) {
++ use_scene_lights = ((v3d->shading.type == OB_MATERIAL) &&
++ (v3d->shading.flag & V3D_SHADING_SCENE_LIGHTS)) ||
++ ((v3d->shading.type == OB_RENDER) &&
++ (v3d->shading.flag & V3D_SHADING_SCENE_LIGHTS_RENDER));
++
++ use_scene_world = ((v3d->shading.type == OB_MATERIAL) &&
++ (v3d->shading.flag & V3D_SHADING_SCENE_WORLD)) ||
++ ((v3d->shading.type == OB_RENDER) &&
++ (v3d->shading.flag & V3D_SHADING_SCENE_WORLD_RENDER));
++
++ stl->pd->v3d_color_type = (v3d->shading.type == OB_SOLID) ? v3d->shading.color_type : -1;
++ /* Special case: If Vertex Paint mode, use always Vertex mode. */
++ if (v3d->shading.type == OB_SOLID && ctx->obact && ctx->obact->type == OB_GPENCIL &&
++ ctx->obact->mode == OB_MODE_VERTEX_GPENCIL) {
++ stl->pd->v3d_color_type = V3D_SHADING_VERTEX_COLOR;
++ }
++
++ copy_v3_v3(stl->pd->v3d_single_color, v3d->shading.single_color);
++
++ /* For non active frame, use only lines in multiedit mode. */
++ const bool overlays_on = (v3d->flag2 & V3D_HIDE_OVERLAYS) == 0;
++ stl->pd->use_multiedit_lines_only = !overlays_on ||
++ (v3d->gp_flag & V3D_GP_SHOW_MULTIEDIT_LINES) != 0;
++
++ const bool shmode_xray_suppor
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list