Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Oblong Sculpties: Collect Information here, please

Soldatino Oh
____________
Join date: 9 Jun 2008
Posts: 58
03-26-2009 06:49
From: Drongle McMahon
Did you also try 16x256? The extra pixels in the 32x512 should be ingnored*, and the results should be different only if either (a) you are uploading with lossy compression or (b) your resizing is introducing interpolation artefacts.

*If I recall correctly, the rendering code just samples the pixels at appropriate intervals to get the numbers of vertex coordinates defined for the current LOD value. It does not interpolate. That's why sharp-edged sculpties can work at all.


"you are uploading with lossy compression"
I have always the option lossless checked!
Details in the post above.
Gaia Clary
mesh weaver
Join date: 30 May 2007
Posts: 884
03-26-2009 07:00
From: Soldatino Oh
Ok. I actually use the 8 x 128 pixel = 1024. (1024 is for all the sculpties)
If I upload a TGA file, also using lossless option checked, SL change it.
I attempt to explain better
First line (8x128):
xyz1. xyz2. xyz3. xyz4

In horizontal and in vertical also SL modifies the xyz in order the rgb color before and after each pixel.

But if I use:
First line (32x512)
xyz1. xyz1. xyz1. xyz1. xyz2. xyz2. xyz2. xyz2. xyz3. xyz3. xyz3. xyz3. xyz4. xyz4.xyz4. xyz4.
Many adiacent pixels has the SAME COLOR in the left and right pixel, so they arent changed by SL.

When SL is working the render steps by 4 pixels and it find a color identical original mesh (8x128).
My english is bad, I hope to explain...
I think i understand what you are aiming for. From what i have learned about sculpties:

in the standard case:

- because 32 faces need 33 vertices in each dimension, the sculpt-map must be at least of size 33*33 pixels.

- the easiest way to implement sculpties was to use images with dimensions of power of 2. This has to do with the way how the 3D renderer works (sorry, i don;t know detials here)

- the smallest fully functioning image size is then 64*64

- the viewer does not interpolate when LOD comes into effect, but "removes" inbetween vertices.

Extrapolated to oblongs, that means in essence, that double sized images should be enough to get best results, hence i expect that in your case 16*256 would be the optimal image size.

From another thread i have learned, that under some circumstances bigger images load faster. It has to do with some optimization issues about how the viewer loads data, but sorry, i forgot the details and need to recover them ;-(

So i am still curious if your sculpties look different with 32*512 sculptmaps compared to 16*256 sculptmaps...
Soldatino Oh
____________
Join date: 9 Jun 2008
Posts: 58
03-26-2009 13:50
Yes I know 3 types of sculpties

32x32 = 1024
16x64= 1024
8x128= 1024
teorically it is possible 4x256 but the mesh is usefull only for some particular objects...

now
32x32 (are known)
16x64 (I dont use yet)
8x128 (where I have the problem)

my 32x512 are the SAME of the 8x128, because SL uses 1 point by 4 and ignores the other 3 points.
BUT if I upload the 8x128 I have some bad points, even if using lossless compression.
The SAME sculpty resized exactly 4 x (it becames 32x512) before the upload, works fine.

my EXAMPLE for mesh and rgb 8x32

ABCDEFGH
LMNOPQRS
etc

my EXAMPLE for the SAME mesh and rgb 32x512

AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHH
AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHH
AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHH
AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHH
LLLLMMMMNNNNOOOOPPPPQQQQRRRRSSSS
LLLLMMMMNNNNOOOOPPPPQQQQRRRRSSSS
LLLLMMMMNNNNOOOOPPPPQQQQRRRRSSSS
LLLLMMMMNNNNOOOOPPPPQQQQRRRRSSSS
etc

Some 8x128 are working fine, others need the 32x256. It seems that the problem is due too many changes of direction of the sculpty.
This sculpty of mine

needs the 32x512 or it fails (notice: only in SL, other OpenGL viewers load it correctly)

this other easy sculpty of mine,

works fine even if in 8x128
Gaia Clary
mesh weaver
Join date: 30 May 2007
Posts: 884
03-26-2009 15:34
The problem is the extra line of vertives you need in order to get the correct amount of faces... Hence 8*128 bitmaps don't work reliably (they may work or not exactly as you have seen) ... That is because with that size you only will have exact information for 7 * 127 faces, which is NOT what you want. Hence with a 8*128 pixel map the SL viewer MUST interpolate...
On the other hand if you double the size of the bitmap in both dimensions, now there is place for 8*128 faces and all interpolation problems should be gone.

I only can tell for 32*32 meshes and there i have verified quite often now, that by using 64*64 bitmaps i can place my vertices wherever I want them to be, modulo the available 8 bit resolution per axis due to the used color space. And from what i have experienced with 32*32 sculpties i still suspect that your precision problems will be gone when you use a 16*256 bitmap. I might be completely wrong though ....

So all i ask is: Do you experience problems with 16*256 bitmaps or not ? And if such problems exist, can anybody explain why that happens in detail ?

thanks ;-)
Soldatino Oh
____________
Join date: 9 Jun 2008
Posts: 58
03-26-2009 17:02
From: Gaia Clary
The problem is the extra line of vertives you need in order to get the correct amount of faces... Hence 8*128 bitmaps don't work reliably (they may work or not exactly as you have seen) ... That is because with that size you only will have exact information for 7 * 127 faces, which is NOT what you want. Hence with a 8*128 pixel map the SL viewer MUST interpolate...
On the other hand if you double the size of the bitmap in both dimensions, now there is place for 8*128 faces and all interpolation problems should be gone.

