Max Duesenburg
Registered User
Join date: 13 Sep 2006
Posts: 33
|
05-15-2007 02:55
I'm working on import/export scripts for Blender. The geometry side of things is pretty much up and running but I need to how the UV maps work in SL.
OK, there's the 32x32 grid, but where do the extra faces at the X-axis join and the 'Caps' on the Y-Axis draw their data from ?
Anyone got a copy of the UV map for a sculpted prim (or even better for all the variations that we're going to get) ?
Max
|
grumble Loudon
A Little bit a lion
Join date: 30 Nov 2005
Posts: 612
|
05-15-2007 12:57
As far as I can tell the texture is stretched by each tris based on the location of pixel of the mesh that creates the tris. This means that the texture wraps around just like the mesh (top to bottom and left to right)
I don't know if the texture is aligned upper left or centered with the extra pixels wrapping around.
The LOD bug makes it difficult to zoom in and see exactly where the texture is mapped.
EDIT: Maybe I should explain how I would write the rendering code. This may not be how they would do it, but it might help explain how it is done.
1. For each mesh pixel, grab two more ancient pixels to make a triangle. (alternate odd even) 2. based on the mesh's pixel's position (not it's values) calculate the same position on the texture based on scale and offset and the differences in texture size. 3. Send the Tris to Open-GL telling it to stretch the texture and draw it over three points in 3D space.
This means that the texture will map over the 3D mesh based on how the mesh is orientated. Make a flat plate in any direction and texture it. As long as the right/left top/bottom is the wrap area the texture should be the same direction as the mesh.
If the mesh is upside down, the texture will be upside down.
|
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
|
05-15-2007 13:04
My understanding is that there are no "extra faces" The top row and bottom row of the 32 x 32 grid are a single point. Like all sphere mapping in SL.
_____________________
Sorry, LL won't let me tell you where I sell my textures and where I offer my services as a sim builder. Ask me in-world.
|
Draco18s Majestic
Registered User
Join date: 19 Sep 2005
Posts: 2,744
|
05-16-2007 06:28
According to the wiki, the "top and bottom rows of pixels link to a single vertext, the poles." Though you are correct about hte UV mapping, the way you want it is the way it is
|