Blender  V2.59
SHD_util.h
Go to the documentation of this file.
00001 /*
00002  * $Id: SHD_util.h 37054 2011-05-31 17:54:48Z lukastoenne $
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version. 
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * The Original Code is Copyright (C) 2005 Blender Foundation.
00021  * All rights reserved.
00022  *
00023  * The Original Code is: all of this file.
00024  *
00025  * Contributor(s): none yet.
00026  *
00027  * ***** END GPL LICENSE BLOCK *****
00028  */
00029 
00035 #ifndef SHD_NODE_UTIL_H_
00036 #define SHD_NODE_UTIL_H_
00037 
00038 #include <math.h>
00039 #include <float.h>
00040 #include <string.h>
00041 
00042 #include "MEM_guardedalloc.h"
00043 
00044 #include "DNA_color_types.h"
00045 #include "DNA_ID.h"
00046 #include "DNA_image_types.h"
00047 #include "DNA_material_types.h"
00048 #include "DNA_node_types.h"
00049 #include "DNA_object_types.h"
00050 #include "DNA_scene_types.h"
00051 #include "DNA_texture_types.h"
00052 
00053 #include "BKE_blender.h"
00054 #include "BKE_colortools.h"
00055 #include "BKE_global.h"
00056 #include "BKE_image.h"
00057 #include "BKE_main.h"
00058 #include "BKE_material.h"
00059 #include "BKE_node.h"
00060 #include "BKE_texture.h"
00061 
00062 #include "BKE_library.h"
00063 
00064 #include "../SHD_node.h"
00065 #include "node_util.h"
00066 
00067 #include "BLI_math.h"
00068 #include "BLI_blenlib.h"
00069 #include "BLI_rand.h"
00070 #include "BLI_threads.h"
00071 #include "BLI_utildefines.h"
00072 
00073 #include "IMB_imbuf_types.h"
00074 #include "IMB_imbuf.h"
00075 
00076 #include "RE_pipeline.h"
00077 #include "RE_shader_ext.h"
00078 
00079 #include "GPU_material.h"
00080 
00081 /* ********* exec data struct, remains internal *********** */
00082 
00083 typedef struct ShaderCallData {
00084         ShadeInput *shi;                /* from render pipe */
00085         ShadeResult *shr;               /* from render pipe */
00086 } ShaderCallData;
00087 
00088 /* output socket defines */
00089 #define GEOM_OUT_GLOB   0
00090 #define GEOM_OUT_LOCAL  1
00091 #define GEOM_OUT_VIEW   2
00092 #define GEOM_OUT_ORCO   3
00093 #define GEOM_OUT_UV             4
00094 #define GEOM_OUT_NORMAL 5
00095 #define GEOM_OUT_VCOL   6
00096 #define GEOM_OUT_FRONTBACK      7
00097 
00098 
00099 /* input socket defines */
00100 #define MAT_IN_COLOR    0
00101 #define MAT_IN_SPEC             1
00102 #define MAT_IN_REFL             2
00103 #define MAT_IN_NORMAL   3
00104 #define MAT_IN_MIR              4
00105 #define MAT_IN_AMB              5
00106 #define MAT_IN_EMIT     6
00107 #define MAT_IN_SPECTRA  7
00108 #define MAT_IN_RAY_MIRROR       8
00109 #define MAT_IN_ALPHA    9
00110 #define MAT_IN_TRANSLUCENCY     10
00111 #define NUM_MAT_IN              11      /* for array size */
00112 
00113 /* output socket defines */
00114 #define MAT_OUT_COLOR           0
00115 #define MAT_OUT_ALPHA           1
00116 #define MAT_OUT_NORMAL  2
00117 #define MAT_OUT_DIFFUSE 3
00118 #define MAT_OUT_SPEC            4
00119 #define MAT_OUT_AO              5
00120 
00121 
00122 extern void node_ID_title_cb(void *node_v, void *unused_v);
00123 void nodestack_get_vec(float *in, short type_in, bNodeStack *ns);
00124 
00125 #endif