Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

UV Texture Mapping

DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
07-25-2004 10:42
Hello,

Does anyone know of a way to get UV maps out of SL? Is there a 3D program that uses the same primitive-defining technique - studio, lightwave, blender, infini-D? With that help, it might then be possible to replicate an object to extract a UV map?

Or maybe there's a better way to figure out textures. Basically, my problem is with a modified cube prim... i've scaled the TOP-X param. and I've sheered a bit as well - to form something like a right-triangle with it's top cut off. This causes the small triangular portion of the map to stretch disproportionately from the rest of the texture... a mess that I have't the experience to figure out yet.

A simple external modeller that produces prims and flattened UV maps would be a good thing?
Lightwave Valkyrie
Registered User
Join date: 30 Jan 2004
Posts: 666
07-25-2004 12:13
you can try a uv texture helper apply it and see where it lines up

http://www.g-3d.com/UV_Helper_02.html

-Lightwave
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
07-25-2004 17:54
Ah yes, I've applied the UV Helper... mine actually has a rainbow look to it. However, being not very experienced in the way of the UV, I haven't a clue how to apply my findings from the helper texture (outside of SL, there is no prim-limit to 3D models, so I can cheat by makng thin, flat-shaded objects to act as decals.)

I've installed my sample problem with the UV helper texture in two sandboxes... they illustrate my problem better than I can describe it. For instance, suppose I want to have a large 'O' cross the UV boundary. Half of the 'O' would appear very corectly, but the boundary creates the look of a fault-line in California... with the other half of the 'O' severly distored.

Should I take a screen capture of the applied UV helper, and try to distort my texture in the opposite direction by the same amount? Seems that would involve a lot of trial/error (mostly error).
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
07-26-2004 04:36
The kind of distortion you are describing is a common problem with polygonal surface modeling. In other words, it's not just an SL thing. It is more or less inherent to polygons. It has to do with the fact that a rectangular face is not actually a rectangle, but is really 2 triangles. When you scale one side of a rectangle, you are altering the size of only one of the triangles while changing the angle aspects of both. Thus the half of the texture that sits on the resized triangle becomes compressed and bent while the half on the other triangle gets fanned out towards the newly resized diagonal border between the triangles.

Without direct access to the CV's and real texture mapping, this distortion is very, very difficult to correct. If you are very accomplished with Photoshop, you can create textures that are offset in the proper way so as to counteract the distortion, but it's not as easy as you would think. It takes an intimate understanding of the fundamentals of how the texture falls on the object as well as a very good artistic eye, and it has to be done differently for every different size and shape. In other words, there's no quick fix magic formula. If you distort a texture the right way to line up properly on a 1:1 rectangle with a 50% size top, the same texture will not work with any other proportions. Every possible set of variables has to be done seperately.

Until the day processors become fast enough that we can abandon polygonal modeling in games, we're unfortunately stuck with this problem. Other surface types, like NURBs are capable of distorting textures in much more intuitive ways, but the math is too complex for real time gaming. SL could improve things a bit by increasing the number of triangles per face, but again that would increase the necessary calculations for display and would slow down the game.

Depending on what you are building, it is often much better to use alphas to hide portions of a prim rather than actuallychanging the shape of the prim itself. A good way to go about it is to build your object the way you want it and then lay phantom prims over the top with alpha textures. That way you don't have to worry about people bumping into invisible portions of solid objects.
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
07-26-2004 10:58
Wow, it's all I was afraid of... basically a fatal error. I'll have to go the alpha route. I opted against that earlier due to the white outlines present despite the alpha. However, I know the issue has been resolved one way or another, so I'll read up and apply the technique.

Now I'm curious about your phantom prims concept? I read that as sortof CSG subtraction... overlay the "totally_clear" phantom prims to prevent bumping into a portion of the textured prim. Does that work? For instance, I make a <10x10x0.2> circle and texture it with a fullsize star w/alpha cut. Then overlay triangular phantom prims with "totally_clear" texture to 'cut-out' the space between the points of the star. Would I then be able to walk within the radius of the original 10x10 circle? It seems to me that a person would still bmp into that non-phantom prim underneath.

If only there was an offline sandbox client for SL, I'd try this on my laptop at work. Otherwise, I've gotta wait.

Thanks for your very helpful explanation of textures, you've saved me from hours/days of possible frustration.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
07-27-2004 06:17
Let me re-explain what I was saying about the phantom prim thing in a little more detail. You cannot use phantom objects to make portions of solid objects go away. That's not what I meant.

To go with your star example, you would first make the star in Photoshop as a texture with an alpha around it so that when you apply it to a flat surface in SL, all you see is the star. Make the textured object phantom so it is intangible. Now use 5 triangular prims to model the star shape directly behind the picture.

You now have a star that is geometrically correct and appears to be textured properly. Because the texture is actually on a square, it exists without the distortion effects that would normally be present if it were applied directly to the triangular prims. Because the square is phantom, the only tangible parts of the model are the triangular prims.

A good example of this in world is inside my USS Defiant replica at the Sci-Fi Musueum in Indigo. The helm/ops console is semi-elyptical so geometrically it is a half cylinder. Because it is elyptical and not perfectly circular, it would be very difficult to texture properly, as the texture would contract in the middle and expand at the sides. To solve the problem, I applied the texture to a square plane so it would not distort, and I laid the plane directly on top of the cylinder. Because the plane (box) is invisible (except for the image of the control panel) and completely intangible, it appears that the control panel is right on the console, even though it is actually a seperate object.

If you're still unclear on this, find me in world and I'll give you a demonstration. These days I can almost always be found in the NW corner of Indigo, working on museum exhibits.