Monday, October 29, 2012

Rethink your Sculpts for Mesh


First, let's go over the procedure for using sculpts you have made in Sculpt Studio.  For those of you not familiar with Sculpt Studio, this is Mesh Studio's inworld sculpting sister product.  Follow this link for more information.

In the latest Sculpt Studio version (set a new mat out if you haven't lately, this is how you update), is the "SS 2 MS - Dropbox".

In order to use a sculpt from Sculpt Studio, a copy of it must be on the server.  This means you must have just made the sculpt.  If you want to use a sculpt that is no longer on the server, you will need the notecard data for that sculpt and place it's -SCULPT card in the mat, rerez it and use the Sculpt Frame to generate a new sculpt.  This places it on the server again.  Sculpts are only on the server for approximately 24 hours after being generated.


  1. Before you generate the sculpt through the Sculpt Frame, name the sculpt with the name button and then use the Sculptie! button to make the sculpt.  If this is a new sculpt, download the ZIP from your server page (this contains all files for your sculpt) and upload one of the sculpt tga maps.  If this is a regeneration to use a sculpt you made before that is no longer on the server, you don't need to download anything if the sculpt map is already inworld.  
  2. KEY INFO: It is critical that the name of the sculpt on the server be the same name you use on the sculpt map; the names MUST match.  The names will be used by the drop box to match up.
  3. Rez your SS 2 MS - Dropbox.
  4. Make sure your sculpt map is full perm in your Inventory.
  5. Ctrl drag a copy of the sculpt map, from your Inventory, to the contents of the dropbox (alternately, open the dropbox in edit and place a copy directly in the contents).
  6. The map has been used to register and "mesh-ize"it.  This means the original in your Inventory is registered.  Mesh Studio will now recognize it.  Any sculpt you make from it, by putting the sculpt map on a Sculpt Type prim, can be used alone or along with prims in a linkset to genereate mesh with your Mesh Studio.

Recommendation: In the description field of your sculpt map, add Mesh Studio, so that you know this is a sculpt that can be used for mesh generation in Mesh Studio.  A folder for these "mesh'ized" items is not a bad idea either.  Do this to any sculpt made with this map so that you know it can be used with Mesh Studio.


SOME THINGS TO KNOW ABOUT MESH-IZED SCULPTS

  • Mesh Studio always loads sculpts at their highest LoD (comparable to resolution 4/24 in Mesh Studio) regardless of what settings you use on the Mesh Studio menu. This is because the Mesh Studio script can only affect prims and not sculpts.
  • Poles, in these mesh-ized sculpts, will merge to a single point (also known as verts or vertices).  BTW, textures on these triangular ends (produced by the poles) will texture fine and not have the same radiating texture problems we have with sculpts.
  • Wherever points are in the exact same position (example, double points, slices copied to the same position), these points merge into one single point.
  • We do not have to reinforce points in mesh to strengthen LoD.

What was that last point?  We don't have to reinforce for mesh?

If you've been reading my articles, you have seen that we control LoD in mesh by either letting SL generate the lower LoD meshes, or better yet, we create them for exact control of the shape that each level degrades to as you cam away.

So what does this mean for sculpts?

You can:

  • use as much or as little of the sculpt mesh as you want for your shapes.
  • use separations in a sculpt.   If you will only be working inworld, separations between parts in the sculpt are done with poles as usual, but you only need one per separation; not two as in sculpts.  (ex. Table with legs: each closing end of the table top, each closing end, top and bottom of each leg all require only one pole for use in mesh.)  The poles will merge and give you clean separations on your mesh (one pole per each end on a separation).  If you use a 3D program such as Blender, you can remove the merged poles if you want to do anything different.
  • use Cylinder stitch if you want the ends of your sculpt open.  As noted above, you will need poles to make physical separations so cannot have more than two open ends.

Here is an example of two sculpts done similarly (because I made a slight error on one and joined slices in the center that I didn't intend).  In figure 1, you can see the slices as they were setup for the second example I made.  The first example had slices evenly distributed and only the poles and slices were copy/pasted together producing the separations.  You can see the result, where I imported the dae into Blender, in figure 3.  You can also see that the openings made by using Cylinder stitch produced no mesh in the Blender examples.  There is a separation where there was a pole on each separating end and where there was one pole on top of a slice, and no pole on the next section (very bottom of object), the pole simply merged and closed the bottom and continues on to the next slice in a taper.


fig. 1

fig. 2

fig. 3

fig.4
In figure 2, you can see more clearly what the SS 2 MS dropbox (found in your Sculpt Studio accessories box) looks like.  You can also see each of the two sculpts I made.  If you look carefully, you can see the sculpt on the right has a slightly different look to the texture because of all the slices copy pasted on top of each other.  So in figure 4, that second sculpt is shown and there are 226 verts on the mesh because so many slices were pasted on top of each other.  All the points on top of each other merged into one.  The result is a less dense mesh with far fewer triangles.

One thing you can do if you are closing at least one end of a sculpt, for MS, is to, say, use a 128 slice stack because you wanted 8 points in each row.  You make your sculpt with the minimum of slices and then take all remaining, make them poles and put them in the same position as your last slice.  Remember all poles merge, so all poles on top of each other will merge, too.  Then you have a low poly sculpt that will be low poly mesh.

If you wanted the two ends of your sculpt open, you can collapse (copy/paste) the slices together one each end with no poles, set to cylinder stitch on the frame, and it will leave the ends open and MS will use that to indicate that no mesh should be created on the ends.

There is much more to explore, but this should give you some things to think about and play with.

Happy Meshing!
~ele

Thursday, October 25, 2012

Thinking Outside of the Box: Let's get Physical


So many people have been begging for information on Physics that I'm posting the text first and will add graphics to illustrate the examples and such as I am able.

The outside of the lowly prim Box can be your best friend when it comes to physics meshes.  Min Barzane and I spent a good bit of time, a while ago, talking about and figuring out things about physics.  The conclusion we came to is you should:
  • simplify the physics shape as much as you can
  • concern yourself primarily with the actual collision surfaces: walkable surfaces, wall surfaces you don't pass through
  • use boxes, where only one face is visible, to create your physics meshes when needed.  This, in essence, creates a plane and a single plane generates two tris.  We will refer to boxes with only one face as a plane from here on in.
  • remember that you do not have to have perfectly aligned pieces when making your physics shape.  You always want to test your shapes (try Aditi where the Lindens give you money that can be used in this test grid and not come out of your own pocket) to make sure you can walk well on and not walk through any gaps.
Creating a plane with which to work.
  1. Create a box prim.
  2. Go into Edit on it and set the box's transparency to 100%.
  3. If you have trouble locating your faces, use Ctrl-Alt-T which will show all transparencies in red.
  4. To give you a more workable plane, select one of the side faces of the box to make opaque by zeroing the transparency.
  5. Depending on which side you chose, you will be able to taper the plane on X or Y.  You can also shear on X or Y.  This gives you more flexibility for fitting areas as you make your physics shape.





Whether you are making a house, a staircase, a doorway, or a chair, it is the actual surfaces that require collision that matter.  Let's look at some examples:

A wall with windows and a doorway.  Unless you intend to have people walk through your windows, you can treat them as part of the wall (meaning they don't need a hole in the physics mesh).  Use common sense.  If the walls aren't very thick, you may only need to collide with the inner wall.  If you do need to collide with both sides of the walls, only do surfaces for the walls and not the sides of the prims making up the walls.

You want to walk through a doorway, so you devise your "planes" to allow the entry way.  If the doorway is on a wall, make the prims 100% transparent and use Ctrl-Alt-R to see the transparent areas in red.  Use "Select Face, on the SL Edit window, and select the wall surfaces and set the transparency to 0% to make those wall surfaces opaque.  On the door way, you want the wall surfaces, but don't need to make the inner surfaces of the doorway opaque; the walls provide the perimeter of the area you walk through.

If you are creating a pre-hung door for sale (consists of 5 parts: the two side uprights known as the jambs, the top piece called the jamb header, the bottom threshold piece and the door), you can do the same, and make all the edge pieces 100% transparent.  Just the door?  The same holds true.  Check out the blog post on doing pivots for your doors.

Floors.  The box will be used for square floors.  The sides and bottom of the boxes are not walked on and are thus made 100% transparent.  With round floors you have to take care as you want to use the full cylinder.  Minimizing the sides on a cylinder could result in pockets where someone could fall through, so you really want to experiment and see if you can get away with any minimization.  How do you minimize?  The settings on the Mesh Studio Menu.  A setting of Low Poly on a cylinder creates 8 edges.  You can use that as a starting point and then use Circle + 1 or Circle -1 to add or lower the number of edges on your cylinder's circle till you have a walkable floor for your particular "floor plan".

A round balcony.  The inner part of the balcony needs to keep the user from going through it, but it does not need to be completely round to be effective.  Use your planes to define the arc of the balcony railing with as few box planes as possible.

Railings.  A railing is a good example of how much or how little of the mesh needs to be involved in the physics shape.  The collision surface is merely to keep the user from falling off the side of the steps where your railing is positioned.  Any single surface side will provide this, whether it is the top of the hand rail, its side, or the side made up by the balusters (again, treat it as if you're shoddily covering them up with planks since the physics mesh does not need to be perfect).

A roof on a house.  If you think your users will walk on your roof or fly through it, then by all means choose the inner or outer surface of your roof to supply collision.  If the roof extends past the boundary of the house, it is not necessary to match the dimensions.

Staircases.  Steps can be handled with one long or several short ramp planes depending on the direction and formation of the steps (like a spiral staircase).  

Chairs, benches and other seats.  The only important collision surface on a chair may be where the avatar actually sits.  First, this may be enough to define the area of the chair itself and second, it may be an effective way to handle the avvie being able to sit on the chair without the assistance of an animation.

These are just some examples to get you thinking.  So what else do you need to know?  When the physics shape is ultra simple you can sometimes get away with having to do little else than loading your LoD daes in the Level of Detail tab and the Physics dae file in the Physics tab of the SL Mesh Uploader window.

Aditi, aditi, aditi.  Experiment your heart out on on the Linden's dime.  Make sure your physics work right and THEN take it live to Agni (the main grid we're all on).

Until any of the  TPVs (Third Party Viewers) get the full Havoc license, only the LL Viewer has it, so you should definitely use it to upload any mesh particularly with physics.  I have had people tell me they successfully upload with their TPV and all I can say is after the first time mine failed me (a doorway that couldn't be entered), I chose not to lose money again by sticking to the LL Viewer.  Feel free to try the odds if you like.  The Lindens will love you for it.

Once you upload your mesh, don't forget to set your mesh to Prim in the Edit window's Features tab.  This is the one thing that almost everyone forgets sooner or later and wail their physics aren't working.

If it still isn't working the way it should, here are some videos that explain the decomposition  method:



Plus some other reference pages to help you out:

What is Decomposition?
http://wiki.secondlife.com/wiki/Mesh/Decomposing_a_mesh_for_physics_shape

Making Mesh Physics for SL:



Recently the Lindens updated the Physics Optimization wiki page.  Some good info here:

https://sites.google.com/site/tamaproducts/home/mesh-studio

So I hope this helps you understand this topic a bit better.  As always, please let me now how you like the articles and if you would like to see certain things covered.  More to come as always.

Happy Meshing!
~ele

KWIKTIP #1: Transparency vs. Transparent texture

KWIKTIP

When you don't want prim faces to generate mesh, you go into edit on the prim and in the Textures tab, set whichever faces you don't want meshed to 100% transparent.

Recently, there have been a couple of MS users who have used textures that are 100% transparent instead. The problem with this is that the texture setting remains zeroed and the script is tied to the transparency setting of 100% as the indicator to ignore a prim face so that it doesn't make mesh from it.  Textures are UUID based, so using one on a prim face only tells the MS script there is a texture on it.

Why is this important?  If the face has a texture that is transparent, it will:
  • become visible when a texture with opacity is applied
  • generate mesh which can contribute to LI
  • possibly become an obstacle if you set the mesh to convex hull or set to physical
  • possibly impede accessing a nano mesh if the faces surround the nano
  • add a Prim Face material to your linkset

The steps to "TRI" for nanos


To make a nano mesh with Mesh Studio, you can use this method to trick SL into thinking the mesh you want to nano is larger than it is in reality by using single or double triangles.  There are a few things to consider for nanos.  These three steps create a single "tri" (triangle) from a prim box.



  1. Create a box and color one face red (or other color).  Remember that when you create a box, the top and bottom of the box is what can be tapered, which is good because the next step is...
  2. Taper the top of the box on X or Y to the full extent (1.0).
  3. Now make all the faces 100% transparent except the red, triangular face.  Since fully transparent faces generate no mesh, you are now left with something that will give you a single triangle.  
You can use this for many things, but for today, we are using it to trick SL as mentioned above.  Here are some things to consider:
  • We can create a Prim Face material by coloring one or more faces with a texture or tint.
  • We can apply full transparency to this Prim Face material once the object is made mesh, if we so desire.
  • The smallest an object can scale to is 0.01 on any given axis.
So what if I have a sphere that I want to use as a pearl or a gem, as a simple example, and I want this to be smaller than 0.01?

Let's call this example sphere the target or target nano piece.

A single tri will tell SL the size of two axes for height and depth or height and width or width and depth.  If all you need to do is regulate two axes, then the tri is your solution.  Put the target prim, you want as the nano, at the center of the triangle (remember these prims don't have to be tiny to begin with since we can scale them down).


Center the target prim on the triangle?  Kinda hard to get centers without some math here, you know.  

Yeah, which is why I always work on grid so the centers of the objects I work with are on whole numbers (25 instead of 25.8738).  It's easier to subtract or add to a whole number (helps if the prims are not odd sizes, too).  This is the recommended way for all builders to work.  Makes life a whole lot easier.  Don't know how?  Watch this classic video by Torley Linden:


If you need to be able to scale on all three axes, then you can:
  1.  use a box with a double taper (1.0 on X and Y)
  2.  make all the faces transparent except one on the left and one on the right.  

  • The height of the tapered prim will give the Z height.  
  • The length of the red triangle base will give the Y length and 
  • the distance between the red triangles will give the X width (if the triangles happen to be on the opposing side than my example, it is not a problem; this is just explaining that the size all three axes are being described through this double-faced triangular setup).  
  • Centering the target prim on this setup is easier since you just use the XYZ position of the tapered box
  • If you need to be able to size more on one or two axes, increase the size of the tapered prim on height or width or length or a combination of any two.
  • While you would normally use the  Stretch both button on the Edit menu, you may want to experiment with it off if you need to affect one side of the target more than the other.  This means the target would be off-center within the tapered prim (can be done with the single tri as well).


Why go to all the trouble of making a tri or two when you could just use a box?
  • a full box is 6 sided.  Each side generates at least two tris.  This means 12 tris for a box.
  • if your nano is fully enclosed, you can't reach it to texture.  Making the box material alpha doesn't mean you can easily reach in to the inner nano'd piece.
  • a single tri can be used at any angle or rotation; even if you use two singles together, they are still independent of each other at the prim level.  The double taper that creates two tris, leaves an opening to your target nano (transparent faces prior to generation, don't create mesh), but remain interdependent to each other being part of a single box prim in the build stage.
  • if you are working with a comlex linkset for which you are doing the custom LoDs, the fewer tris in the lowest levels, the better, has been my experience, to keep down the LI.
  • keep in mind that anything I say to you in my blog has been from what I have learned and what has been my experience.  No hard and fast rules, just suggestions from what little I know.  :)
Once you have set up either the single or double tri with your target prim, make sure the target prim is the root.  As always, name your linksets and drop in the Object2JoinedMesh script.  In this case, I used just the Low LoD setting in the MS menu and used it for the top three LoD levels and dropped the last two zero.

The result:


Once uploaded, you can make the triangular faces alpha.  I used a single prim for the demonstration; you can place a full necklace or other linkset in place of the sphere used here.  For mesh, really, you nomally would be making linksets that may have to come down in size.  If you have an object that sizes well on all but one axis, the single tri is a good thing to use.


Want a gem-like cut to your sphere?



I used the Low LoD setting, on the MS menu, which produces fewer triangles on the sphere.  The one on the left, above, used a Crease Angle of 10.000 in the uploader window (see image below).  This sharpened the edges on the lower polygon sphere I called for in MS.  The sphere you see on the right side is the same sphere with the default crease angle of 75.

To enable Crease Angle, you must checkmark Generate Normals.
What is the Crease Angle?

There's a good wiki page on various ways of testing the functionality of Mesh and gives an overview of much of what you find in the uploader window.  It's an older page; you can tell because the Uploader window you see on the page is different than the one you open in your present viewer.  Still, it has some good info.

Under Crease Angle, we have the following:

The Crease Angle adjusts the smoothness of the model.
  • Change the Crease Angle to 0 or 1.
  • Hit Enter in the text entry box
  • Verify nearly every polygon on the face should be apparent. In this case there is no smoothing - the normal of the face is used at all vertices producing a faceted look with a crease or hard edge between faces.
  • Change the Crease Angle to 180
  • Verify that the model now has smooth shading, no creases.
  • Confirm the bounds for entry are 0.000 to 180.00. Entering a value higher or lower will default back to boundary. Ex. entering 5000 will default to 180.00. Entering -20 will default to 0.000.
  • Confirm non-numeric characters cannot be entered for crease angle.
  • Confirm entering a blank value uses the previous value entered.
  • Confirm setting values for this field works for large and small models


You can see the model in the preview window and use the same commands for move, rotate and scale as you do for your camera controls.  When you work with the Crease Angle, watch your object in the preview and you'll see how the angles sharpen or smooth as you change the numbers.  A box has six sides that are all 90 degrees.  So on a box a crease angle of 89 will sharpen all of them.  The sphere will need a decrease in angle depending on how many faces on it.

I hope you found this helpful.  Please leave comments or questions.

Happy Meshing!
~ele

The Pivotal Point of this Message

This is the first in a series of posts on physics with your Mesh Studio.  In this particular example, we will also cover creating a pivot point on a door.  As I worked on this, I realized it really was almost identical in content to a tutorial made by Ashasekayi Ra for Blender.  For those that work in Blender as well, I highly recommend Asha's great tutorials.  The main difference in mine will be how you can create a pivot point using Mesh Studio.

First, I've set up my prims for the door utilizing a full box and four more boxes that are hollowed for the decorative trim.  Presently, I have everything left unlinked because I need to set up a center at the hinge end to the left of the door.


For this, I can easily do it by utilizing a setting in the Edit Menu called Copy Selection.  With the main, large prim of the door selected, I touch the hinge end of the prim and it creates a copy of the prim perfectly aligned to the original.

Copy Selection is a function you should really play with as it not only copies single prims, but will also duplicate linksets, sculpts and meshes.  This includes the textures.
I've added a red tint to the newly created prim.  I am making this a Prim Face material so I can make it transparent once I've uploaded it.


Always try to make faces, you don't want to generate mesh, 100% transparent to lower the number of tris in your build on upload.  For the prim we are using to define the new pivot center, we only really need the top face of the box as it will both tell the uploader what the overall width of the door is (faking it out) and the depth (which is identical to the main door prim as my choice).  At this point, I can link everything with the main, large door prim as my root.  I add the Object2JoinedMesh script to the root.


I use this setup to create the highest LoD by choosing the default setting of 4/24 on the MS menu.  Make sure you name the root.  It's just easier to identify things when named.  Now I will make a version for the Medium LoD level with just the menu.  This time I set to Low Poly after I renamed the root to identify it as the Medium LoD.  Next, I'll make some modifications to create and use for the lower LoDs.  The easiest thing is to remove detail, in this case, that is the hollowed boxes.  When I create the DAE file, I use the Low LoD setting as this will take it down to 2/8.  What this does, is create the minimum amount of tris per face.  Each prim face generates 2 tries.  (Example, a box has 6 sides, so that is 12 tris).


Last I now turn to making the physics shape.  Hopefully you noticed that the red face we made was included in all the LoD levels I've made.  It MUST also be included in the physics shape.  However, with physics, the key is to leave only the necessary collision surfaces.  We know we need to keep that red face for the pivot to work.  I think I only need the front and back faces on the remaining door prim, so I make all the others transparent.  This leaves me with only 3 faces or 6 tris.  Very good, indeed!


On upload, I use the the high version, the medium and set the low version in both the Low LoD and Lowest LoD.  Then in the physics tab, I load from file and use this last version I made.  When I calculate, I see that I have
  • Server cost: 0.750000
  • Streaming cost: 0.403195
  • Physics cost: 0.360000
Sweet!

When I upload  and rez the door, I use Select Face in the Edit Menu and to select the single top face material to 100% transparent.  I also go into the Features tab on the mesh and set it to Prim (important to do this).  This is what allows me to walk through the area on the left of the door, but not through the closed door.  


One thing to note: If you upload a mesh that does not have physics assigned through the dae, it seems only the convex hull and none choices appear. When the mesh has physics assigned through the dae, all three appear. If you link your non-physics mesh to a prim, all three appear. If you link a prim to your non-physics mesh, only convex hull and prim are available.

And now when you rotate the door, you'll see it rotates on it's hinged edge as expected.

Something to keep in mind. The piece you create to enlarge the bounding box and set the pivot point can be made even smaller than I've shown. This piece is mesh even if set to transparent. So it will block someone from moving through it. I didn't worry about the size because I placed it at the top and it is only one face (2 tris) and I would expect this to end up within a wall. It could have easily been put at the bottom to end up on the floor. So just remember this when designing the piece you use and where best to put it.

Happy Meshing!
~ele

Tip: Use a Pre-alignment on textures for more freedom


Sometimes when you make something, you may not know what textures you want to use right away.  Or you may want to change them later.  We know that in Mesh Studio, if we texture beforehand, we set the repeats and offsets.  Here's a way to give you a bit of flexibility.

I built a wall with a door and a window.


The yellow shows the box shapes I used to make it.  I next used a texture alignment pattern.  Now you can do this by hand, but I use Skidz Primz' TNT.  With this I aligned the prims.  I used the texture function to align all the textures.  It does a very nice job.  As with any tool in SL, it can have its problems, but overall does a remarkable job without ever using the SL Edit window.

I added a tint to the prims that make the doorway and window inset.
By using this alignment texture, my goal was to even out all the prim texture repeats and offsets so everything would match up.  My goal is to then have a mesh that will be able to accept a texture that I can repeat and offset in SL for varied needs and it would work across all the prims with the same Prim Face material.

What you see here is only the surfaces that will be the interior wall plus the surface you step on as you go through the door.
A note on Physics:  I removed all the back faces on my wall.  I removed the prims for the doorway, except the bottom one which would be stepped on to enter the doorway and then only made that top face visible.  I removed the prims that made up the window and the surrounding prims and extended the one above the window, so that it reached the floor (I don't feel you need to walk through windows).  This left only the actual collision prims I needed and cut down the number of triangles, when I uploaded, to eight.  So I did my LoDs the way I've presented in past posts and used the physics dae for the Physics tab and the wall came in at 3 LI.  Set to prim, you could walk through the door.

Repeats set to one on the left hand mesh; set to 2 horizontal on the right.
Repeats set to one on left; horizontal repeats at two on right (Cottage rosewood wallpaper by Robin Sojourner).
Repeats at one on left; 4 horizontal/2 vertical on right (Tiles by Nicole Stiles).

This should always be tested and planned out ahead of time, but can give you much more freedom in your designing with the ability to choose more textures since they should all line up nicely.

Happy Meshing!
~ele

I'm a Material girl!


In Second Life, the primary building component is the prim.  These are a set of primitive shapes that can be created through the SL Edit window and put together to build cities, hair, clothing, animated creatures, statues and more.  They can be cut a number of ways and when we taper, shear and apply other types of deformations, this has come to be known as Prim Torture.

If you go into edit on a prim and choose "Select Face", you can isolate one of the surfaces on a prim and texture it independently from the rest of the faces on the prim.  You can shift-left click additional faces to make a grouping that can be textured at the same time.

There are two ways to generate mesh with Mesh Studio.  One is to use the "Object-2-Mesh-MS-Node" script in the root of you linkset.  This basically treats each prim as a separate prim.  When you upload this mesh's Collada .dae file, the meshes are linked and can, therefore, be separated either with "Edit this link" in edit, or you can completely unlink one or more of the links.  The advantage is that you retain the texturability of each prim's faces as if you were texturing prims in Second Life.  Of course, they are mesh at that point, so you lose the ability to do any further cuts or torture.  The downside can sometimes be that the LI can be higher than using the second script included in Mesh Studio.

The second way to generate mesh is with the "Object-2-Joined-Mesh-MS-Node"script.  This treats the linkset as one, inseparable mesh object, similar to sculpts, with only one surface.


However, we have the ability to create more than one texturable section on this single surface.  One way we do it is by putting a color tint on the face of a prim in our prim linkset.


Here I have tinted several faces with red and blue.  Even if the colors are on different prims, as long as they are the same tint, they will all be chosen as if they are a single area to texture or tint when you use "Select Face" on the SL Edit menu.


You can designate up to 8 tint colors total.  The joined script will notate them as "Prim Faces" in the hovertext.  It is also a good idea to use this hovertext as an indicator as it will tell you if you have ended up with more than eight Prim Faces.

There is one other way to make your Prim Faces and that is with the use of textures.


Take a look at the above image.  On the left, I have one area left as white, creating our first Prim Face.  The bird's eye maple creates Prim Face 2.  The reddish wood creates Prim Face 3.  The combination of Burr Maple with Tiger Oak Trin on the lectern's flat face is now Prim Face 4.  I used the textures to get the texture and offsets I needed to make the texture look as I wanted (read the post on texturing the prims to texture the mesh from an earlier entry).  I can still put other textures on these areas, after I make the mesh, but they will have the same repeats and offsets that were used when I initially prepared the prim linkset.  The white area, I've left, will accept both textures and/or tints.  Any tints you add, on top of textures, would colorize that whole Prim Face material area on the generated mesh.

Now examine the linkset on the right of the above image.  This is the same linkset, but I have added some color tints on some of the faces.  These faces all have the bird's eye maple, but some of the faces have blue (making Prim Face 5), pink (making Prim Face 6), and red (making Face Prim 7).  Finally, which may be hard to make out on the small image, I added green to the top of the back slats.


Here, above, you see the final result.  I used the textures where I had the blue, pink and red tints and added tints more in keeping with the textures on my build.  You may have to click on the image for a larger version to see that I added a tint plus low shine and the siding bump to create a pattern on the prim faces that had been left white.

The texture, btw, with the border on the lectern large face, is the 4-in-one texture I used in the previous texturing tutorial.  If you create your Prim Face materials (of which you can do eight) and then also use 4-in-one textures, you can really extend how many textures you can use on a single joined mesh.

So the ways to mark your linkset to create Prim Faces (sometimes called just Faces, Materials or Material Faces or Prim Face Material) is to use:
  • either a tint color or a texture (or both as explained below).
  • the SL Edit menu choices of Blank or Plywood.  White would constitute one Prim Face (essentially being a tint) and Plywood would constitute a second (essentially being a texture).
  •  texture or tint, alone (which would each create a Prim Face material).
  • a texture with a tint (which would create a Prim Face material, and be in addition, if the texture is used alone or with an entirely different tint on the same mesh).
Once you have created your mesh, you would use:
  • he SL Edit menu, with "Select Face" enabled to select all faces within a Prim Face material (example: texture was used with and without tint; each is its own Prim Face material so even if they share the same texture, there are two separate areas to choose since you could also conceivably put two separate textures on each Prim Face material).  This selects the entire area that was designated as one Prim Face material when you prepared your prim linkset.  All areas, even if on different parts of the mesh, are selected when one part of that Prim Face material is selected with "Select Face".
  • experiment with shine, glow, transparency and bumps from the SL Edit menu in conjunction with your textures and tints.  Each Prim Face material can have it's own texture, tint, shine, glow, transparency and bump.
I hope you will find this useful as you continue to explore the world of mesh with your Mesh Studio.

Happy Meshing!
~ele

Optical Optimization Options


Once you have the hang of making your linksets to create and texture your meshes with Mesh Studio, the next important thing to conquer is the almighty LI (land impact) and equally strengthen the LoDs by controlling how they degrade with custom LoDs.  Remember, LoD is level of detail that you see as you move away from the objects with your camera in Second Life.  You see less and less detail, optically, just as in real life, the further you are from something.

First line of defense is your Mesh Studio menu when generating your mesh.  Here is one tactic I use.


ONE.
I create my linkset and leave the default settings for use as the High LoD level.

TWO.
For the Medium LoD level, I select the Low Poly setting on the MS menu.

THREE.
Low LoD level can use the Low LoD setting on the MS menu.

FOUR.
For the Lowest LoD level, you can do one of two things.  Use Use LoD Above or set the Triangle Limit on the level to 0 (zero).  

FIVE.
Calculate with the Use LoD Above setting and then again with the Triangle Limit set to 0 (zero).  Check to see which gives you the lower LI and decide which you want to use.

The second line of defense is to create the lower LoD levels by modifying your linkset.  The above workflow will work in many cases.  I recommend trying it to have values to compare to this second method of working.

The first thing to remember is that you are simplifying your forms but trying to retain the general silhouette of your linkset.  Let's use my lampost as an example.

This lamp is 22 prims: spheres, cylinders, boxes.
Since the center is a single tapered cylinder, let's focus on the top and bottom parts of the lamp.


In addition to the prims that make up the top of the lamp, I have created two sets of colored prims by tinting the faces of some of the plywood prims.  One I will use for the glass casing around the lampflame and another for the metal encasing what will be textured as glass.  The rest of the prims are all in plywood and this constitutes another material for a total of three.  In 3D programs, these material faces are set up by selecting faces on the mesh and assigning materials; in Mesh Studio, we select faces on the prims and tint them with all faces having the same tint belonging to the same material.

Second Life chose not to change their Edit menu, so to access these materials on the uploaded mesh, we use Select Face.  Doing this on any face that was within one tinted group of faces selects all faces in the group even if they are on opposite ends of the mesh (think of having candles in a candelabra and all the candles have one material; selecting and texturing one candle, textures all the candles at the same time).

The bottom of the lamp is a series of cylinders and a cut sphere.
This linkset had the Object2JoinedMesh script added and the default settings were used to generate the High LoD level.  Remember to name your root prim.

I made a copy of this lamp linkset and renamed it to reflect I would use it for the Middle LoD level.  Now it's time to examine the prims and see what you can do to simplify, but keep the general shape of the lamp.


It is very important, if you have made materials, to make sure that there is at least one face left on a prim that bears the tint used for a material face, so in this case that would be the plywood (which would be abundant) and the blue and green.  On the left is the original and on the far right, you can see the prims I removed (they need to be unlinked so they are no longer part of the linkset) and then the remaining prims modified to adjust for the removal of these prims.


It's a bit of experimentation to find what works and/or what is acceptable.  Remember these will be seen from further away.  You can see what I removed from the bottom and how I adjusted the prims, but I could have chosen to try it differently.

On the next copy I make, I name the root for the Low LoD level for which it will be used.  I have removed more prims and begin simplifying to full tapered boxes, but always seek to maintain the general shape that will be seen as your camera moves further away.

Since this is an LoD which is implemented at a much further distance, I am not concerned with small spaces between prims, you really won't see it.
Again, simpler forms.  As long as they have a visual feel for the shape, it will read fine at distance.
Note: The LoD will push on the shape of the prim to its largest mass, so it can be tricky to make shapes match the more delicate they are.  Case in point is the final version of the lamp as follows...

I changed the central cylinder on the lampost to a tapered box (right hand prims in image).  Notice how the tapered box looks thinner than the cylinder.  In trying this out, thicker versions, with the box shape, spread out in mass more than what could be seen with the cylinder, thus making the change visibly too different to the eye.  This thinness kept a more loyal silhouette to the original lamp and that is the goal.


For this final LoD, I was trying to trim a much fat as possible (i.e.prims/faces).  Look carefully on the right hand side final version and you'll see there is still one part of the blue material face prims left (bottom of the green prim) to make sure that the number of faces are maintained throughout.


So each of these versions, the original and the three simplified versions is used to do the four DAE files that are used in the four LoD levels in the SL Uploader window.  I set physics to lowest.  When this lamp was uploaded to Second Life, it came in at 4 LI from 22 prims and very strong LoD.


Hopefully this gives you some information to start bringing in your meshes with lower LI and better LoD.

Happy Meshing!
~ele

Break it down to shed some light!


When approaching anything you want to build, you can use the same methods employed by 2D and 3D artists alike.  All things complex can be broken down into simple forms.

If you look at a lightbulb, you can do a sphere for bulb.  While it often curves into a more cylindrical shape at it's bottom, we could take liberties and just use a short tapered cylinder going into a smaller, but longer tapered cylinder which is the metal part from which the glass protrudes.  It can be rounded on the bottom, so a small, thinned-out half sphere can work.  For the threads, the torus, when used with radius and revolutions, can give us something akin to what we seek.



For this example, I don't want to mess with alphas.  In SL, it's not absolutely critical.  You could create a material face so the bulb part could change to a whitish yellow when lit and it gives a very nice effect, especially with glow and light.

We now have a bulb composed of 5 prim parts.  I made any parts that are not going to be seen set to 100% Transparency.  I used two textures out of this glass and metal 4-in-1 texture image to texture the bulb as explained in my previous post.


Using the Object2JoinedMesh script, I generated the bulb mesh with defaults and it was 1.9 LI.  I decided to try and make the lower LoDs with the menu settings.  I generated the mesh again, this time setting to the Low Poly setting, and once again, using the Low LoD setting.  I used the first one I originally made for high LoD, the Low Poly as the medium LoD, the Low LoD version for the Low LoD setting and zeroed out the lowest with physics using the lowest settings.  This bulb came in at 0.6 LI (rounds up to 1).  And, of course, when I put the 4-in-1 texture image on the mesh, it matched the prim linkset.

So when you see something complex, remember, it's just a bunch of simple shapes put together.

Happy Meshing!
~ele

When you texture the prim, you texture the mesh...it's MAGIC!


(updated 09.15.12/12:15 pm PT)
Even after working with something for a long time, I find that I still have so much to learn.  This is, however, why I like to teach people because it makes me delve and ask questions and really try to understand things in order to explain them to someone else.

So in speaking with TheBlack Box and asking some questions, I had an AHA! moment.  Some of you may already know, but I finally just got it.

Here is the lectern I've shown before.




The one on the left is made from my prim linkset made of 19 boxes, no material faces, with the Object2JoinedMesh script.  I simply made it and made it mesh and threw on a seamless texture, the one on the left, you see in the bottom picture, light maple bounded on top and bottom with tiger oak.  Didn't texture bad at all.

Now look at the one in the center.  This is the same linkset, but this time I textured all the prims beforehand, using the same single seamless texture.  I used offsets, repeats and rotations to get the texture to go onto the different faces as nicely as possible; decorating it more as I had wanted.  When you do this, Mesh Studio uses the repeats/rotations/offsets in the creation of the UVs and when you generate the DAE and upload it to Second Life, the mesh has all of this texture information embedded.  Drop your texture into the texture panel of the Edit Menu or, if you have no materials as on mine, drop the texture onto the mesh itself.  It will match the textures as you set them on the prims in your linkset.

BUT WAIT, THERE'S MORE!  Look at the lectern on the right.  Note the texture below it on the bottom right of the illustration.  It is a 1024x1024 image comprised of four textures, each 512.  I retextured the linkset once more, this time repeating and offsetting to utilize one quarter of each texture on any given face.  All four of the textures in this image are used on one face or another throughout the prim linkset.  Once I generated the DAE and uploaded, I dropped my texture on this single material mesh and it also matched everything I did to the prims.  Using the four textures in one, expanded what I could do on the prims design-wise.

What this means is that without making a material face, you can get more than one texture on your mesh.  All without ever going to a 3D program.  That is pretty darned nifty!

Take a look at the steps in this linkset.  They have had a simple brick seamless texture put on them.  You can see, on the left, when all the settings are 1:1 with no offsets, they are different sizes and don't follow how a brick pattern should look.  On the second linkset, to the right, the pattern has been offset and scaled to provide a more realistic use of the pattern.


So it's just a matter of setting up the textures before you create the mesh.  While it doesn't mean that the mesh will upload with the textures on the mesh when it rezzes, the textures are already in SL and you just drop them on your uploaded mesh.





How do you work with a four-textured-tiled-image?

If you start with a 1024x1024 texture that has one 512x512 textures in each corner you'll end up with a texture that can have multiple uses for texturing your prim linkset for Mesh Studio.  Upload this texture to Second Life.  First, we will talk about using this on a prim linkset where you have elected to use no additional material faces.  

My recommendation is to make whatever faces, on your linkset, that are not visible at all when you will look at the mesh, and set those to a transparency of 100% which means these faces will not generate any mesh.  Now you can either drop the texture on each face, or open the linkset in edit and drop the texture into the texture window of the SL Edit panel or select it from the list of available textures.

The most common setting for using these four textures in one image is to set the repeats to 0.5 on both the horizontal and vertical repeats.  Then set the offsets to 0.25 or -0.25 in horizontal and vertical offsets.  By changing the offsets from positive to negative 0.25 in each offset field, you can quickly apply any of the four textures from your single image.  In the case of very narrow prims or odd cuts, you may need to increase or decrease the repeats.  You may also, depending on the texture and it's pattern, change the number of horizontal or vertical offsets to place something in the texture just where you want it.  You may also try rotations and flipping the repeats horizontally or vertically.  

However these textures end up on your prims, the parameters you set for the textures on each face will be faithfully reproduced on your mesh.

NOTE:  At this time, Mesh Studio does not support the use of Planar Mapping.  Only the Default setting works as expected.  This may change; I will update the blog if it does.

ALSO:  DO NOT USE TINTS when texturing, these tell Mesh Studio that you want a separate Material Face for that area.  

In the next post, I am hoping to continuing this topic by incorporating the use of material faces as well to further expand what you can do not only with textures, but the "effects" settings of transparency/glow/shine and bump.

Happy Meshing!
~ele