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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2013-12-31 20:33:55 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2013-12-31 20:38:26 +0400
commit9cd2b199994ba48f343a89a270827b2e0ed3221d (patch)
treea90b3f0b2a5a8869b0fb8552a8d660d3d91209c1 /intern/cycles/kernel/osl/osl_shader.cpp
parent6b03f92aa7bdb10cfde99bc30a7337c843bda57c (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/kernel/osl/osl_shader.cpp')
-rw-r--r--intern/cycles/kernel/osl/osl_shader.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/intern/cycles/kernel/osl/osl_shader.cpp b/intern/cycles/kernel/osl/osl_shader.cpp
index 6062996af36..554f647df7c 100644
--- a/intern/cycles/kernel/osl/osl_shader.cpp
+++ b/intern/cycles/kernel/osl/osl_shader.cpp
@@ -545,6 +545,10 @@ int OSLShader::find_attribute(KernelGlobals *kg, const ShaderData *sd, uint id,
if (it != attr_map.end()) {
const OSLGlobals::Attribute &osl_attr = it->second;
*elem = osl_attr.elem;
+
+ if(sd->prim == ~0 && (AttributeElement)osl_attr.elem != ATTR_ELEMENT_MESH)
+ return ATTR_STD_NOT_FOUND;
+
/* return result */
return (osl_attr.elem == ATTR_ELEMENT_NONE) ? (int)ATTR_STD_NOT_FOUND : osl_attr.offset;
}