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>2014-10-22 17:23:45 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2014-10-22 17:53:06 +0400
commitd2d1b19170c5790b2ef971f5d825d3c36e008513 (patch)
tree6f72ebf7152740c2bf3390418d2762fa6655c745 /intern/cycles/blender
parentc24698a37e1382c6f2ee3c8da935a3399a7836b4 (diff)
Cycles: Expose volume voxel data interpolation to the interface
It is per-material setting which could be found under the Volume settings in the material and world context buttons. There could still be some code-wise improvements, like using variable-size macro for interp3d instead of having interp3d_ex to which you can pass the interpolation method.
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r--intern/cycles/blender/addon/properties.py19
-rw-r--r--intern/cycles/blender/addon/ui.py2
-rw-r--r--intern/cycles/blender/blender_shader.cpp2
3 files changed, 23 insertions, 0 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py
index 597ac1a9ce0..05a6f70d423 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -114,6 +114,11 @@ enum_volume_sampling = (
('MULTIPLE_IMPORTANCE', "Multiple Importance", "Combine distance and equi-angular sampling for volumes where neither method is ideal"),
)
+enum_volume_interpolation = (
+ ('LINEAR', "Linear", "Good smoothness and speed"),
+ ('CUBIC', 'Cubic', 'Smoothed high quality interpolation, but slower')
+ )
+
class CyclesRenderSettings(bpy.types.PropertyGroup):
@classmethod
@@ -617,6 +622,13 @@ class CyclesMaterialSettings(bpy.types.PropertyGroup):
default='DISTANCE',
)
+ cls.volume_interpolation = EnumProperty(
+ name="Volume Interpolation",
+ description="Interpolation method to use for volumes",
+ items=enum_volume_interpolation,
+ default='LINEAR',
+ )
+
@classmethod
def unregister(cls):
del bpy.types.Material.cycles
@@ -693,6 +705,13 @@ class CyclesWorldSettings(bpy.types.PropertyGroup):
default='EQUIANGULAR',
)
+ cls.volume_interpolation = EnumProperty(
+ name="Volume Interpolation",
+ description="Interpolation method to use for volumes",
+ items=enum_volume_interpolation,
+ default='LINEAR',
+ )
+
@classmethod
def unregister(cls):
del bpy.types.World.cycles
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 8743aa445be..6a08b47b01f 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -936,6 +936,7 @@ class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
sub = col.column()
sub.active = use_cpu(context)
sub.prop(cworld, "volume_sampling", text="")
+ sub.prop(cworld, "volume_interpolation", text="")
col.prop(cworld, "homogeneous_volume", text="Homogeneous")
@@ -1040,6 +1041,7 @@ class CyclesMaterial_PT_settings(CyclesButtonsPanel, Panel):
sub = col.column()
sub.active = use_cpu(context)
sub.prop(cmat, "volume_sampling", text="")
+ col.prop(cmat, "volume_interpolation", text="")
col.prop(cmat, "homogeneous_volume", text="Homogeneous")
diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp
index 33c7bf5f859..97f2ecc1a6c 100644
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@ -1015,6 +1015,7 @@ void BlenderSync::sync_materials(bool update_all)
shader->use_transparent_shadow = get_boolean(cmat, "use_transparent_shadow");
shader->heterogeneous_volume = !get_boolean(cmat, "homogeneous_volume");
shader->volume_sampling_method = RNA_enum_get(&cmat, "volume_sampling");
+ shader->volume_interpolation_method = RNA_enum_get(&cmat, "volume_interpolation");
shader->set_graph(graph);
shader->tag_update(scene);
@@ -1045,6 +1046,7 @@ void BlenderSync::sync_world(bool update_all)
PointerRNA cworld = RNA_pointer_get(&b_world.ptr, "cycles");
shader->heterogeneous_volume = !get_boolean(cworld, "homogeneous_volume");
shader->volume_sampling_method = RNA_enum_get(&cworld, "volume_sampling");
+ shader->volume_interpolation_method = RNA_enum_get(&cworld, "volume_interpolation");
}
else if(b_world) {
ShaderNode *closure, *out;