I only can tell for 32*32 meshes and there i have verified quite often now, that by using 64*64 bitmaps i can place my vertices wherever I want them to be, modulo the available 8 bit resolution per axis due to the used color space. And from what i have experienced with 32*32 sculpties i still suspect that your precision problems will be gone when you use a 16*256 bitmap. I might be completely wrong though ....

So all i ask is: Do you experience problems with 16*256 bitmaps or not ? And if such problems exist, can anybody explain why that happens in detail ?

thanks ;-)


you wrote:
That is because with that size you only will have exact information for 7 * 127 faces

But I think that I have 8 x 127 faces (the #8 starts at right of #7 and ends at left of the #1), and the last line of faces, the #128 is created by SL using down the upper point of the #127 and upper always a single point (the RGB/xyx pixel in in the middle of the top of the TGA picture).
This is wrote in SL doc.
This line of faces is created by SL closing the object type sphere.
In cylinder, or plane type it is not present... This is the Norh Pole.
I think my TGA is right.

I uploaded the TGA files if you want to check this sculpty.


TGA http://www.imitidicthulhu.it/Blog/seggioline2.zip
TGA http://www.imitidicthulhu.it/Blog/seggioline2-32x512.zip

The second is 32*512 (working, in the screenshot), the first is the same but in 8*128 and works bad.

In order 16*256 bitmaps I apologize but I don't have experience actually. I need a bit of time to write the code that does it...
Gaia Clary
mesh weaver
Join date: 30 May 2007
Posts: 884
03-26-2009 18:47
From: Soldatino Oh
you wrote:
That is because with that size you only will have exact information for 7 * 127 faces

But I think that I have 8 x 127 faces (the #8 starts at right of #7 and ends at left of the #1), and the last line of faces, the #128 is created by SL using down the upper point of the #127 and upper always a single point (the RGB/xyx pixel in in the middle of the top of the TGA picture). This is wrote in SL doc.
ups... you are right... i was argumenting for sculptie planes... hmmm... indeed you only need 32 vertices to create 33 faces if the plane is closed. But isn't this only true for torus like objects ?

- For planes you definitelyty need one additional row and one column of vertices.
- For cylinders your argument works for the U coordinate only.
- Same is true for spheres, which are to my knowledge nothing else than cylinders pumped up and automatically closed at the poles but showing 32 faces (henbce 33 rows of vertices along the V-axis)
- only for torus a map of 32*32 (or 8*128 in your case) functions correctly, because they are stitched at U and V ...

well, i start getting uncertain again and i need to google now for reliable documentation about oblongs and how the sculptmaps are realy interpreted by the viewer ;-)
Drongle McMahon
Older than he looks
Join date: 22 Jun 2007
Posts: 494
It's a bit complicated
03-27-2009 09:25
1. I think the power-of-two requirement, that disallows 33x33 etc, for bitmap dimensions is a function of the SL image upload system, not of the sculptmap rendering per se. (That having been said, it may be that the rendering routines then assume they are receiving a power-of-two-only bitmap, I can't remember and don't have the source code here.)

2. The number of faces depends on the level of detail, which depends on how near you are to the sculpty. It goes 1024, 256, 64, 36 (36 for strange historical and backward compatability reasons, where you might expect 16). For the purposes of this dicussion, I think we are only concerned with the highest LOD, so 1024 rectangles (2048 triangles).

3. 1024 rectangles, as a plane, can be 32x32, 16x64, 8x128 etc. However, that requires 33x33, 17x65, 9x129 vertices....

4 ....unless some of the vertices are implicit by the stitching together of the edges of the plane (one for cylinder and sphere topologies, both for torus) or gathering together in a pole (sphere only).

5.For the stitching, the 33rd (etc) pixel is necessarily identical to the corresponding pixel at the other end of the row/column, and these are generated by replicating the rgb values for the identical row/column. Thus the relevant dimensions of the stuitched topologies don't really need the extra pixels, while unstitched ones do.

6. So does the poles of the sphere, where the middle pixel of the 1st/33rd (etc) row is replicated across the whole row so that the vertices are all in the same place, the pole.

7. Since upload is restricted to powers-of-two dimensions, to get 33 (17 and 65, etc) vertices, you have to use 64x64 (32x128, etc) for all except the torus, which has two stitched edges. The rendering code uses alternate pixels starting at row/column 0, and gets the additional pixel from the extreme end (so using , eg 0, 2, 4 ......, 58, 60, 62, 63). If you try a 33x33 bitmap (or any other non-power-of-two) it will be resized by the client before uploading, which will ruin everything (I think - never tred!).

Next bits not quite so certain, but I think the situation with 32x32, 16x64, 8,128 etc is as follows....

8. Presently, the sculpty rendering code will interpolate whatever size bitmap it is given to get the expected number of pixels. I can't remember whether it will make a 32x32 to 33x33 or to 64x64 (and even less with the oblongs). This is probably why the smaller bitmaps don't work as expected.

9. Supposedly after viewer 1.23 comes, the rendering of smaller bitmaps will be changed to allow the generation of sculpties with fewer triangles (and thus faster rendering, and maybe eventually animated vertices). These changes will not affect the rendering of the presently optimal sized bitmaps (64x64, 32x128, 16x256, 8x512). So these should be used for all sculpties being made now.

10. Bitmaps bigger than the optimal sizes do not provide any extra control. As Gaia said, they are just sampled at a subset of pixels. Bitmaps that are not exact powers-of-two domensioned will be resampled in the client before upload, and the consequences are unpredictable (by me, at least).

There are a number of threads in this forum where all this was discussed (look up "oblong" maybe), and the final discussions are documented in Domino's Jira mentioned by Omei http://jira.secondlife.com/browse/VWR-9384. The old threads contain details of eaxctly what happens to non-optimal bitmaps, and the jira cointains some tables with details of how small oblongs should work in viewer 1.23.

Ii is all rather complicated, but I hope that helps a bit.

PS. I should add that there are other sizes I have not mentioned that are still powers-or-two in both dimensions, but not exactly 4096/4^n pixels, such as 64x128, 32x256 which behave a bit differently. These remain suitable for "organic" sculpties, but have horrible LOD switching problems for "geometric" sculpties with sharp edges (details in the jira tables).
Soldatino Oh
____________
Join date: 9 Jun 2008
Posts: 58
03-29-2009 13:15
From: Gaia Clary

So all i ask is: Do you experience problems with 16*256 bitmaps or not ? And if such problems exist, can anybody explain why that happens in detail ?
thanks ;-)

