利用者:Nicholasbishop/SummerOfCode2006

提供: wiki
移動先: 案内検索

Useful links

Projects Todo

No guarantees, but here's a list of likely improvements/fixes/additions:

  • Sculptmode
    • Interactive strength-set (similar to Dkey size-set)
    • Masking
    • Cache depth buffer to stop brush from interacting with itself (necessary for things like a layer brush)
    • Shortcut keys for sculptmode tools
    • Use vertex groups for partial mesh visibility
    • Use another mesh as the basis for new brush shapes
    • Bug: sometimes when using sculptmode, buttons don't notice click events
    • Tablet support: works for GNU/Linux, Matt Ebb added it for MacOS, still need someone to add Windows support
    • Morph brush that morphs an area of the mesh into a previously-stored mesh
  • Multires
    • Improve UV interpolation
    • Add support for vertex groups (at the very least, stop it from crashing!)
    • Improve memory usage
    • Reconstruct new lower level
    • Deal with editmode (either stop the user from changing mesh topology in editmode, or find a way to reintegrate the changes.)
    • Creases
  • Retopo
    • Fix interaction with mirror modifier's Do Clipping
    • Automatic face generation
    • Find a better way to keep the retopo mesh in front of whatever's in the depth buffer

If you think something's missing, please post about it here: http://blenderartists.org/forum/showthread.php?t=71671

Proposal

Nicholas Bishop

nicholasbishop@gmail.com

Project Proposal

Interactive sculpting with multi-resolution models

Synopsis

The goal of this project is improving the modeling tools in Blender. I plan two steps to accomplish this: integrate sculpting tools from the open-source project SharpConstruct[1] into Blender, and improve these tools by implementing multi-resolution models.

Benefits to the Blender Community

Modeling with a sculpting tool greatly simplifies modeling that involves organic forms or heavily detailed surfaces. Blender's current modeling tool set is geared toward subdivisional modeling, but subdivisional modeling is difficult for new users to learn, and modeling becomes more difficult as the model is subdivided further. Sculpting tools offer a much more intuitive modeling paradigm that does not become more difficult to use as the mesh becomes more dense.

Deliverables

1) A new edit mode for interactive sculpting

2) Modify the subsurf modifier to support multi-resolution models

Project Details

1) Integrate sculpting tools into Blender

Blender's current modeling tools are primarily for traditional subdivisional modeling. The user starts with a very low-resolution base mesh, which is shaped by simple operations applied to groups of vertices. The surface is then subdivided and smoothed, and is further refined. While this technique is very precise and can produce a model with excellent topology, it has several disadvantages. First, dealing with the model as a collection of elements (vertices, edges, and polygons) becomes increasingly difficult as the level of subdivision increases, as each subdivision typically increases the number of polygons in the model by a factor of three or four. Second, this technique is very difficult for new users to learn. It requires a lot of practice, especially because it's hard to see results immediately.

My solution to this problem is a 3D sculpting tool. Examples of this include

  • ZBrush, a commercial modeling program[2]
  • SculptMesh, a Blender python script[3]
  • SharpConstruct, an open-source modeler I developed[1]

The sculpting tool behaves like a 2D paint program. Just as one uses a brush to paint a stroke of color in a 2D paint program (as opposed to changing the value of individual pixels) the 3D sculpting tool paints a "depth stroke" onto the model, raising or lowering the surface beneath the brush. Having worked on SharpConstruct's modeling tools, I have a lot of experience with this type of modeling, and I believe that once I have familiarized myself with Blender's code, adding these tools will be relatively easy. However, I don't intend to copy code from SharpConstruct directly into Blender. Instead, I will rewrite the sculpting tools in C (SharpConstruct is written in C++). I want to make sure the code is free of cruft from earlier versions of SharpConstruct.

The sculpting tool, which I typically refer to as a brush, comes in several varieties. I intend to implement at least two of these: displacement and smoothing. The displacement brush is very simple; it adds or subtracts depth in a curve following the path of the mouse. It's used for most shaping operations, both large, such as blocking out the shape of a head, and small, such as adding wrinkles. The smooth brush acts like a typical surface-smoothing tool, except that it only affects the area beneath the brush.

Brushes also have a number of important properties.[4] I've created a simple (non-functional) interface in Blender that demonstrates what these properties might look like.[6]

2) Multi-Resolution Modeling (MRM) tools

Despite the ease-of-use that sculpting tools offer, they have one major disadvantage: the final mesh is often extremely dense. This makes it difficult to make larger changes to the model quickly.

The advantage of MRM is that subdividing the model does not simply alter the model's topology. Instead, it adds a layer of detail on top of existing layers. This allows the user to subdivide the model as normal, but then to return to the previous level of subdivision. At lower levels of subdivision, the model can more easily be modified, because there are fewer polygons to deal with. When the user returns to a higher level of subdivision, the changes from lower in the subdivision chain are reintegrated into the higher levels of subdivision.

