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:
authorMatt Ebb <matt@mke3.net>2008-10-01 07:35:53 +0400
committerMatt Ebb <matt@mke3.net>2008-10-01 07:35:53 +0400
commit8622cbca359d77eb980250b42d0635c0dddfa48b (patch)
tree8519ed851af8a1a9295405be456a36f5c81e16f8 /source/blender/blenlib/BLI_kdopbvh.h
parent3c99a0f73539e5a3c8ceeb02e6c5a21ed4985f71 (diff)
* Point Density texture
Replaced the previous KD-tree (for caching points) with a BVH-tree (thanks to Andre 'jaguarandi' Pinto for help here!). The bvh is quite a bit faster and doesn't suffer some of the artifacts that were apparent with the kd-tree. I've also added a choice of falloff types: Standard, Smooth, and Sharp. Standard gives a harder edge, easier to see individual particles, and when used with a larger radius, Smooth and Sharp falloffs make a much cloudier appearance possible. See the image below (note the settings and render times too) http://mke3.net/blender/devel/rendering/volumetrics/pointdensity_bvh.jpg
Diffstat (limited to 'source/blender/blenlib/BLI_kdopbvh.h')
-rw-r--r--source/blender/blenlib/BLI_kdopbvh.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h
index e3591a84e98..8912ac5bd13 100644
--- a/source/blender/blenlib/BLI_kdopbvh.h
+++ b/source/blender/blenlib/BLI_kdopbvh.h
@@ -71,6 +71,9 @@ typedef void (*BVHTree_NearestPointCallback) (void *userdata, int index, const f
/* callback must update hit in case it finds a nearest successful hit */
typedef void (*BVHTree_RayCastCallback) (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit);
+/* callback to range search query */
+typedef void (*BVHTree_RangeQuery) (void *userdata, int index, float squared_dist, float radius);
+
BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis);
void BLI_bvhtree_free(BVHTree *tree);
@@ -93,5 +96,9 @@ int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nea
int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata);
+/* range query */
+int BLI_bvhtree_range_query(BVHTree *tree, const float *co, float radius, BVHTree_RangeQuery callback, void *userdata);
+
+
#endif // BLI_KDOPBVH_H