2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2007-03-24 06:57:29 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
*
|
|
|
|
* 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,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2007-03-24 06:57:29 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2005 Blender Foundation.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
*
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
2011-09-05 21:01:50 +00:00
|
|
|
/** \file blender/nodes/shader/node_shader_util.h
|
2011-02-27 20:13:22 +00:00
|
|
|
* \ingroup nodes
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __NODE_SHADER_UTIL_H__
|
|
|
|
#define __NODE_SHADER_UTIL_H__
|
2007-03-24 06:57:29 +00:00
|
|
|
|
2007-03-24 18:41:54 +00:00
|
|
|
#include <math.h>
|
2008-01-01 18:16:10 +00:00
|
|
|
#include <float.h>
|
2007-03-24 18:41:54 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2007-03-24 06:57:29 +00:00
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
|
|
|
|
#include "DNA_color_types.h"
|
2011-11-08 11:38:16 +00:00
|
|
|
#include "DNA_customdata_types.h"
|
2007-03-24 06:57:29 +00:00
|
|
|
#include "DNA_ID.h"
|
|
|
|
#include "DNA_image_types.h"
|
|
|
|
#include "DNA_material_types.h"
|
|
|
|
#include "DNA_node_types.h"
|
|
|
|
#include "DNA_object_types.h"
|
|
|
|
#include "DNA_scene_types.h"
|
|
|
|
#include "DNA_texture_types.h"
|
|
|
|
|
2013-01-24 21:57:13 +00:00
|
|
|
#include "BLI_math.h"
|
|
|
|
#include "BLI_blenlib.h"
|
|
|
|
#include "BLI_rand.h"
|
|
|
|
#include "BLI_threads.h"
|
|
|
|
#include "BLI_utildefines.h"
|
|
|
|
|
2017-12-07 15:36:26 +11:00
|
|
|
#include "BKE_colorband.h"
|
2007-03-24 06:57:29 +00:00
|
|
|
#include "BKE_colortools.h"
|
|
|
|
#include "BKE_global.h"
|
|
|
|
#include "BKE_image.h"
|
|
|
|
#include "BKE_main.h"
|
|
|
|
#include "BKE_material.h"
|
2011-02-07 09:33:36 +00:00
|
|
|
#include "BKE_node.h"
|
2007-03-24 06:57:29 +00:00
|
|
|
#include "BKE_texture.h"
|
2011-01-07 19:18:31 +00:00
|
|
|
|
2007-03-24 18:41:54 +00:00
|
|
|
#include "BKE_library.h"
|
2007-03-24 06:57:29 +00:00
|
|
|
|
2011-09-05 21:01:50 +00:00
|
|
|
#include "NOD_shader.h"
|
2007-04-04 13:58:12 +00:00
|
|
|
#include "node_util.h"
|
2007-03-24 06:57:29 +00:00
|
|
|
|
2015-08-16 17:32:01 +10:00
|
|
|
#include "BLT_translation.h"
|
2012-06-02 19:58:12 +00:00
|
|
|
|
2007-03-24 06:57:29 +00:00
|
|
|
#include "IMB_imbuf_types.h"
|
|
|
|
#include "IMB_imbuf.h"
|
|
|
|
|
|
|
|
#include "RE_pipeline.h"
|
|
|
|
#include "RE_shader_ext.h"
|
|
|
|
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
#include "GPU_material.h"
|
|
|
|
|
2013-03-18 16:34:57 +00:00
|
|
|
|
|
|
|
int sh_node_poll_default(struct bNodeType *ntype, struct bNodeTree *ntree);
|
|
|
|
void sh_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass, short flag);
|
|
|
|
|
|
|
|
|
2007-03-24 06:57:29 +00:00
|
|
|
/* ********* exec data struct, remains internal *********** */
|
|
|
|
|
|
|
|
typedef struct ShaderCallData {
|
|
|
|
ShadeInput *shi; /* from render pipe */
|
|
|
|
ShadeResult *shr; /* from render pipe */
|
|
|
|
} ShaderCallData;
|
|
|
|
|
|
|
|
|
2007-03-24 18:41:54 +00:00
|
|
|
void nodestack_get_vec(float *in, short type_in, bNodeStack *ns);
|
2007-03-24 06:57:29 +00:00
|
|
|
|
2011-09-05 21:01:50 +00:00
|
|
|
void node_gpu_stack_from_data(struct GPUNodeStack *gs, int type, struct bNodeStack *ns);
|
|
|
|
void node_data_from_gpu_stack(struct bNodeStack *ns, struct GPUNodeStack *gs);
|
2011-11-08 11:38:16 +00:00
|
|
|
void node_shader_gpu_tex_mapping(struct GPUMaterial *mat, struct bNode *node, struct GPUNodeStack *in, struct GPUNodeStack *out);
|
2011-09-05 21:01:50 +00:00
|
|
|
|
2014-02-14 15:11:19 +01:00
|
|
|
void ntreeExecGPUNodes(struct bNodeTreeExec *exec, struct GPUMaterial *mat, int do_outputs, short compatibility);
|
2011-09-05 21:01:50 +00:00
|
|
|
|
2007-03-24 18:41:54 +00:00
|
|
|
#endif
|