Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-11-02 22:55:32 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-11-02 22:55:32 +0400
commit30f1f28a8af3b393608b5869512a8823111294ad (patch)
tree035cee751100c31e25b55087efa476145b29af64 /source/blender/nodes
parent97a0ae3e1b7eea3c069da8c6d3c7a3535734059d (diff)
Nodes: add support for shader nodes on world and lamps, in addition to materials.
The internal render engine does not support them, and they are not accesible in the UI yet, but cycles will use them.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/shader/node_shader_tree.c19
-rw-r--r--source/blender/nodes/shader/node_shader_util.c2
2 files changed, 17 insertions, 4 deletions
diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c
index a83b32097df..d0ae17914ca 100644
--- a/source/blender/nodes/shader/node_shader_tree.c
+++ b/source/blender/nodes/shader/node_shader_tree.c
@@ -32,8 +32,10 @@
#include <string.h>
+#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
#include "DNA_node_types.h"
+#include "DNA_world_types.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
@@ -56,11 +58,20 @@
static void foreach_nodetree(Main *main, void *calldata, bNodeTreeCallback func)
{
Material *ma;
- for(ma= main->mat.first; ma; ma= ma->id.next) {
- if(ma->nodetree) {
+ Lamp *la;
+ World *wo;
+
+ for(ma= main->mat.first; ma; ma= ma->id.next)
+ if(ma->nodetree)
func(calldata, &ma->id, ma->nodetree);
- }
- }
+
+ for(la= main->lamp.first; la; la= la->id.next)
+ if(la->nodetree)
+ func(calldata, &la->id, la->nodetree);
+
+ for(wo= main->world.first; wo; wo= wo->id.next)
+ if(wo->nodetree)
+ func(calldata, &wo->id, wo->nodetree);
}
static void local_sync(bNodeTree *localtree, bNodeTree *ntree)
diff --git a/source/blender/nodes/shader/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c
index 3b0211a53ee..1acb04c9b41 100644
--- a/source/blender/nodes/shader/node_shader_util.c
+++ b/source/blender/nodes/shader/node_shader_util.c
@@ -205,6 +205,8 @@ void node_gpu_stack_from_data(struct GPUNodeStack *gs, int type, bNodeStack *ns)
gs->type= GPU_VEC3;
else if (type == SOCK_RGBA)
gs->type= GPU_VEC4;
+ else if (type == SOCK_SHADER)
+ gs->type= GPU_VEC4;
else
gs->type= GPU_NONE;