View Single Post
Old 15th September 2008, 09:36 PM   #2
lisa
Senior Member
Professional user
 
lisa's Avatar
 
Join Date: Mar 2005
Location: Phoenix, AZ
Posts: 917
Default Re: Anyone know what I am doing wrong?

I know what's going wrong... I'm trying to get some help from LL on a fix, or come up with a work around myself. I just recently ran into this myself and it took me a long time staring at it in wireframe (control-shift-d in the viewer, I think) to figure it out.

Here's the problem: video cards force textures to be square powers of two. i.e 8x8, 16x16, 32x32, 64x64, etc. Sculpt maps, being textures must thus also be square powers of two.

For reasons inexplicable, Qarl Linden made the mesh for planar sculpted prims 32x32 *surfaces* instead of 32x32 *vertices* -- his mesh is 33x33 vertices!! Ouch. This means, no matter what you do, you *can't* get a 1:1 of vertices to texture even with a perfect texture. What he *should* have done is made the mesh 32x32 vertices, 31x31 surfaces.

Now in truth, I can theorize as to why this was done. I am assuming Linden Labs did it this way for LOD reasons. There's a way to do an edge collapse that used to be quite common in games and such from a few years ago. In fact, if you've ever played Motocross Madness 2 or any of the Rainbow Studios games, they use the same algo for decimating the terrain mesh. I'm assuming Linden Labs is using this method for generating LODs, and that method needs a 33x33 mesh to work. The *right* answer is to use a different method for reducing the mesh--I'd recommend edge collapse based on angle and discontinuities myself, you could potentially save many more polys that way--but that's a lot of work, so I'm assuming that's not going to happen anytime soon unless I do it myself. Sigh.

Anyhooo... to cut to the chase, if you resample your sculpt map much larger, when SL re-samples it back down, you can get it to fill in the missing vertex. Resize your map in photoshop and double or triple the pixels *without* any anti-aliasing on the resize. That should get rid of the gap.

At the worst case, I'm going to put an option in the next version of the exporter to do this, but again, hopefully someone will fix the viewer first! I think there's a JIRA entry for this already, but I can't remember what the number is.
lisa is offline   Reply With Quote