Transcription
So you have been working with sculpted prims for a while,
but still wonder why your methods sometimes work and sometimes fail ?
You wonder what is right and what is wrong about all of this ?
In this tutorial i want to let you look behind the curtains
and explain what a sculpt-map really is and how it works in detail
and what you actualy can do with sculpted prims
and what you can never do with them.
hello and welcome!
Let me show you the most basic sculpted prim first a simple plane surface.
This surface has 2 dimensions which we will call X, and Y.
And the surface is made out of rectangular faces.
These faces are also called quads.
This special surface here is actually made out of 32 faces along X, and 32 faces along Y.
Hence the total number of faces for this surface is 32 times 32 so it has 1024 faces.
A closer inspection shows that each face of this mesh is made out of 4 vertices and 4 edges.
Each 2 adjacent faces share one edge and 2 vertices.
This very specific arrangement is the most simple and
the most regular mesh that you can define on a surface.
As a matter of fact exactly this mesh topology is used by-all sculpted prims in the world.
And because the mesh topology is pre-defined
we only need to specify an enumerated list of points in 3D-space.
And because the mesh is strictly rectangular we can use
the vertex-row and the vertex-column as list indexes.
We will talk about the implications of this in a few moments.
As an example the bottom-left point could be addressed by the coordinates [0,0].
This means that it is located in the first row counting from bottom up,
and in the first column counting from left to right.
This enumeration is universal.
That means, as long as you keep the mesh topology intact,
you can rearrange the vertices as much as-you-like, and
You can bend and stretch the mesh within all 3 dimensions.
As long as the connecting edges are not changed and
as long as you do not add new vertices to the mesh
or remove existing vertices from it,
the object can always be transformed into a sculpted prim.
With other words:
the bottom left vertex of the original surface will always be vertex number [0,0].
Even if it has been moved to the top-right position of the mesh.
And this works as long as the edges are not removed.
And in very clear words:
When you cut or rearrange the edges,
then the object is no longer a sculpted prim!
Ok,
we have now learned that each mesh is made out of a set of adjacent faces
arranged in a number of rows and columns.
And we have seen that this mesh topology is universal for
all sculpted prims in the world.
The default sculpted prim contains 32 rows with 32 faces on each row.
And how the mesh is woven is strictly defined and stored in a separate map.
There is an unchangeable one to one relationship between the vertices
on the map and the vertices on the mesh.
It is convention that the horizontal axis on the map is named “U“,
and the vertical axis is named “V“.
The map itself is called “UV-map“.
While you can move the vertices around on the mesh to whichever location you like,
the UV-map always remains constant! So even if you change your mesh to a
true 3 dimensional surface the UV-map does not change.
And each vertex on the mesh can always be looked up on the UV-map.
Let us proceed now by creating a basic cylinder.
We simply bend the plane along a full circle of 360 degrees.
Now this is interesting:
after bending it the plane touches itself along one entire side.
In other words: some of the vertices share the exact same location.
And so we have introduced our first seam here.
Let us take a look at the UV-map:
Indeed we see that the entire leftmost column of vertices
and the corresponding rightmost column both match up.
We now can stitch the plane along the seam.
In principle this-is done by merging the vertices from the left-most side
with those from the right-most side of the UV-map.
In fact this removal of vertices does not change the UV-map significantly.
we only have forced the model to always use the same locations for the rightmost
column and the left-most column of the UV-map. And this is called a cylinder-stitching.
When we now select one single vertex along the seam we actually have selected
two separate entry-points within the UV-map.
In fact the color-representation (sculptmap, see below) of this mesh
does not change at all after we stitched the seam.
However when we transfer this mesh to our online world we have the
option to set the stitching type to Cylinder in accordance to the mesh-topology.
Let us go on with our cylinder now,
and let us bend it to the form of a torus like i show you here…
Well somehow we expected this to happen:
Now the topmost and bottommost row match up on the model
and can be stitched just like we did for the cylinder a few moments ago.
And by now the torus is ready to use.
And we also must not forget to set the stitching type to “Torus”
after importing it to OpenSim (or your preferred online world).
Let us go back to our Cylinder and let us close the top and bottom
by collapsing the top row and the bottom row of vertices into single poles.
Then let us deform it to a spherical shape and finally the sculptie-sphere is created.
Until here i have introduced the basics of sculpted prims.
Starting with a simple surface i have shown you:
- how you can derive a cylinder, a torus and a sphere.
- I also have shown you that the basic layout of the mesh
namely the UV-map remains the same for all sculpted prims in the world,
regardless of their shape.
Now you may ask yourself:
“How can the UV-map be constant and still contain the mesh-data of my sculpties ?
Apparently the mesh differs from object to object.
So where in the UV-map can i find the location information
for all the faces of my object ?”
The answer is simple: The UV-map does not contain this information.
The data is stored in another construct, namely the sculpt-map.
And that is simply a 2 dimensional image.
So when we look in more detail to our UV-map, then we see that it is indeed associated to an image.
And currently this image is entirely black. We will store the location of each vertex of the mesh
into exactly one corresponding pixel of the sculptmap.
The exact mapping between vertices on the mesh and pixels on the sculptmap is defined by the UV map.
In Blender we can create the sculpt-map by using the Primstar baker which generates the pixel data for us.
I will explain in the next tutorial how a vertex location corresponds to the pixel color.
But for now we only need to remember that each vertex on the mesh is stored in one pixel on the image.
Now look at the image size.
We see 64 pixels in x,
and 64 pixels in y. Why that ?
We only have to provide 33* 33 pixels to store the mesh.
So in principle we can provide an image of that size and we are done.
But the height and the width of any sculpt-map must be in the set of power of 2 numbers.
We only can use either, 8,16,32,64,128,256, or 512 pixels per side.
Any other size is not supported and it will be scaled to the nearest accepted power-of-two-number.
So the smallest possible image size we can use to store 33 *33 vertex-locations
is a 64 * 64 pixel image.
And this implies, that we only use 1089 of the provided 4096 pixels to store our sculpt-map.
It is clearly defined where the important pixels-are placed on the map.
They are located on each secnd row and on each secnd column
counting from the bottom-left edge of the image.
All pixels wich i have colorized in black are not used for this particular map.
You see that only one out of 4 pixels is actually used.
The entire rest of the map is wasted space.
Note that this pattern-is broken at the top-most row and on the right-most column.
That is where the 33rd pixelrow and pixelcolumn are stored.
And finally you should always remember that the number of vertices provided for a particular UV-map
is constant and can not be changed.
Hence a sculptmap of size 64 * 64 pixels stores exactly 1089 vertices,
which translates to 1024 faces.
And every map must provide the vertex data in exactly the marked pixels.
And even if the map has enough place to store 3007 more vertices within
the black parts of the map, that does not work with sculpted prims
because the pixels which are marked in black are never used.
Sculpted prims are not limited to square meshes and square UV-maps.
You can use any combination of power-of-two values for U-faces and V-Faces,
as long as
U-faces * V-faces
Also you may not have less than 4 faces on each side of the mesh.
You can calculate the pixel size of a sculptmap by taking the product of faces in width and height times 4:
PixelCount = UFaces * VFaces * 4
This is not always true but it works for most ratios.
You can have extreme meshes up to the size of 4 * 256 faces.
And the smallest supported sculptmap-size is an image with 4 * 4 faces.
From what we learned a minute ago the sculptmap of this object
has a size of 8 times 8 pixels. That is a perfectly valid sculpted prim
and it can be uploaded to Secnd life without problems as long as you use
any version of the Viewer-2.
I am now at the end of this tutorial.
- We have introduced the UV-map and the Sculpt-map
- and how these maps relate to meshes and sculpted prims.
Next time we will continue with a working example and show
how the principles of sculpted prims can be used in practice.
See you later!
Further sources of Information:
Here are 3 excellent schat groups about Blender in SL:
- Blender Jass/Primstar (our official group. Many good and responsive sculpters)
- Blender Users
- Blender
I am booked to all of them.
All the best wishes!
Gaia |