Commit Graph

75 Commits

Author SHA1 Message Date
3c8b695f72 Fixed a bug relative to editmode..
now its calling CDDM_calc_normals when receiving a mesh to deform,
since in edit mode the mesh doenst has normals calculated
2008-07-21 22:36:05 +00:00
4c76c57a77 Made shrinkwrap modifier work when target or cutPlane are in editmode. 2008-07-21 18:12:02 +00:00
0703d9aad1 Following the same optimization as bvh raycast:
*Made nearest surface also use "quad" bvh tree (instead of splitting quads in 2 bvh nodes).
 Again that leaded to improvements in build and query time.

*BLI_bvhtree_find_nearest api is now following the same concept as BLI_bvhtree_ray_cast

removed code relative to bvhtree_from_mesh_tris.
2008-07-19 15:22:38 +00:00
59a2b50171 *Added "kept" mesh above surface option on shrinkwrap to nearest surface
changed a few code relative to project over normal mode (to try to kept code generic and more independent of modifier itself)
2008-07-18 22:24:20 +00:00
785123cc5a Improved build time on BLI_kdopbvh
Its now faster than raytree (both on build and query)

Things tryed:
 X=>Y=>Z=>X split (reduces build time.. but increases query time)
 bucket sorts
	(initial sorts for fast usage of bucket take a long time)
	(nth is linear.. so its quite fast already)

Best times archieve with:
 *usage of 4-ary trees.. reduces build time and tree size but didnt decreased query time
 *quads are on the same node instead of splitting in 2 tris..
	(this actually turned on speedup on query time.. since tree size is reduced by a factor of 2)
 *test ray-bb before ray-primitive gives better times on both tris and quads

Notes:
 measures where made projecting a sphere from inside the head of suzanne.
2008-07-14 18:42:53 +00:00
7d6e004153 Adding the Cullface option on normal projection of shrinkwrap when using bvhtrees 2008-07-13 01:49:53 +00:00
21d032e919 Added sphere cast (tought it doenst seems to solve the intersection problem)
Fixed SweepingSphereIntersectsTriangleUV
2008-07-11 19:46:35 +00:00
d674041f2b Add raycast ability for BLI_kdopbvh
small bvh fixes:
*allow to create any tree type >= 2
*save split axis

changed shrinkwrap to perform normal cast with raytree and bvh tree and print both times:

Shrinkwrap (OBCube)24578 over (OBSuzanne)504482
target = raytree_create_from_mesh(calc->target): 1260.000000ms
shrinkwrap_calc_normal_projection_raytree(&calc): 1850.000000ms
tree = bvhtree_from_mesh_tri(calc->target): 3330.000000ms
shrinkwrap_calc_normal_projection(&calc): 3780.000000ms

On general query time is bit smaller on bvh tree..
but the build time of bvh is pretty big.
(build time can be removed from both if a cache system is added)
But I am still trying to see how fast I can make the bvh build
2008-07-09 19:43:09 +00:00
37a017b18a *Added vertex groups on simple deform
*Fixed a few UI things

*Make SimpleDeform and Shrinkwrap to use vertexgroup_get_vertex_weight, a similar function
 "static float vert_weight(MDeformVert *dvert, int group)"  existed on modifier.c, changed
it a bit and moved into BKE_deform.h
2008-07-04 19:56:31 +00:00
824eac5095 Added cut-plane option.
Its now possible to project 2 planes over a model and get a cloth..
Tought it still has a few issues.. related with distance to kept from mesh.
2008-06-20 21:10:16 +00:00
91f8ad8398 Added merge option to shrinkwrap when using projection mode (bruteforce for now)
Changed code to remove faces (now quad faces that got one vertice projected are turned on tri)

Merge option is still not very usefull since shrinkwrap does not yet moves unprojected vertices
2008-06-17 19:00:21 +00:00
7f3928652e Added culling on normal projection.
Now renderdemon is happy ;)
and now shrinkwrap can be used for bulging :)
2008-05-31 01:25:24 +00:00
40b0de4506 Fixed a compile error under msvc. 2008-05-27 18:40:33 +00:00
2a0a999a71 Added bvh nearest neighbour for nearest surface shrinkwrap 2008-05-27 18:32:23 +00:00
4383743ace Fixed some compile erros under msvc (thanks lguillaume)
Fixed object dependency (thanks ZanQdo for pointing it out)
Make some code cleaner
(preparing for adding bvh trees on nearest surface)
2008-05-26 21:57:53 +00:00
ad2fecf266 Added BVH nearest neighbour code, for now only works in 6-dop and finds the node with the nearest bounding volume.
I'll work on making it more generic.
So far it querys faster than kdtree, but building the tree is slower.
And bvhtree NN uses an heuristic based on the last match.

Shrinkwrap (OBCube)24578 over (OBSuzanne)31658
kdtree
build: 30.000000ms
query: 1360.000000ms

bvhtree
build: 140.000000ms
query: 490.000000ms

Shrinkwrap now uses bvhtree (binary tree, 6dop) for nearest vertex.
2008-05-25 15:43:18 +00:00
859a05864c I'm considering using bvhtree for shrinkwrap but the build was considerable slower than kdtree
as so i've made some improvements

So basicly theres no shrinkwrap improvements for now...
2008-05-14 18:25:23 +00:00
53e08925b5 Merge from trunk
svn merge -r 14692:14760 https://svn.blender.org/svnroot/bf-blender/trunk/blender
2008-05-09 11:57:52 +00:00
50acbe29d1 Normal projection:
+added option to remove faces where all vertices got unprojected

Nearest surface point
+15% faster closest point on point-tri function
(archived by projecting the point on tri-plane and solving the problem on 2D)
(its still using bruteforce on triangles.. I'll add the right data structure later)
2008-05-07 12:45:02 +00:00
2b5432e6bb Added control over distance to kept form target mesh
Quad bug was fixed by splitting the quads that are feed to RayTree
2008-05-02 22:09:01 +00:00
9026559ded +normal projection optimized with RayTree (RE_raytrace.h)
+control for normal projection direction (default,inverted,both)

There are some bugs on projection over quads.. it seems to work 100% on fully triangulized meshs
2008-05-02 00:16:48 +00:00
64f5d1bdf3 Nearest-vertex mode optimized with kdtrees
currently uses the kdtree code avaible on blender
2008-05-01 01:00:01 +00:00
29f0f74b05 Changed a bit of code structure to make method optimization easier 2008-04-30 17:55:26 +00:00
928b676b99 Implemented shrink modes are now:
+ Nearest surface point
+ Normal projection
+ Nearest vertex (gives similar results to nearest surface if the target mesh has many vertexs and is a lot faster to calculate)
^^ all bruteforce calculation for now

+ fixed matrix order multiplication
+ request for CD_MDEDEFORMVERT
2008-04-27 19:29:40 +00:00
a0add959ff Shrinkwrap skeleton code
+vertex weights supported
+target object now saves to file: load/save works :)

for now simple moves objects vertexs to the nearest vertexs on target object
(so that I can test if its working correctly with the modifier API)
2008-04-25 18:22:20 +00:00