Planar Textre Mapping Rocks!
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
03-15-2006 15:37
To LL: Thanks for finally implenting this. Gone are the days of the evil triangle squishies. No more having to pre-correct for counter-distortion in Photoshop. Hooray!
To everyone else: As I'm sure everyone is about to discover, the planar system can be a little confusing at first. It works really well, but there are a few things you need to know about it to use it effectively.
How To Switch From Defualt Mapping To Planar Mapping To use planar mapping instead of the default mapping, first select a surface on an object (or multiple surfaces), and go to the Texture tab in the Editor. On the lower right, there's a drop-down menu, labeled "Mapping". (I like that it's a drop-down and not just a toggle because that implies it may be expanded. One day maybe we'll have other types of mapping available as well.) Simply select "Planar" from the menu.
Understanding The Difference Between Default Mapping And Planar Mapping With standard mapping, the texture image can be thought of as being physically stuck onto the surface, in the same way that a painting is stuck onto its canvas. Since textures are always perfectly rectangular, the "painting" will display only display normally as long as the canvas is also perfectly rectanglular. Should you change the shape of the surface, taper it, for example, the texture will get distorted. Think of it like what would happen if you stretched a canvas after it had been painted. The painting would stretch along with it, and the results probably wouldn't look very good.
Planar mapping solves the distortion problem. When a texture is planar mapped, it is projected onto the surface, in much the same way as a slide projector projects an image onto a screen or wall. This way, the size and shape of the surface don't affect the size and shape of the image. Stretch a movie screen, and you won't stretch the movie along with it. The projected image remains the same size and shape it always was, regardless of how the screen changes.
The only caveat is that in order for planar mapping to work properly, the "screen" surface must be flat. You can't very well project a slide onto a basketball and expect it to look right; you need a flat plane. Hence the name, PLANAR mapping. So don't try to use planar mapping with spheres or toruses, or with the sides of tubes and cylinders. It's only for flat surfaces, such as cubes, prisms, the tops and bottoms of cylinders and tubes, etc.
Shape Considerations Whether we're projecting onto a tringle, a square, a rectangle, a trapezoid, or whatever, the shape of the projection will not change. It will always be perfectly rectangular. In places where the edge of the surface "cuts off" the rectangle, that part of the projection will simply disappear over the edge.
The surface won't try to cram the whole projection onto itself like it does with default mapping. Therefore, there will be none of the warping you'd otherwise see on tapered surfaces. The texture projection will always remain square.
Size Considerations When you switch from default to planar mapping, the options will change a little. Repeats per Face changes to Repeats per Meter. This is because of how planar mapping works. I'll explain.
To go back to the slide projector analogy, the size of the screen is not what determines the size of the projection. Whether you're projecting an image onto a small home movie screen or a full size cinematic theater screen doesn't matter. The screen has no say in how big or small the image is that's being projected onto it is. To change the size of the image, you need to adjust the projector, not the screen.
This is why repeats per face can't work with planar mapping. The projector doesn't know or care how big or small the screen is. All it knows is how big it's supposed to make the projection itself. If the screen happens to be big enough to catch the whole thing, fine. If not, then that's fine too. Either way, the projector's perfectly happy, and the projection stays the same.
As mentioned above, a planar-mapped surface will not end up distorting the image by trying to force-fit the whole thing onto itself. It will simply reflect the portion that fits, no more, no less, just like a movie screen would.
The Projection Vector Projections are always sourced inline with the surface normal. In other words, the "projector" is always oriented perpendicular to the "screen" so it projects straight on. As a result, you can't skew a projection in SL like you can in other 3D packages. For most people, this won't be a problem. Usually you wouldn't have call to skew a projection, since in most cases, the whole point in projecting to begin with is to avoid distortion, not to create it.
Origin Projections always originate from the center of the surface. When you use offsets, you're offsetting from the center. This is pretty much the same as how it works with the standard mapping. It can look a little confusing at first due to the Repeats per Face/Repeats per Meter changeover, but it's really the same thing.
Rotation Rotation and flips work the same in both modes. No need to explain further.
Projecting Onto Curved Surfaces Planar projection onto concave or convex surfaces produces weird results. Typically, in 3D modeling applications, these kinds of surfaces are handled with other kinds of projections (cylindrical mapping, spherical mapping, etc.), which SL does not support at this time.
Since we don't have a whole lot of control over the "projector" in SL, it's not practical to try to use planar mapping on curved surfaces. Best advice, just don't go there. Use planar mapping where it belongs, on planar surfaces.
Hopefully this little impromptu guide will help some people out. Planar mapping is a huge step forward for us. I can't wait to see how people use it to make SL look better. For my part, I'm thrilled I can finally get to texturing my starship hulls without having to make a serperate custom pre-counter-distorted texture for each panel. Happy days!
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|
Kijara Solzhenitsyn
BritFur
Join date: 20 Nov 2005
Posts: 17
|
03-15-2006 16:02
Ooh, this is Uber-Shiny!
Chosen, might I suggest NCC-74237?
|
Robin Sojourner
Registered User
Join date: 16 Sep 2004
Posts: 1,080
|
03-15-2006 21:38
Hooray! I thought that this was going to be one of those "promised but elusive" things, like layering textures on clothing, or Havok 2. It looks like they solved the "prim sliding under the mapping" problem (mentioned in a different post) by simply making the mapping centered and perpendicular to each face (or to the top, if the whole object is selected when Planar Mapping is applied.) But, however they did it, I'm really, really glad that they did! Even though this means that my entire Texture Tutorial is now suddenly obsolete, and will have to be rebuilt. Sigh. Ah well!  Thanks for posting this short tutorial, too, Chosen. Hopefully, it will answer some questions before they are asked. Oh! And it's possible that the rounding thing is only temporary. Sometimes, I've noticed, the Default mapping gets rounded in exactly the same way. And then it will suddenly work as it should. I agree, it's maddening, but it has also always been intermittent; at least with Default mapping, and in the past. Hopefully, it will stop doing that soon.
_____________________
Robin (Sojourner) Wood www.robinwood.com"Second Life ... is an Internet-based virtual world ... and a libertarian anarchy..." Wikipedia
|
Dianne Mechanique
Back from the Dead
Join date: 28 Mar 2005
Posts: 2,648
|
03-15-2006 22:09
From: Robin Sojourner ...Oh! And it's possible that the rounding thing is only temporary. Sometimes, I've noticed, the Default mapping gets rounded in exactly the same way. And then it will suddenly work as it should. I agree, it's maddening, but it has also always been intermittent; at least with Default mapping, and in the past. Hopefully, it will stop doing that soon. I have had this rounding bug recently (in 1.  right up until Tuesday night on certain objects. Not sure what's causing it but the one object it was happening on for me refused to let me enter offsets that had more than two decimal places, but only on some of the surfaces. I repeatedly tried to texture it on and off for a week or so, even recreated the entire object from scratch and still no go, right up until the 1.9 update.
|
Torley Linden
Enlightenment!
Join date: 15 Sep 2004
Posts: 16,530
|
03-15-2006 22:26
I remember seeing this mentioned before on the SL Forums a number of times--infact, I reckon it was some of Chosen's older posts, as well as Tiger Crossing's and some others. AND NOW THE DAY HAS COME!!! Thanx for the laid-out guide to planar textures, Chosen! Say, out of curiosity, as a budding builder, if I were to ask: "Why would I want to use planar textures?" or a variant along those lines asking what they're good for, how would you simply answer? I'm thinking of easier ways to sum it up. I don't quite understand myself so I want to get a better grip.
|
Candide LeMay
Registered User
Join date: 30 Dec 2004
Posts: 538
|
03-16-2006 01:03
From: Chosen Few There appears to be a bug in the rounding for repeats. Try to enter a value of .03 in the U or V repeats, and it will take, but then as soon as you touch any other parameter, it will snap down to .02. The same is true for any value between 021 and .032. Go to .033 or higher, and it will snap to .04. This can be maddening for trying to align planar textures across large builds (like my bird of prey wings, as I just discovered  ). Yes, I've told that to lindens in preview - having the repeats per meter combined with the very limited precision of the repeats fields will make it difficult to use planar mode on large prims, especially if you want to reach less that one repeat per face. Oh well, better than nothing 
_____________________
"If Mel Gibson and other cyberspace writers are right, one day the entire internet will be like Second Life." -- geldonyetich
|
Cottonteil Muromachi
Abominable
Join date: 2 Mar 2005
Posts: 1,071
|
03-16-2006 02:08
From: Torley Linden Say, out of curiosity, as a budding builder, if I were to ask: "Why would I want to use planar textures?" or a variant along those lines asking what they're good for, how would you simply answer? I'm thinking of easier ways to sum it up. I don't quite understand myself so I want to get a better grip. You know when some textures used to be buggerified on the sides of tapered cubes? They sort of look semi skewed. Now with planar mapping, it goes smoothly like someone gift wrapped it. It also works on other prims that have this problem, like ends of tube prims or ring prims for example. Its a mess when applied to some curved surfaces tho. Those should remain as default.
|
Nepenthes Ixchel
Broadly Offended.
Join date: 6 Dec 2005
Posts: 696
|
03-16-2006 05:20
For 98% of the things I make planar textures are useless. But for that other 2%, they are perfect! I'm glad this got added in, even if I can't figure out how it works when projected onto a curved surface (which defeats the purpose of using planar mapping, but *shrugs*)
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
03-16-2006 08:55
EDIT: Most of this post is no longer relevant, since I've update the original post to include the answers to Torley's questions. However, for historical purposes, and to preserve the flow of the thread, I'm not removing it. The only edit is this introductory commentary. /EDIT From: Torley Linden Say, out of curiosity, as a budding builder, if I were to ask: "Why would I want to use planar textures?" or a variant along those lines asking what they're good for, how would you simply answer? I'm thinking of easier ways to sum it up. I don't quite understand myself so I want to get a better grip. Great question, Torley. I suppose I should have covered that in a little more detail than simply saying "gone are the days of the evil triangle squishies". The shortest possible answer is to think of it as a paint job vs. a slide projector. Standard mapping is "paint"; Planar mapping is "slide projection". I'll explain. With standard mapping, the image can be thought of as being physically stuck onto the surface it's texturing, in the same way that a painting is stuck onto its canvas. Since textures are always square, the "painting" will display normally as long as the canvas is square. But should you change the shape of the surface, and the texture will get distorted. Think of it like stretching a canvas after it's been painted. The painting will stretch along with it (and because computer graphics construct everything from triangles, not squares, the stretching can look really weird to the untrained eye). Planar mapping, on the other hand does not "paint" the image onto the surface at all. Instead, it "projects" it like a film slide. The surface ends up acting like a movie screen, displaying the image, but not physically connecting to it. This way, you can stretch and distort the surface all you want, and the shape of image won't be affected. The square image will always be square, whether the "screen" is rectanglular, trapezoidal, triangular, etc. Any portion of the image that can't fit onto the shape of the screen will simply be cut off. Youwon't end up with the whole image trying to bend and distort itself to fit onto the odd shaped screen like you would with standard mapping. There are, of course, advantages and disadvantages to both methods. Planar mapping is bes suited for objects like cubes with shrunken tops. You don't have to worry about distortion from the "unsquaring" of the cube sides. It is not well suited though for surfaces that curve in 3D space, like cylinders and spheres. Try projectig a slide onto a coffee can or a soccer ball some time. It doesn't work too well. So, for most applications, standard mapping is the way to go, but for flat surfaces that are not square, planar mapping is a good alternative to keep your textures from getting warped.
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|
Caliandris Pendragon
Waiting in the light
Join date: 12 Feb 2004
Posts: 643
|
03-16-2006 10:26
I haven't experimented a great deal with this, but I was experiencing something a bit strange when switching from default to planar on a large prim. The repeats seemed to be doubling on switching to planar, but were actually multiplied by about 10x that. I don't know if this is a bug or a feature though....
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
03-16-2006 11:01
From: Caliandris Pendragon I haven't experimented a great deal with this, but I was experiencing something a bit strange when switching from default to planar on a large prim. The repeats seemed to be doubling on switching to planar, but were actually multiplied by about 10x that. I don't know if this is a bug or a feature though.... Take a close look at the editor and you'll see that the repeats are not just changing in number, but in kind. As I said earlier, planar mapping uses repeats per meter, not the repeats per face you're used to from the standard mapping. The numbers always seem to double upon switching, which is a little odd, but the appearance of vast multiplication is a function of the size of the surface you're affecting. To understand what's going on, try this: First, start with a 1x1x1 cube set to 1 rpf (rpf=repeat per face), standard mapping. Switch to planar mapping, and you'll end up with 2 rpm (repeats per meter). Why it doubles the numbers is a mysery to me at this point, but since it behaves the same way every time, it's not the end of the world. Predictability is king. Anyway, on a 1x1x1 comes out to 2 rpm comes out to 2 repeats on each face (although the centering makes it look like more at first glance), entirely predictable. Now, try the same experiment with a 10x10x10. Start with standard mapping at 1 rpf. Switch to planar, and uh oh, what happened? Now you've got a million repeats on each face, right? Well, take a closer look. Examine the editor and you'll see you're at 2 rpm, just like before. It's just that a 10x10x10 cube is big enough to display 400 repeats on each face (20 horizontal, 20 vertical) at 2 rpm. It's elementary math. 2 repeats per meter times 10 meters equals 20 repeats. The important thing to remember as you change from mode to mode is that rpf becomes rpm and whatever values you had entered in will double. The rpm thing makes perfect logical sense in accordance with what planar mapping actually does. The doubling thing doesn't make sense, but since it's a constant, it's easy to account for.
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|
Cocoanut Cookie
Registered User
Join date: 26 Jan 2006
Posts: 1,741
|
03-16-2006 19:22
Forget what I said in this post. It was my mistake. Somehow, the prim involved had gotten misshapen and I hadn't noticed. I doubt that when I do the planar texture on the new prim that it will have any problem.
coco
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
06-13-2007 06:14
I'm bumping this, as there have been several questions lately about texturing tapered cubes.
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|
Furia Freeloader
Furiously Furia
Join date: 13 Dec 2005
Posts: 34
|
08-25-2007 23:00
Ahh such a great little post. I vote sticky or part of sticky. Planar texture mapping does rock!
|