From 9cd2b199994ba48f343a89a270827b2e0ed3221d Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 31 Dec 2013 17:33:55 +0100 Subject: 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. --- intern/cycles/render/graph.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'intern/cycles/render/graph.cpp') 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); } -- cgit v1.2.3