Professional Documents
Culture Documents
Adaptive Unwrapping For Interactive Texture Painting: Takeo Igarashi Dennis Cosgrove
Adaptive Unwrapping For Interactive Texture Painting: Takeo Igarashi Dennis Cosgrove
Adaptive Unwrapping For Interactive Texture Painting: Takeo Igarashi Dennis Cosgrove
ABSTRACT
We present a method for dynamically generating an efficient
texture bitmap and its associated UV-mapping in an interactive
texture painting system for 3D models. Typical 3D texture
painting programs require the user to explicitly define the
underlying UV-mapping from 3D geometry to 2D bitmap prior to
painting. This mapping is unchanged by the painting process.
However, a predefined UV-mapping can cause distortion at
arbitrary locations and waste bitmap memory in unpainted areas.
To solve these problems, we propose an adaptive unwrapping
mechanism where the system dynamically creates a tailored
UV-mapping for newly painted polygons during the interactive
painting process. This eliminates the distortion of brush strokes,
and the resulting texture bitmap is more compact because the
system allocates texture space only for the painted polygons. In
addition, this dynamic texture allocation allows the user to paint
smoothly at any zoom level. This technique can be efficiently
implemented using standard 3D rendering engines, and the
painted models can be stored as standard textured polygonal Figure 1: A screen snapshot of Chameleon. The user
models. We implemented a prototype system, called Chameleon, paints strokes on the 3D model directly without
and our users’ experiences suggest that our technique is very specifying the UV mapping beforehand.
useful for simple painting by casual users.
Keywords
Texture mapping, texture painting, interactive 3D graphics,
multiresolution paint, zooming, 3D content creation.
1. INTRODUCTION
This paper addresses the problem of interactively creating and
refining a hand-painted texture on a 3D polygonal model.
Traditionally, the user first specifies the UV-mapping that maps
3D geometry onto the 2D texture bitmap (the process is called
unwrapping), and then paints on the 2D texture bitmap using
various paint tools. 3D painting systems make the process easier
by allowing the user to paint the object surface directly in the 3D
view. The system re-projects the painted strokes in the 3D view
to the 2D bitmap according to the predefined UV-mapping, and Figure 2: Automatically generated texture and the
instantly presents the result in the 3D view. UV-mapping for the painted model in Figure 1.
Each patch corresponds to a meaningful visual
feature, and the bitmap memory is not assigned for
the areas that are not touched by the brush strokes.
The buttons at the bottom of the panel (Figure 1) allow the When the user finishes painting, the system stores the texture
user to choose brushes and to perform various operations. The bitmap and the geometry with the assigned UV coordinates. The
second button from the left, flood fill, allows the user to specify resulting bitmap has a number of good characteristics (Figure 2).
the color for an entire area with a single step. The area is the set The seams mainly run through the gaps between important visual
of polygons contiguous to the polygon the user clicks that are features. This prevents distortion when reducing the size of the
either enclosed by boundary edges or are all the same color bitmap later (Figure 13). The bitmap is assigned mainly for the
(whichever is smaller). The third button, dunk fill, fills the entire areas where the user painted with brush strokes, and the rest of
model with the target color. The fourth button, eye dropper, picks the surface does not waste texture memory. In addition, the
a color from the model surface and sets it to be the current system assigns an appropriate amount of bitmap according to the
painting color. The fifth button is a laser brush. While this button visual complexity of each area (e.g. eyes typically consume a
is on, the user’s strokes penetrate the model and paint both front large area, while the identically colored belly consumes a smaller
and back surfaces. This makes it convenient to, for example, area).
paint wings or a tiger’s tail (Figure 5). The sixth button is undo.
Our current implementation supports unlimited undo operations. 4. IMPLEMENTATION
The seventh button allows the user to rotate the model to a fixed This section describes the implementation details of Chameleon.
viewing angle (we provide predefined front, left, right, back, top, We emphasize how we achieve fast feedback to the user during
and bottom views for convenience). The final button is not the painting operations using a standard texture mapping engine.
functional in the current implementation. We wrote our prototype system in Java using Microsoft’s
DirectX libraries [14].
However, an exact solution cannot generally be computed within a square whose side length is L, and pushes each patch
because the problem is NP-hard. A typical approach is to ask the upward until it hits another patch to minimize the gap (Figure
user to do the task manually when high quality packing is 12e). We found that this simple algorithm works reasonably well
required. for the typical sets of patches we see in our experiment (Figure
In our current implementation, we use a simple heuristic 14,15).
algorithm. This algorithm is a temporary solution and we plan to The result of this straightforward packing algorithm can be too
investigate more sophisticated implementations in the future. large for certain purposes. If the user wants to send the painted
However, the algorithm described below is easy to implement, model over the network, a smaller texture bitmap would be
fast, and produces reasonable results, which is sufficient for our preferable. In these cases, it is necessary to shrink the packed
prototype. texture bitmap to a lower resolution. However, reducing the
As a preprocessing step, the system obtains the bounding box texture resolution can make seams visible, and this damages
of each patch, and handles each as a rectangular box throughout rendered images because patches start to be affected by the
the packing process (Figure 12a). The system calculates the total surrounding pixels. The texture atlas created by Chameleon is
area of the patches, and gets the square root of the total area. The more robust against this aliasing problem because more seams
system defines the target size (L) of the resulting texture as are arranged in unpainted areas, unlike an automatically
slightly longer than the square root (multiplied by 1.2). After this, generated UV mapping in traditional 3D paint systems (Figure
the system first finds the patches whose width is longer than their 13). It is possible to prevent the aliasing problem by
height and rotates them 90 degrees. As a result, all patches are implementing a dedicated scaling procedure that takes cares of
taller than they are wide (Figure 12b). Then the system sorts the the patch boundaries, but we have not worked on this yet.
patches by their height, and lines them up horizontally (Figure
12c). The system then folds the line as shown in Figure 12d to fit
5. RESULTS various features of Chameleon, casual users simply take it for
Figure 14 shows several models painted by one of the authors granted that one can interactively paint directly on a 3D model
using Chameleon. It took less than a few minutes to paint each of and receive the correct feedback in real-time. The laser tool
them from scratch. The rendered images are clear and the texture turned out to be very useful. Several users struggled with
bitmap is compact and efficient. We used a 500 MHz Pentium III repeatedly brushing and rotating to cover all sides of an
PC without any hardware acceleration, and the computing time is extremity or complete a stripe on the tail of the practice model.
almost unnoticeable during the painting operation. These models They were all pleased when shown the laser tool in the tutorial
also represent the target class of paintings for Chameleon. Only a portion of the study, and they proceeded to use it extensively
few areas are touched, and most areas are covered by the base throughout the remainder of the study.
color. Different areas require different levels of detail. They are In order to verify our assumption that the casual users paint
informal paintings rather than professional models to be used in only limited areas of the surface in informal paintings, we
production. counted the number of polygons that were painted by brush
We performed a user study to observe how users react to the strokes and calculated the percentage of the painted polygons for
system, and to obtain insights about their paintings. Fifteen each painting. Polygons filled by flood fill and dunk fill are not
participants from various backgrounds took part in the study: included in the painted polygons. Figure 16 shows the histogram
four digital artists/designers, four computer scientists and seven of the result. Although we did not provide any direction on how
casual users. We first asked them to try Chameleon on a practice to paint the model, most users painted only a limited percentage
model without any instruction. Then, we provided them with of the entire surface (the average was 24.3%).
complete tutorial and asked them to freely paint five models (cat,
chicken, elephant, monkey, and bear). As a result, we got 75
# of paintings
paintings in total. Average time for a subject to complete a
painting was approximately 4.8 minutes. Figure 15 shows some 25
of the paintings by the subjects. In general, the subjects found
Chameleon intuitive, and painted the models without difficulty. 20
15
10
0
subject #0, 22% are painted, 4 minutes. 0-10% 10-20% 20-30% 30-40% 40-50% 50-60% 60-70%
Percentage of painted polygons
Adaptive Unwrapping for Interactive Texture Painting, Takeo Igarashi and Dennis Cosgrove