<div>* Optimized the code that finds where in the mesh to sculpt.  This code used ray-casting to find bounding boxes, and then tested every triangle in the nodes where it hit.</div><div>The first problem was that it worked bottom up in the bounding box hierarchy, meaning it tested all leaf nodes even if the ray completely missed the model.  This isn&#39;t a big deal since models in the worse case may have thousands, not millions of leaf nodes.  But I arranged for the code to work top down anyway because it simplified the code is required for the next optimization which was to sort any intersected boxes by distance and then do testing from closest to furthest.  The result of this is that usually only one node has all of its triangles tested.  This reduced the percentage of time spent testing triangles by more than half.</div>
<div><br></div><div>* This needed to be optimized because with future changes, like drawing the brush on the model and the &quot;Lock Brush Size&quot; feature I added this week, ray casting will happen every time the mouse moves instead of just when its clicked.</div>
<div><br></div><div>* The clay brush now has two controls that effect its shape, a strength and an offset.  This brings it in line with how it works in zbrush.</div><div><br></div><div>* Integrated &quot;Unlimited Clay&quot; so that people trying the sculpt branch can play with it as well.  I do not intend to do much with it except making sure it compiles.</div>
<div><br></div><div>* I disabled the &quot;texcache&quot; because it re-implements a lot of features already present in Blender&#39;s texture mapping facilities and it is too low resolution for certain tasks (in fact, some textures are infinitely large).  The plan is to find better ways to improve texturing performance without sacrificing quality.</div>
<div><br></div><div>I also spent a lot of time working on problems that resulted not so much in code and features but in a better understanding of how Blender works.  This consisted to two major areas, programming the UI and symmetric sculpting.</div>
<div><br></div><div>--</div><div><br></div><div>All I have to say about UI programming is that I dread any time I want to do something new with it...</div><div><br></div><div>--</div><div><br></div>To be honest this has been one of those weeks where I feel like I&#39;m banging my head against a wall.  With each blow I expect the problem to finally give way but all I end up with is a headache.<div>
<br></div><div>The good news is that I better understand the nature of the wall...</div><div><br></div><div>I&#39;m referring to sculpting with symmetry turned on and what happens when two instances of the brush act on the same area.  I tried several solutions and none of them were satisfactory.  The original behavior of the brush was preferable in all cases.  </div>
<div><br></div><div>What I tried, so that if I do not return to and solve this problem somebody has a record of what didn&#39;t work:</div><div><br></div><div>Solution: Setting any component of a vertex that moves past the line of symmetry to zero. </div>
<div>Failed: Vertex does not end up where it would if you clipped its displacement vector against the plane.</div><div>I didn&#39;t try to do this because of the other problem, lots of points bunch up on the clipping plane</div>
<div><br></div><div>Solution: Do not even touch the vertexes on the other side of the line of symmetry.</div><div>Failed:Brushes work by repeatedly applying an operation to the vertexes in a spherical region.  A freehand stroke is made by evenly spacing a series of such operations so that they look continuous.  At the line of symmetry the spacing is uneven, resulting in a dip, and eventually a seam appears on the line of symmetry.</div>
<div><br></div><div>Solution: Reduce the effect of the brush on vertexes close to the line of symmetry.</div><div>Failed: I had a buggy implementation, but decided to move on to a different idea, I still need to try this one though.</div>
<div><br></div><div>Solution: Test each vertex to see if more than one brush will effect it, reduce the effect of the brush on it.  </div><div>Failed: If 3 brushes effect and area each is reduced by 1/3, and next to it is an area where things are reduced 1/2 and 1/4.  This creates a discontinuities.</div>
<div>I attempted to come up with a continuous solution,and some had deceptively good results.  </div><div><br></div><div>Ultimately I believe I can&#39;t put a band-aid on this one.  Symmetry will have to become an integral part the data structures and algorithm instead of the current solution of applying each symmetry daub one after another.</div>
<div><br></div><div>--</div><div><br></div><div>Next week I&#39;m going to tackle easier tasks in an effort to raise my moral :)</div><div><br></div>