Ok I am finally improving in my CAD2Sculpty the 16*64 oblong (not 256 because I want 1024 vertexes), after the 8*128. Those sculpties also need my resize *4 process (without smoothing, obviously), before the upload (lossless) in SL!
In the right side the sculpty 16*64, in the left side the same sculpty resized *4 (64*256).
You can see the difference in a quick test.

Gaia Clary
mesh weaver
Join date: 30 May 2007
Posts: 884
03-29-2009 15:55
From all i know about oblongs and from what Drongle has summarized earlier (thanks for that one Drongle ;-) ), i got more and more interested wondering what happens when you double or quadruple(?) the sculptmap sizes.

The theory says, that a double sized bitmap would be the optimal size. So i tried it now by myself using your example as a guide. Here is the result for a 64*16 Sculptie:



As you can see, there is no difference between the 256*64 map and the 128*32 map, while the "simple" 64*16 map clearly fails and this fully conforms to what i have written before.

So for me it looks like you can live with double sized maps and you dont need to create quadruple sized maps. Please correct me if i am wrong ...
Drongle McMahon
Older than he looks
Join date: 22 Jun 2007
Posts: 494
03-29-2009 16:22
From: Gaia Clary
So for me it looks like you can live with double sized maps and you don't need to create quadruple sized maps. Please correct me if i am wrong ...
You are not wrong.

Any other differences between "doubled" and "quadrupled" must be artefacts of the software used to generate the maps.

Sampling the "quadrupled" maps at alternate pixels rows/columns* should give a "doubled" map that produces exactly the same sculpty.

(The sampling must not involve any calculation/smoothing/interpolation. It must be a precise copying of each of the relevant pixels....most bitmap manipulation software will do one or more these horrible things with default settings.)

*it may be necessary to use the odd-numbered pixels if the "extra" pixel row/column is only 1 pixel wide.
Soldatino Oh
____________
Join date: 9 Jun 2008
Posts: 58
03-29-2009 16:42

Gaia you are absolutely right!
This is my test with TGA only in double size and my template texture that I use to see better!
Drongle McMahon
Older than he looks
Join date: 22 Jun 2007
Posts: 494
03-29-2009 18:04
Nice texture. Now we have an excellent demonstration that the 2x works. Well done.
Soldatino Oh
____________
Join date: 9 Jun 2008
Posts: 58
03-29-2009 18:42
Many Thanks!
1 2