2018-04-13 15:49:50 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright 2016, Blender Foundation.
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s): Blender Institute
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/** \file workbench_private.h
|
|
|
|
|
* \ingroup draw_engine
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __WORKBENCH_PRIVATE_H__
|
|
|
|
|
#define __WORKBENCH_PRIVATE_H__
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "DRW_render.h"
|
2018-04-19 09:45:52 +02:00
|
|
|
#include "DNA_view3d_types.h"
|
2018-04-13 15:49:50 +02:00
|
|
|
|
2018-04-17 16:34:41 +02:00
|
|
|
#define WORKBENCH_ENGINE "BLENDER_WORKBENCH"
|
|
|
|
|
|
2018-04-13 15:49:50 +02:00
|
|
|
|
|
|
|
|
typedef struct WORKBENCH_StorageList {
|
|
|
|
|
struct WORKBENCH_PrivateData *g_data;
|
|
|
|
|
} WORKBENCH_StorageList;
|
|
|
|
|
|
|
|
|
|
typedef struct WORKBENCH_PassList {
|
|
|
|
|
struct DRWPass *depth_pass;
|
2018-04-17 16:34:41 +02:00
|
|
|
struct DRWPass *solid_pass;
|
2018-04-13 15:49:50 +02:00
|
|
|
} WORKBENCH_PassList;
|
|
|
|
|
|
|
|
|
|
typedef struct WORKBENCH_Data {
|
|
|
|
|
void *engine_type;
|
2018-04-18 12:11:36 +02:00
|
|
|
DRWViewportEmptyList *fbl;
|
|
|
|
|
DRWViewportEmptyList *txl;
|
2018-04-13 15:49:50 +02:00
|
|
|
WORKBENCH_PassList *psl;
|
|
|
|
|
WORKBENCH_StorageList *stl;
|
|
|
|
|
} WORKBENCH_Data;
|
|
|
|
|
|
|
|
|
|
typedef struct WORKBENCH_PrivateData {
|
|
|
|
|
DRWShadingGroup *depth_shgrp;
|
|
|
|
|
|
|
|
|
|
DRWShadingGroup *shadeless_shgrp;
|
2018-04-17 16:34:41 +02:00
|
|
|
|
2018-04-18 13:44:33 +02:00
|
|
|
struct GHash *material_hash;
|
2018-04-13 15:49:50 +02:00
|
|
|
} WORKBENCH_PrivateData; /* Transient data */
|
|
|
|
|
|
2018-04-18 13:44:33 +02:00
|
|
|
typedef struct WORKBENCH_MaterialData {
|
2018-04-18 14:56:25 +02:00
|
|
|
/* Solid color */
|
2018-04-18 13:44:33 +02:00
|
|
|
float color[3];
|
|
|
|
|
|
2018-04-18 14:56:25 +02:00
|
|
|
/* Linked shgroup for drawing */
|
2018-04-19 07:47:03 +02:00
|
|
|
DRWShadingGroup *shgrp;
|
2018-04-18 13:44:33 +02:00
|
|
|
} WORKBENCH_MaterialData;
|
2018-04-13 15:49:50 +02:00
|
|
|
|
2018-04-18 13:44:33 +02:00
|
|
|
|
|
|
|
|
/* workbench_engine.c */
|
2018-04-17 16:34:41 +02:00
|
|
|
void workbench_solid_materials_init(void);
|
2018-04-19 07:47:03 +02:00
|
|
|
void workbench_solid_materials_cache_init(WORKBENCH_Data *vedata);
|
|
|
|
|
void workbench_solid_materials_cache_populate(WORKBENCH_Data *vedata, Object *ob);
|
|
|
|
|
void workbench_solid_materials_cache_finish(WORKBENCH_Data *vedata);
|
|
|
|
|
void workbench_solid_materials_draw_scene(WORKBENCH_Data *vedata);
|
2018-04-17 16:34:41 +02:00
|
|
|
void workbench_solid_materials_free(void);
|
2018-04-13 15:49:50 +02:00
|
|
|
|
2018-04-18 13:44:33 +02:00
|
|
|
/* workbench_materials.c */
|
|
|
|
|
void workbench_materials_engine_init(void);
|
2018-04-19 10:41:24 +02:00
|
|
|
void workbench_materials_engine_free(void);
|
|
|
|
|
void workbench_materials_draw_scene_finish(WORKBENCH_Data *vedata);
|
2018-04-18 13:44:33 +02:00
|
|
|
void workbench_materials_cache_init(WORKBENCH_Data *vedata);
|
2018-04-19 09:45:52 +02:00
|
|
|
void workbench_materials_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob, int lighting_mode);
|
2018-04-13 15:49:50 +02:00
|
|
|
|
|
|
|
|
#endif
|