Tuesday, June 25, 2013

Painting Wires on Mesh

I came up with a few different ideas to approach this effect. There are pros and cons in all of them. We will have to decide which one works best for our project.

Sort by Hit Position:

This is the most straight-forward approach. The user paints on the mesh and the color is transfered to scattered points( does not require high resolution mesh). The points are then snapped by averaging their positions which reduces the total number of points and gives points which are roughly the same as the painted shape. The points are then sorted by the hit position parameter on the paint SOP. This roughly sorts the points in the same direction as the stroke. The curve is drawn using an add SOP and is rayed on the mesh to give the final result.

PROS:

Works with low poly models.
Fast.

CONS:

Works only for straight and slightly curved lines, not so good for complicated shapes.









Raying Curves in UV space:

This technique uses UV space instead of world space, which makes it easier for the Ray SOP incase of complex geometry. The object is unwrapped in the viewport ( by feeding $MAPU and $MAPV in the point SOPs position). The user can then draw actual curves on the unwrapped geometry from the front viewport.

PROS:

Works very well with Polys and Nurbs and does not require high tesselation.

CONS:

Requires good UV's
Not very interactive as curves are drawn in UV space.


 



Nearest Point Search(by Jelmer):

Jelmer came up with this idea of connecting points based on a nearest neighbour search. This idea works better with complicated patterns.

PROS:

Works with more complex painted shapes.

CONS:

It is slow compared to other approaches.
Requires a very high resolution geometry to work.







Record CHOP approach:

This approach records the stroke information and outputs a almost perfect curve representation. However it is not at all straight-forward.

PROS:

Curves are perfectly aligned with the paint strokes. Works great with all kind of shapes.
Fast, requires moderate tesselation.

CONS:

It is not a completely automated system. The record CHOP works frame by frame so inorder to record a stroke, the user has to paint a stroke and go one frame forward by pressing the forward arrow key. There are also a couple other parameters that the user will have to set everytime he paints.
I am still working with this system, trying to make it more automated.










No comments:

Post a Comment