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>2014-04-04 00:04:39 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2014-04-04 00:13:05 +0400
commitbd03e4cfe8f1d8e4d706e126f59e6b8ddf3688c5 (patch)
tree20c6ec373567a0c98497e486f1a8f87b2b06cf75 /intern/cycles/render/nodes.h
parentab32a1807dd153723d26a7d53895ed071233dafc (diff)
Cycles volume: detect homogeneous volume automatically in common cases.
In practice this means that if you don't connect a texture to your volume nodes it will figure that out and render the node faster, rather than you having to specify it manually. Main weakness is custom OSL nodes where we have to assume it is heterogeneous because we don't know what kind of data the node accesses.
Diffstat (limited to 'intern/cycles/render/nodes.h')
-rw-r--r--intern/cycles/render/nodes.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h
index 31caf9507eb..054ae0f613c 100644
--- a/intern/cycles/render/nodes.h
+++ b/intern/cycles/render/nodes.h
@@ -209,6 +209,7 @@ public:
BsdfNode(bool scattering = false);
SHADER_NODE_BASE_CLASS(BsdfNode);
+ bool has_spatial_varying() { return true; }
void compile(SVMCompiler& compiler, ShaderInput *param1, ShaderInput *param2, ShaderInput *param3 = NULL, ShaderInput *param4 = NULL);
ClosureType closure;
@@ -280,6 +281,7 @@ public:
SHADER_NODE_CLASS(SubsurfaceScatteringNode)
bool has_surface_bssrdf() { return true; }
bool has_bssrdf_bump();
+ bool has_spatial_varying() { return true; }
static ShaderEnum falloff_enum;
};
@@ -289,6 +291,7 @@ public:
SHADER_NODE_CLASS(EmissionNode)
bool has_surface_emission() { return true; }
+ bool has_spatial_varying() { return true; }
bool total_power;
};
@@ -306,6 +309,8 @@ public:
class AmbientOcclusionNode : public ShaderNode {
public:
SHADER_NODE_CLASS(AmbientOcclusionNode)
+
+ bool has_spatial_varying() { return true; }
};
class VolumeNode : public ShaderNode {
@@ -340,12 +345,14 @@ class GeometryNode : public ShaderNode {
public:
SHADER_NODE_CLASS(GeometryNode)
void attributes(Shader *shader, AttributeRequestSet *attributes);
+ bool has_spatial_varying() { return true; }
};
class TextureCoordinateNode : public ShaderNode {
public:
SHADER_NODE_CLASS(TextureCoordinateNode)
void attributes(Shader *shader, AttributeRequestSet *attributes);
+ bool has_spatial_varying() { return true; }
bool from_dupli;
};
@@ -354,6 +361,7 @@ class UVMapNode : public ShaderNode {
public:
SHADER_NODE_CLASS(UVMapNode)
void attributes(Shader *shader, AttributeRequestSet *attributes);
+ bool has_spatial_varying() { return true; }
ustring attribute;
bool from_dupli;
@@ -367,6 +375,7 @@ public:
class LightFalloffNode : public ShaderNode {
public:
SHADER_NODE_CLASS(LightFalloffNode)
+ bool has_spatial_varying() { return true; }
};
class ObjectInfoNode : public ShaderNode {
@@ -385,6 +394,7 @@ public:
SHADER_NODE_CLASS(HairInfoNode)
void attributes(Shader *shader, AttributeRequestSet *attributes);
+ bool has_spatial_varying() { return true; }
};
class ValueNode : public ShaderNode {
@@ -470,6 +480,7 @@ class AttributeNode : public ShaderNode {
public:
SHADER_NODE_CLASS(AttributeNode)
void attributes(Shader *shader, AttributeRequestSet *attributes);
+ bool has_spatial_varying() { return true; }
ustring attribute;
};
@@ -477,21 +488,25 @@ public:
class CameraNode : public ShaderNode {
public:
SHADER_NODE_CLASS(CameraNode)
+ bool has_spatial_varying() { return true; }
};
class FresnelNode : public ShaderNode {
public:
SHADER_NODE_CLASS(FresnelNode)
+ bool has_spatial_varying() { return true; }
};
class LayerWeightNode : public ShaderNode {
public:
SHADER_NODE_CLASS(LayerWeightNode)
+ bool has_spatial_varying() { return true; }
};
class WireframeNode : public ShaderNode {
public:
SHADER_NODE_CLASS(WireframeNode)
+ bool has_spatial_varying() { return true; }
bool use_pixel_size;
};
@@ -548,6 +563,8 @@ public:
class BumpNode : public ShaderNode {
public:
SHADER_NODE_CLASS(BumpNode)
+ bool has_spatial_varying() { return true; }
+
bool invert;
};
@@ -578,6 +595,10 @@ public:
class OSLScriptNode : public ShaderNode {
public:
SHADER_NODE_CLASS(OSLScriptNode)
+
+ /* ideally we could beter detect this, but we can't query this now */
+ bool has_spatial_varying() { return true; }
+
string filepath;
string bytecode_hash;
@@ -591,6 +612,7 @@ class NormalMapNode : public ShaderNode {
public:
SHADER_NODE_CLASS(NormalMapNode)
void attributes(Shader *shader, AttributeRequestSet *attributes);
+ bool has_spatial_varying() { return true; }
ustring space;
static ShaderEnum space_enum;
@@ -602,6 +624,7 @@ class TangentNode : public ShaderNode {
public:
SHADER_NODE_CLASS(TangentNode)
void attributes(Shader *shader, AttributeRequestSet *attributes);
+ bool has_spatial_varying() { return true; }
ustring direction_type;
static ShaderEnum direction_type_enum;