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:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-02-06 10:35:46 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-02-10 18:33:41 +0300
commit227a94077f508a47fe7595b9091ab86aecde4ad5 (patch)
tree6101fc2c6d11f2e732f866b515782df1f8da4e92 /intern/cycles/kernel/shaders
parent1ebf95bfd7502c27f33a9325f88118bde4239607 (diff)
Cycles: implement pointiness geometry attribute
This attribute means how "pointy" the geometry surface is, which allows to do effects like dirt maps and wear-off effects on render geometry. This means the attribute is calculated for the final mesh which means no baking (which implies UV unwrap) is needed. Apart from this the behavior is quite close to how vertex dirty colors works. The new attribute is available as an output socket of Geometry node. There's no penalty for the render time, only some delay on scene preparation (the delay is linear of the mesh complexity). Reviewers: brecht, juicyfruit Subscribers: eyecandy, venomgfx Differential Revision: https://developer.blender.org/D1086
Diffstat (limited to 'intern/cycles/kernel/shaders')
-rw-r--r--intern/cycles/kernel/shaders/node_geometry.osl5
1 files changed, 4 insertions, 1 deletions
diff --git a/intern/cycles/kernel/shaders/node_geometry.osl b/intern/cycles/kernel/shaders/node_geometry.osl
index 580ccba8238..2bbaaff2133 100644
--- a/intern/cycles/kernel/shaders/node_geometry.osl
+++ b/intern/cycles/kernel/shaders/node_geometry.osl
@@ -26,7 +26,8 @@ shader node_geometry(
output normal TrueNormal = normal(0.0, 0.0, 0.0),
output vector Incoming = vector(0.0, 0.0, 0.0),
output point Parametric = point(0.0, 0.0, 0.0),
- output float Backfacing = 0.0)
+ output float Backfacing = 0.0,
+ output float Pointiness = 0.0)
{
Position = P;
Normal = NormalIn;
@@ -57,5 +58,7 @@ shader node_geometry(
/* otherwise use surface derivatives */
Tangent = normalize(dPdu);
}
+
+ getattribute("geom:pointiness", Pointiness);
}