Tutorial for Exporting Sculpted Prims (Unwrap 3D Pro)

This tutorial will explain how to use Ultimate Unwrap 3D Pro to export sculpted prims for the game Second Life.


Sculpted Prims

What are sculpted prims? Simply speaking, sculpted prims are 3D models that are encoded as 2D bitmaps. Each RGB colored pixel represents a XYZ vertex position.

How can Unwrap 3D Pro be used to export sculpted prims? First, download and install the sculpted prim plugin found here.

Now, let me first say it is generally recommended that a NURBS modeler be used to create your model. This is because the UV map of a sculpted prim must look like a grid. Hence, NURBS is ideal for creating sculpted prims because it has built-in UV coordinates that are basically grids.

Below, shows what a typical UV map of a sculpted prim looks like:

tut_prim1.png

Can you create sculpted prims without a NURBS modeler? Yes, you can, but there are some disadvantages. One, is that you must arrange the UV coordinates yourself in the form of a grid. Another, is that your model should have enough detail to match whatever size sculpted prim you are exporting.

But, whatever the case may be, you can still use Ultimate Unwrap 3D Pro to export your sculpted prim. You can import a model from a NURBS modeler, create your own model, or even import a sculpted prim to make modifications. All you really need is a UV map that looks like a grid, and you're ready to go!


Sphere Example

To demonstrate, let's export a sphere as a sculpted prim from Unwrap 3D Pro. From the main menu, Click Create | Sphere:

tut_prim2.png

Check the option called Create quad poles. What this does is create quads instead of triangles for pole faces. Each of these quads will have a degenerate edge as the pole vertex. This allows us to completely fill the UV mapping space at the poles, giving us a grid-like UV map.

Also, set the number of segments to 64 to give our sphere more detail.

Now, we have a sphere with a grid-like UV map, however, it doesn't completely fill the UV mapping space. Click Ctrl+A to select everything, then click Edit | Expand | All nonuniformly:

tut_prim3.png

Your UV map should look like the one above.

Now, let's export it. Click File | Save As... and select the sculpted prim exporter:

tut_prim4.png

The exporter let's us export sculpted prims from 8x8 to 256x256, but, for this example, let's select 32x32.

Now, at the start of this tutorial, we explained that each colored pixel represents a vertex position. This means a 32x32 bitmap has 32*32 = 1024 vertices. Our sphere has 1986 vertices, so it has a sufficient amount of detail for this specific size. Generally, for best results, you should pick a bitmap size than is near your model's level of detail:

Bitmap Size Level Of Detail
8x8 64 vertices
16x16 256 vertices
32x32 1024 vertices
64x64 4096 vertices
128x128 16,384 vertices
256x256 65,536 vertices

For example, if you wanted to export a model that has 5000 vertices, then a 64x64 would be a good choice. Otherwise, your model may loose some detail when exported as a sculpted prim.

And here's what our exported 32x32 sculpted prim looks like (scaled up to see easier):

tut_prim5.png

If we import this back into Unwrap 3D Pro, we get:

tut_prim6.png

As you can see, our sphere model has retained most of its original detail. Even the poles still look good.

Lastly, how does the plugin export your model as a sculpted prim? Basically, the exporter uses a UV sampling method. So, as long as your UV map looks like a grid, it can export any type of model at any bitmap size! Hence, the more detailed your model is, the better results you will get.


Pixel Perfect Sculpties

Instead of a sphere, what if we wanted to export a box? Generally, sculpted prims are intended for creating organic shapes, which have smooth, curved surfaces. To export an object with sharp corners, we must pay special attention to how our vertices are being sampled. If a vertex doesn't lie exactly on a sampled UV point, then it won't get fully exported. Instead, we'll only get a rough approximation. But, thankfully, Unwrap 3D Pro has some useful tools to get pixel perfect sculpties.


Box Example

To demonstrate, let's export a box as a sculpted prim from Unwrap 3D Pro. From the main menu, Click Create | Box. Use the default parameters and click OK.

Now, we need to create a UV mapping that looks like a grid. One way to do this is with spherical or cylindrical UV mapping. Let's use cylindrical UV mapping. Click Ctl+A to select everything, then click 2D Tools | UV Mapping | Cylindrical. For the axis alignment, select y-axis, and uncheck the Capped and Apply scaling options. Click Apply:

tut_prim7.png

tut_prim8.png

At this point, your UV mapping should look like a grid, as shown above. Now, we need to make sure our UVs are pixel perfect for the bitmap size we are exporting. One way to do this is with the Snap UVs tool.

Now, this part needs a little explanation. Due to the way pole faces are treated by sculpted prims, the exporter samples every UV coordinate at 1/(width-1) and 1/(height-1). This is done to prevent the pole vertices from being thrown away. So, if we wanted to export to a 32x32 bitmap, we should snap our UV coordinates to 1/31 and 1/31. Now, click Ctrl+A to select everything and click 2D Tools | Snap UVs. Enter our values and click Apply:

tut_prim9.png

Now, export this box as a sculpted prim. Select 32x32 as bitmap size.

To see our results, import the exported sculpted prim back into Unwrap 3D Pro:

tut_prim10.png

If everything went well, you should have perfect sharp corners on all edges!

Final Note: Sometimes it's best to use Snap UVs on models with an uniform distribution of vertices, such as spheres, boxes, grids, or heightmaps, that roughly have the same level of detail as the bitmap size you intend to export. Otherwise, if two UV grid lines merge together, it may result in collapsed geometry.


Upload Test

This tutorial wouldn't be complete if we didn't try to upload something!

Here, we're going to upload a sculpted prim, which was exported from Ultimate Unwrap 3D Pro, to Second Life. We will use the SLImageUpload tool, as it presumably gives better results than uploading sculpted prims through the SL viewer. For this test, we will use a face model that has about 3000 vertices. We used a simple form of spherical UV mapping to map it:

tut_prim11.png

We exported it to a 128x128 sculpted prim. After uploading it using SL Image Upload, our texture was found in our SL inventory. Apparently, SL reduced our texture's size to 64x64, which will affect our results noticeably.

Here is our inworld results:

tut_prim12a.jpg
(click for a larger image)


We can see that detail around the eyes, nose, and mouth were reduced, but the general shape and form are still noticeable.

Now, even though our test only seems to enforce the fact that sculpted prims are more suitable for organic models than non-organic ones, be aware that detail lost in geometry can be helped by painting detail on the texture map instead. So, for example, we could paint detailed eyes, ears, and mouths on the texture map, instead of trying to put that detail into the geometry. To support this fact, if you look at our face model with the test pattern above, you can clearly see the numbers 0 to 9. This level of detail is only possible through painted texture maps.

Another suggestion, if you have a complex or detailed model, then it might be a good idea to break up it into several parts, instead of trying to export it as a single sculpted prim.

Well, it looks like I'm almost out of SL currency! If you have any other questions about sculpted prims, please let me know.