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:
authorMai Lavelle <mai.lavelle@gmail.com>2016-08-14 18:44:25 +0300
committerMai Lavelle <mai.lavelle@gmail.com>2016-09-02 05:45:49 +0300
commite7ea1ae78c84904864c17248b1b22b1e6c11acc9 (patch)
tree58c4396ef99d11be64d3421bdbd049e67d076075 /intern/cycles/kernel/kernel_types.h
parent62aecbdac19aca49270a11cd0d835f22d31cad72 (diff)
Cycles microdisplacement: Improved automatic bump mapping
Object coordinates can now be used in the displacement shader and will give correct results, where as before bump mapping was calculated from the displace positions and resulted in incorrect shading. This works by evaluating the shader in two parts, first bump then surface, and setting the shader state to match what it would be if the surface was undisplaced for the bump shader evaluation. Currently only `P` is set as if undisplaced, but other shader variables could be set as well, such as `I` or `time`. Since these aren't set to anything meaningful for displacement I left them out of this patch, we can decide what to do with them separately. Reviewed By: brecht Differential Revision: https://developer.blender.org/D2156
Diffstat (limited to 'intern/cycles/kernel/kernel_types.h')
-rw-r--r--intern/cycles/kernel/kernel_types.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index deebf87c75f..0646148f6a0 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -714,20 +714,21 @@ enum ShaderDataFlag {
SD_VOLUME_MIS = (1 << 19), /* use multiple importance sampling */
SD_VOLUME_CUBIC = (1 << 20), /* use cubic interpolation for voxels */
SD_HAS_BUMP = (1 << 21), /* has data connected to the displacement input */
+ SD_HAS_DISPLACEMENT = (1 << 22), /* has true displacement */
SD_SHADER_FLAGS = (SD_USE_MIS|SD_HAS_TRANSPARENT_SHADOW|SD_HAS_VOLUME|
SD_HAS_ONLY_VOLUME|SD_HETEROGENEOUS_VOLUME|
SD_HAS_BSSRDF_BUMP|SD_VOLUME_EQUIANGULAR|SD_VOLUME_MIS|
- SD_VOLUME_CUBIC|SD_HAS_BUMP),
+ SD_VOLUME_CUBIC|SD_HAS_BUMP|SD_HAS_DISPLACEMENT),
/* object flags */
- SD_HOLDOUT_MASK = (1 << 22), /* holdout for camera rays */
- SD_OBJECT_MOTION = (1 << 23), /* has object motion blur */
- SD_TRANSFORM_APPLIED = (1 << 24), /* vertices have transform applied */
- SD_NEGATIVE_SCALE_APPLIED = (1 << 25), /* vertices have negative scale applied */
- SD_OBJECT_HAS_VOLUME = (1 << 26), /* object has a volume shader */
- SD_OBJECT_INTERSECTS_VOLUME = (1 << 27), /* object intersects AABB of an object with volume shader */
- SD_OBJECT_HAS_VERTEX_MOTION = (1 << 28), /* has position for motion vertices */
+ SD_HOLDOUT_MASK = (1 << 23), /* holdout for camera rays */
+ SD_OBJECT_MOTION = (1 << 24), /* has object motion blur */
+ SD_TRANSFORM_APPLIED = (1 << 25), /* vertices have transform applied */
+ SD_NEGATIVE_SCALE_APPLIED = (1 << 26), /* vertices have negative scale applied */
+ SD_OBJECT_HAS_VOLUME = (1 << 27), /* object has a volume shader */
+ SD_OBJECT_INTERSECTS_VOLUME = (1 << 28), /* object intersects AABB of an object with volume shader */
+ SD_OBJECT_HAS_VERTEX_MOTION = (1 << 29), /* has position for motion vertices */
SD_OBJECT_FLAGS = (SD_HOLDOUT_MASK|SD_OBJECT_MOTION|SD_TRANSFORM_APPLIED|
SD_NEGATIVE_SCALE_APPLIED|SD_OBJECT_HAS_VOLUME|