Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Fix UV mapping on tapered prims!!

Kalel Venkman
Citizen
Join date: 10 Mar 2006
Posts: 587
02-20-2008 13:06
I'm sure everyone has seen this:
#1: Make a block prim.
#2: Put a texture on it with some sort of strong pattern (doesn't matter what).
#3: Scale the thing up so you can see it clearly.
#4: Taper the block by about 30% or so.

Now look at what the texture map is doing. Instead of smoothly scaling the texture from the base edge to the far edge of the tapered side, the SL rendering engine FOLDS the image in an effort to make it fit. The corners are pinned down okay, but between them, the UV interpolation is horribly broken.

I've written 3D engines in OpenGL myself, and this bug should be very very simple to fix, yet it's been present in the rendering engine since at least 2006, and probably long before that. It makes it impossible to create decent looking tapered structures that use texture maps, unless those maps are very low contrast so as to hide the rendering defect.
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
02-20-2008 17:09
The solution is to use planar mapping.

After you apply the texture to the prim's face, select planar mapping from the 'type' dropdown under the texture tab. You'll need to adjust the scale afterwords.

If you need a texture that tapers evenly to match the prim's taper, do the taper in Photoshop. Planar basically works like a decal, whereas default warps to the triangular faces which create the single prim face as we know it.
Seifert Surface
Mathematician
Join date: 14 Jun 2005
Posts: 912
02-20-2008 23:27
Prior to planar mapping, a number of people worked with distorted textures that SL would distort back, the result being the desired undistorted image.

It's true that there should be a mapping of a rectangular texture onto a tapered prim in a "perspective" style rather than the current broken along a diagonal, but it should be added as a third texture mapping option rather than replacing the current one (or move the current to a "legacy" option).
_____________________
-Seifert Surface
2G!tGLf 2nLt9cG
Ollj Oh
Registered User
Join date: 28 Aug 2007
Posts: 522
02-20-2008 23:44
planar mapping.
opengl vertex buffering.
bi or trilinear filtering
increase z-buffer size.
and theres a lot in the CCC or whatever control panel comes with your graphic card.