MRM is useful when modeling because the user doesn't have to get everything just right before subdividing the model. For example, if it becomes apparent that a certain area of the model needs to become more dense, polygons can be shifted towards that area at a lower level of subdivision. When this change is reintegrated at the high-resolution level, the mesh will be proportionally more dense without losing existing details elsewhere on the model and with much less tedious adjusting of polygons. Another use of MRM is in animating a model. Similar to the way Blender's subsurf modifier has one control for display subdivision and another for render subdivision, MRM allows keyframing to be done at a low resolution, then rendered at the highest level of detail.

I have not yet written any code for this project, but I do have some thoughts on how MRM might be implemented.[5]

Project Schedule

I'll need at least a few days of poking at the source code before I start adding things. I anticipate spending roughly a third of the time on the sculpting tools, which will give me plenty of time to create the Multi-Resolution Modeling tools. If there's still time after that, I'll go back to the sculpting tools, and add more brushes (pinch, grab, etc.) and/or more modifiers (masking, layers, etc.)

I'm not setting any time apart specifically for debugging, as I believe it's better to do that as the code is written so that bugs are not forgotten. The same applies for writing the user documentation; I'll update the documentation as I add features.

I don't have anything significant planned for the summer, so I'm free to devote any amount of time it takes in order for me to finish the project on schedule.

Bio

I am eighteen years old, currently living in South Carolina, USA. I've been accepted to the University of Maryland, where I'll begin studying computer science in the fall.

About two years ago I started a free-software project called SharpConstruct in an effort to bring better modeling tools to the GNU/Linux platform. I see this Blender project as an excellent way to further that goal.

I am proficient in C and C++ (I expect to use mostly C for this project) and I am very comfortable with OpenGL. I use GNU/Linux, but I also have Windows installed on another partition, so I can test something there if necessary.

I've been using Blender since before it was made open source, so I'm familiar with the interface and the tools. I'm also familiar with the process of checking out the source code from CVS and building with SCons.

Links

[1] http://sharp3d.sourceforge.net

[2] http://pixologic.com

[3] http://mediawiki.blender.org/index.php/BlenderDev/SculpMesh

[4] http://mediawiki.blender.org/index.php/User:Nicholasbishop/SummerOfCode2006#Brush_properties

[5] http://mediawiki.blender.org/index.php/User:Nicholasbishop/SummerOfCode2006#Possible_implementation_for_multi-resolution_modeling

[6] http://mediawiki.blender.org/index.php/User:Nicholasbishop/SummerOfCode2006#Sculpting_Interface

Additional Notes

Brush properties

Brushes have several properties that are generic to most brush types. The most important of these that I intend to implement are size, strength, symmetry, and shape.

Size and strength, which together control the rate at which the brush alters the surface, are very basic and easy to implement.

Symmetry is slightly more complex. Symmetry should be available across the X, Y, or Z axes, or any combination of these. For example, when modeling a face, symmetry is usually desirable so that both sides are identical.

The shape property of the brush is also very important. While the area of influence of the brush is a sphere, the brush becomes much more versatile when the strength of the brush varies at different points inside the sphere. This can be accomplished with an alpha image. Blender offers an excellent array of texture types that the brush will be able to access for this purpose. It's important to manage the brush in terms of what the user sees on screen, not the size of the model, which is in arbitrary units as far as the user is concerned. The image is first mapped to the size of the brush as it appears on screen, then remapped to the 3D coordinates of the model. This can be accomplished by unprojecting a few 2D points in window coordinates into 3D coordinates in model coordinates. The correct scaling factor can be found by comparing the pixel size of the 2D representation of the brush with the 3D diameter of the brush's sphere of influence.

Possible implementation for multi-resolution modeling

(1) It would be important that each level of subdivision would contain only the data unique to that level. For example, if the model starts out as a single quad, and it is subdivided once, the second level of subdivision will include only the five new vertices, while the other four would be stored with the first level.

(2) The current level of subdivision will store displacement vectors for each vertex. These vectors will be set to zero when a level of subdivision is selected. Also, upon switching to any level of subdivision, the initial position of its vertices must be stored.

(3) Changes made to the model at any particular level of subdivision need to be propagated up the chain, but not downwards. Since all the vertices from the lower levels are used as-is in the higher levels, lower levels are simply modified at the same time as the higher level is.

(4) The complicated part is propagating changes to higher levels. It's important to note that this only needs to be done when switching from one level to another, not after every modification to the model (which would be extremely slow from the user's perspective.) The first step when switching levels is to calculate the displacement vectors (2) using the current vertex locations and the copy that was stored before the modifications.

(5) The algorithm to update the higher levels would work like this: for each vertex, first find all vertices that are attached to the current vertex by an edge. Calculate the average of the displacement vectors for each neighbor, and add that vector to the current vertex. After this level is fully updated, go up to the next level and update, and continue until the highest level is reached.

Sculpting Interface

This is a screenshot of a non-functional Blender interface for the main sculpting tools. There will be a second tool panel next to this one with brush shape options like size, alpha, and falloff. / image /