Printable Version of Topic
Sandy's Forum _ AS2 1.x versions _ Box quality setting
Posted by: zeusprod Mar 29 2007, 09:11 PM
I couldn't find the original thread where this is discussed. Petit, maybe you know.
Here is the number of faces per Box surface in Sandy 1.2 using quad mode. In tri mode, double these numbers
Quality-->polys per surface
1 --> 1
2 --> 4
3 --> 16
4 --> 64
5 --> 256
6 --> 1024
That is, if q is the quality:
number of polys per box surface = Math.pow(2, 2*q) /4;
Therefore, a setting of quality greater than 3 is ridiculously processor-intensive.
I expected the setting to be more linear; it is not.
I'm off to test Sandy 1.1
Thoughts, comments?
Cheers,
Bruce
Posted by: Petit Mar 29 2007, 10:17 PM
QUOTE(zeusprod @ Mar 29 2007, 09:11 PM)

I couldn't find the original thread where this is discussed. Petit, maybe you know.
Well I had success with the search

It is http://www.flashsandy.org/forum/
index.php?s=&showtopic=393&view=findpost&p=2299
Posted by: zeusprod Mar 29 2007, 10:26 PM
The results are the same in Sandy 1.1 and 1.2 for a Box. I'm guessing the others are the same across versions too.
Here are the results for a plane (q*q), as opposed to a box.
1 --> 1
2 --> 4
3 --> 9
4 --> 16
5 --> 25
6 --> 36
(I think it maxes out at 10 but I didn't test it)
Here it is for a sphere. I don't see any clear pattern/formula that relates q to the number of faces: (it maxes out at 5)
1-->21
2-->32
3-->50
4-->72
5-->98
And here it it for a Cylinder in quad mode- Usually q + 2
1-->3
2-->4
3-->5
4-->6
5-->7
6-->9 (exception)
7-->9
8-->10
9-->11
10-->12
And here it is for a Cylinder in tri mode - usually 4*q (half for sides and half for endcaps)
1-->4
2-->8
3-->12
4-->16
5-->20
6-->28 - exception
7-->28
8-->32
9-->36
10-->40
I've gone up to quality 40 for a cylinder with no problems.
The trouble, no matter how big you make the cylinder height, it is only one or two polygons vertically.
Right now, planes max out at quality 10.
Cubes don't max out in theory, but in practice a quality higher than 4 is astronomical.
Cylinders don't max out until at least 50 or more.
Sphere max out at quality 5.
I
think it would make sense to have more uniformity across the different
types of primitives. The Box quality seems to be the outlier.
Cheers,
Bruce
Posted by: Petit Mar 29 2007, 11:50 PM
QUOTE(zeusprod @ Mar 29 2007, 10:26 PM)

I
think it would make sense to have more uniformity across the different
types of primitives. The Box quality seems to be the outlier.
+1 on that one. It would make sense.
The box has its own type of dividing algorithm. It doesn't divide a side of the Box by q,
but for every step in q divides the side of each grid cell 2, so we get an exponential growth in the number of cells.
If
the quality setting would mean dividing each side by q, to get the grid
q *q, the growth would be quadratic, and it would be feasible to tune
the quality of textures on the Box.
Thanks for a thorough investigation!
Posted by: zeusprod Mar 30 2007, 12:44 AM
QUOTE(Petit @ Mar 29 2007, 06:50 PM)

Thanks for a thorough investigation!

I've technote-ified it here:
http://www.flashsandy.org/faq/quality
Cheers,
Bruce
Posted by: kiroukou Mar 30 2007, 08:12 AM
REally good research Bruce 
I
think I'll have to give a look at primitive anyway. They are working
nicely as they stand now, but the code isn't very readable. I'll try to
add more primitives too. Your Cone and Petit half Cylinder are great,
but more we do, the simplest the use will be.
Thanks for the new FAQ post! This is precious!
Posted by: zeusprod Mar 30 2007, 01:29 PM
QUOTE(kiroukou @ Mar 30 2007, 03:12 AM)

I
think I'll have to give a look at primitive anyway. They are working
nicely as they stand now, but the code isn't very readable. I'll try to
add more primitives too. Your Cone and Petit half Cylinder are great,
but more we do, the simplest the use will be.
What other primitives were you planning to add?
Text2D?
Text3D?
An Ellipsoid class (which the Sphere class would extend), which would accept different major and minor axes?
Those would be a lower priority for me than enhancing some of the existing primitives or supporting Petit's CylSurface class.
I'll commit the Sandy 1.2 version of CylSurface?
Where
should I commit the 1.1 version of CylSurface and Conic? (i.e., does
the 1.1 version of Sandy still exist anywhere in the repository?)
One more question:
Am
I correct that a box will accept a single texture, which it puts in all
six faces, but it doesn't automatically accept six textures (like a
photo-cube) and in that case, the programmer needs to apply the
textures manually to each face?
Cheers,
Bruce
Posted by: Petit Mar 30 2007, 02:22 PM
QUOTE(zeusprod @ Mar 30 2007, 01:29 PM)

Am
I correct that a box will accept a single texture, which it puts in all
six faces, but it doesn't automatically accept six textures (like a
photo-cube) and in that case, the programmer needs to apply the
textures manually to each face?
Short answer: Yes!
Long answer: The Box, class or any other primitive, doesn't take a list of textures to paste on its faces.
You have to get the array of faces, and paste the appropriate texture to each of them.
Hopefully the faces are ordered in such a way, that you can easily identify which texture goes on which face
Posted by: zeusprod Mar 30 2007, 02:35 PM
QUOTE(Petit @ Mar 30 2007, 09:22 AM)

The Box, class or any other primitive, doesn't take a list of textures to paste on its faces.
See the separateFaces argument I added to the 1.2 Conic class.
You still have to map the textures separately, but at least it optionally sets up the UV coords correctly to allow it.
Posted by: Petit Mar 30 2007, 03:13 PM
QUOTE(zeusprod @ Mar 30 2007, 12:44 AM)

I've technote-ified it here:
http://www.flashsandy.org/faq/quality
Like the other technote-ifications, this makes a lot of sense.
Thanks!

[Edit] It seems not to be linked from the FAQ summary page though.
Posted by: zeusprod Mar 30 2007, 04:02 PM
QUOTE(Petit @ Mar 30 2007, 10:13 AM)

Like the other technote-ifications, this makes a lot of sense.
Thanks!

[Edit] It seems not to be linked from the FAQ summary page though.
I cleaned up the FAQ page. It should be easier to find now, although I won't tell you where, so you can find it yourself.
Cheers,
Bruce
Posted by: Petit Mar 31 2007, 12:11 AM
QUOTE(zeusprod @ Mar 30 2007, 04:02 PM)

<snip>, although I won't tell you where, so you can find it yourself.
Oh, that was easy.
Really nice and clean!
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)