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:
authorAntony Riakiotakis <kalast@gmail.com>2014-11-24 19:18:56 +0300
committerAntony Riakiotakis <kalast@gmail.com>2014-11-26 17:07:26 +0300
commit8fa55d95e43392a0e7925e1327e86220a33b4394 (patch)
treeb68b040a975e6231c8ec40d89cebad93582c52af /source/blender/nodes/shader/nodes/node_shader_output_world.c
parent8bc84e10f501e516e0839b6a3efa573d55fb4f7b (diff)
World background working on cycle nodes.
This is added in the spirit of the general cycles GLSL system which is pretty much WIP still. This will only work on cycles at the moment but generating for blender internal is possible too of course though it will be done in a separate commit. This hasn't been tested with all and every node in cycles, but environment and regular textures with texture coordinates work. There is some difference between the way cycles treats some coordinates, which is in world space and the way GLSL treats them, which is in view space. We might want to explore and improve this further in the future. ...also </drumroll>
Diffstat (limited to 'source/blender/nodes/shader/nodes/node_shader_output_world.c')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_output_world.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_output_world.c b/source/blender/nodes/shader/nodes/node_shader_output_world.c
index c8e47c47c5f..ad7389fd56e 100644
--- a/source/blender/nodes/shader/nodes/node_shader_output_world.c
+++ b/source/blender/nodes/shader/nodes/node_shader_output_world.c
@@ -35,6 +35,16 @@ static bNodeSocketTemplate sh_node_output_world_in[] = {
{ -1, 0, "" }
};
+static int node_shader_gpu_output_world(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
+{
+ GPUNodeLink *outlink;
+
+ GPU_stack_link(mat, "node_output_world", in, out, &outlink);
+ GPU_material_output_link(mat, outlink);
+
+ return 1;
+}
+
/* node type definition */
void register_node_type_sh_output_world(void)
{
@@ -45,7 +55,8 @@ void register_node_type_sh_output_world(void)
node_type_socket_templates(&ntype, sh_node_output_world_in, NULL);
node_type_init(&ntype, NULL);
node_type_storage(&ntype, "", NULL, NULL);
-
+ node_type_gpu(&ntype, node_shader_gpu_output_world);
+
/* Do not allow muting output node. */
node_type_internal_links(&ntype, NULL);