Blender Internal: Add "Lamp Data" shader node that allows shaders to acquire informat...
authorIRIE Shinsuke <irieshinsuke@yahoo.co.jp>
Mon, 25 Nov 2013 11:58:23 +0000 (20:58 +0900)
committerIRIE Shinsuke <irieshinsuke@yahoo.co.jp>
Mon, 25 Nov 2013 13:19:47 +0000 (22:19 +0900)
commitab9822eff8865846d3c7ef81ff30cc35cb48ae0c
tree0955c1502f6f0327f59a3dd430c251378ba64c7c
parent33bc6a3959b4f59f6ded304b5db06733653051cd
Blender Internal: Add "Lamp Data" shader node that allows shaders to acquire information such as light vector from specified Lamp.

For now this provides the following outputs:

- Color
- Light Vector
- Distance
- Shadow
- Visibility Factor

Note: Color output is multiplied by the lamp energy.  Multiplication of
color*max(dot(light_vector,normal_vector),0)*shadow*visibility_factor
produces the exact same result as the Lambert shader.

Many thanks to Brecht for code review and discussion!
18 files changed:
release/scripts/startup/nodeitems_builtins.py
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/intern/node.c
source/blender/editors/space_node/drawnode.c
source/blender/gpu/GPU_material.h
source/blender/gpu/intern/gpu_material.c
source/blender/gpu/shaders/gpu_shader_material.glsl
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_object.c
source/blender/nodes/CMakeLists.txt
source/blender/nodes/NOD_shader.h
source/blender/nodes/NOD_static_types.h
source/blender/nodes/shader/nodes/node_shader_lamp.c [new file with mode: 0644]
source/blender/render/extern/include/RE_shader_ext.h
source/blender/render/intern/source/shadeoutput.c
source/blenderplayer/bad_level_call_stubs/stubs.c