diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2013-12-31 20:33:55 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2013-12-31 20:38:26 +0400 |
commit | 9cd2b199994ba48f343a89a270827b2e0ed3221d (patch) | |
tree | a90b3f0b2a5a8869b0fb8552a8d660d3d91209c1 /intern/cycles/render/graph.cpp | |
parent | 6b03f92aa7bdb10cfde99bc30a7337c843bda57c (diff) |
Cycles Volume Render: generated texture coordinates for volume render.
This does not support staying fixed while the surface deforms, but for static
meshes it should match up with the surface texture coordinates. Implemented
as a matrix transform from objects space to mesh texture space.
Making this work for deforming surfaces would be quite complicated, you might
need something like harmonic coordinates as used in the mesh deform modifier,
probably will not be possible anytime soon.
Diffstat (limited to 'intern/cycles/render/graph.cpp')
-rw-r--r-- | intern/cycles/render/graph.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp index af57470aa89..4256c5ed95b 100644 --- a/intern/cycles/render/graph.cpp +++ b/intern/cycles/render/graph.cpp @@ -120,8 +120,10 @@ void ShaderNode::attributes(Shader *shader, AttributeRequestSet *attributes) { foreach(ShaderInput *input, inputs) { if(!input->link) { - if(input->default_value == ShaderInput::TEXTURE_GENERATED) + if(input->default_value == ShaderInput::TEXTURE_GENERATED) { attributes->add(ATTR_STD_GENERATED); + attributes->add(ATTR_STD_GENERATED_TRANSFORM); // XXX only for volumes! + } else if(input->default_value == ShaderInput::TEXTURE_UV) attributes->add(ATTR_STD_UV); } |