Thursday, October 25, 2012

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

No comments:

Post a Comment