diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-21 16:52:28 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-21 16:52:28 +0400 |
commit | c3e1fce77552b5626d2939710cb6d0020891d218 (patch) | |
tree | 5d59df38ec009f21000a959531129aa511868773 /source/blender/gpu/shaders/gpu_shader_material.glsl | |
parent | ea11bc980ad428950efb430618a6de439ffd5951 (diff) |
Cycles: add Object Info node, with outputs object location, object/material
pass index, and a random number unique to the instance of the object.
This can be useful to give some variation to a single material assigned to
multiple instances, either manually controlled through the object index, based
on the object location, or randomized for each instance.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Object_Info
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_material.glsl')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_material.glsl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index 7e4312e21e0..65c0bcb3c63 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -2206,6 +2206,15 @@ void node_light_falloff(float strength, float tsmooth, out float quadratic, out constant = strength; } +void node_object_info(out vec3 location, out float object_index, out float material_index, out float random) +{ + location = vec3(0.0); + object_index = 0.0; + material_index = 0.0; + random = 0.0; +} + + /* output */ void node_output_material(vec4 surface, vec4 volume, float displacement, out vec4 result) |