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
|
2018-06-01 18:19:39 +02:00
|
|
|
* of the License, or (at your option) any later version.
|
2007-03-24 06:57:29 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
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"
|
2017-07-14 17:40:54 +02:00
|
|
|
#include "GPU_uniformbuffer.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
|
|
|
|
2013-03-18 16:34:57 +00:00
|
|
|
|
2018-07-02 11:47:00 +02:00
|
|
|
bool sh_node_poll_default(struct bNodeType *ntype, struct bNodeTree *ntree);
|
2013-03-18 16:34:57 +00:00
|
|
|
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 {
|
Remove Blender Internal and legacy viewport from Blender 2.8.
Brecht authored this commit, but he gave me the honours to actually
do it. Here it goes; Blender Internal. Bye bye, you did great!
* Point density, voxel data, ocean, environment map textures were removed,
as these only worked within BI rendering. Note that the ocean modifier
and the Cycles point density shader node continue to work.
* Dynamic paint using material shading was removed, as this only worked
with BI. If we ever wanted to support this again probably it should go
through the baking API.
* GPU shader export through the Python API was removed. This only worked
for the old BI GLSL shaders, which no longer exists. Doing something
similar for Eevee would be significantly more complicated because it
uses a lot of multiplass rendering and logic outside the shader, it's
probably impractical.
* Collada material import / export code is mostly gone, as it only worked
for BI materials. We need to add Cycles / Eevee material support at some
point.
* The mesh noise operator was removed since it only worked with BI
material texture slots. A displacement modifier can be used instead.
* The delete texture paint slot operator was removed since it only worked
for BI material texture slots. Could be added back with node support.
* Not all legacy viewport features are supported in the new viewport, but
their code was removed. If we need to bring anything back we can look at
older git revisions.
* There is some legacy viewport code that I could not remove yet, and some
that I probably missed.
* Shader node execution code was left mostly intact, even though it is not
used anywhere now. We may eventually use this to replace the texture
nodes with Cycles / Eevee shader nodes.
* The Cycles Bake panel now includes settings for baking multires normal
and displacement maps. The underlying code needs to be merged properly,
and we plan to add back support for multires AO baking and add support
to Cycles baking for features like vertex color, displacement, and other
missing baking features.
* This commit removes DNA and the Python API for BI material, lamp, world
and scene settings. This breaks a lot of addons.
* There is more DNA that can be removed or renamed, where Cycles or Eevee
are reusing some old BI properties but the names are not really correct
anymore.
* Texture slots for materials, lamps and world were removed. They remain
for brushes, particles and freestyle linestyles.
* 'BLENDER_RENDER' remains in the COMPAT_ENGINES of UI panels. Cycles and
other renderers use this to find all panels to show, minus a few panels
that they have their own replacement for.
2018-04-19 17:34:44 +02:00
|
|
|
/* Empty for now, may be reused if we convert shader to texture nodes. */
|
2018-04-19 19:03:54 +02:00
|
|
|
int dummy;
|
2007-03-24 06:57:29 +00:00
|
|
|
} 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
|
|
|
|
2018-07-05 17:20:44 +02:00
|
|
|
void ntreeExecGPUNodes(struct bNodeTreeExec *exec, struct GPUMaterial *mat, int do_outputs);
|
2011-09-05 21:01:50 +00:00
|
|
|
|
2007-03-24 18:41:54 +00:00
|
|
|
#endif
|