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>2016-02-15 17:40:39 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-02-15 23:26:29 +0300
commit1c4f21f85e17ac557c9867a7764a31d5ebe74eb0 (patch)
tree72ea537d6624e43e452ce7465f25f92832b88e4f /intern/cycles/kernel/svm/svm_voxel.h
parentb5171e250c6816ecce26227615d53cf6f6339892 (diff)
Cycles: Initial support of 3D textures for CUDA rendering
Supports both smoke/fire and point density textures now. Reduces number of textures available for sm_20 and sm_21, but you have to compromise somewhere on such a limited hardware. Currently limited to linear interpolation only, and decoupled ray marching is not supported yet. Think those could be considered just a further improvement. Some quick example: https://developer.blender.org/F282934 Code is minimal and we can fully consider it a fix for missing support of 3D textures with CUDA. Reviewers: lukasstockner97, brecht, juicyfruit, dingto Reviewed By: brecht, juicyfruit, dingto Subscribers: mib2berlin Differential Revision: https://developer.blender.org/D1806
Diffstat (limited to 'intern/cycles/kernel/svm/svm_voxel.h')
-rw-r--r--intern/cycles/kernel/svm/svm_voxel.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/intern/cycles/kernel/svm/svm_voxel.h b/intern/cycles/kernel/svm/svm_voxel.h
index 31cad5ec887..af03ce3fe12 100644
--- a/intern/cycles/kernel/svm/svm_voxel.h
+++ b/intern/cycles/kernel/svm/svm_voxel.h
@@ -16,8 +16,6 @@
CCL_NAMESPACE_BEGIN
-#if !defined(__KERNEL_GPU__)
-
/* TODO(sergey): Think of making it more generic volume-type attribute
* sampler.
*/
@@ -43,13 +41,15 @@ ccl_device void svm_node_tex_voxel(KernelGlobals *kg,
tfm.w = read_node_float(kg, offset);
co = transform_point(&tfm, co);
}
+#if defined(__KERNEL_GPU__)
+ float4 r = volume_image_texture_3d(id, co.x, co.y, co.z);
+#else
float4 r = kernel_tex_image_interp_3d(id, co.x, co.y, co.z);
+#endif
if (stack_valid(density_out_offset))
stack_store_float(stack, density_out_offset, r.w);
if (stack_valid(color_out_offset))
stack_store_float3(stack, color_out_offset, make_float3(r.x, r.y, r.z));
}
-#endif /* !defined(__KERNEL_GPU__) */
-
CCL_NAMESPACE_END