I don’t understand it either. If I use tile6 param set to true, according to docs, I expect to give 2x3 bitmapData wrapped in BitmapMaterial as an input where unit of this measure is power of two. However it yells that given material is not power of two! How can it be power of two when what I need is 2:3 ratio!?
I didn’t take a look at the provided source code, but this seems to need some clarification to understand how textures work.
1. Yes, their sides need to be of length of power of two.
2. No, textures do not need to be square.
How to fit a 3 by 2 ratio into that? Anyway you want, as long as you respect 1. and 2.
In Photoshop, you can create a bitmap with a 3 by 2 ratio of sides, showing the six faces of the cube, each square. But to be able to load it as texture and upload it to the graphics card, you need to transform it in a way to comply with 1. and 2. So, e.g., you could simply change the size of the bitmap to be a square. Of course, that will distort the six square faces of the cube and make non-square rectangles out of them. But that will be automatically corrected and mapped correctly by the GPU. That is done relying on the UV coordinates.
UV coordinates always range from 0 to 1 on each axis, where 0::0 is the upper left corner and 1::1 the lower right one. It doesn’t matter which aspect ratio or size a texture has, these coordinates will always be applied.
So you could, for instance, use a 128x2048 px bitmap to map on the cube. If the UV coords are set to six equally sized rectangles (3 by 2 grid, first row: 0::0 to 0.33::0.5, 0.33::0 to 0.66::0.5, 0.66::0 to 1::0.5, second row: 0::0.5 to 0.33::1, 0.33::0.5 to 0.66::1, 0.66::0.5 to 1::1), the coordinates of the pixels actually drawn on the geometry are calculated by multiplying an interpolated UV coordinate of the current pixel to draw with the length of the corresponding side of the texture.
So the center pixel of the upper left rectangle within that 3 by 2 grid would be located at (0.33 - 0) * 0.5 * 128 :: (0.5 - 0) * 0.5 * 2048, which is 21.333::512.
I don’t know how much my explanations you’ve already known, but I hope there was at least something new for you =)
JohnBrookes, Sr. Member Posted: 16 August 2011 10:44 AM Total Posts: 546
[ # 17 ]
yeah the latest beta2 player readme
Enhanced high resolution bitmap support — BitmapData objects are no longer limited to a maximum
resolution of 16 megapixels (16,777,215 pixels), and maximum bitmap width/height is no longer limited to
8,191 pixels, enabling the development of apps that utilize very large bitmaps.
But isn’t the size also limited by the GPU itself?
jansensan, Newbie Posted: 16 August 2011 12:03 PM Total Posts: 16
[ # 18 ]
Ringo Blanken - 16 August 2011 07:57 AM
Amon he talks about a 2x3 grid, what I see in his picture is a 3x2 grid.
Ringo, I had originally tested with a 2x3 grid, but the results were worse. I removed the correction 80prozent had provided so you see what happens if I take the code as downloaded with a 2x3 grid.
Amon, Newbie Posted: 16 August 2011 12:11 PM Total Posts: 15
[ # 19 ]
Yep… I’ve tried the same… 2x3 or 3x2 (square bmpd 1024 or 2048 pix per dim) it doesn’t work
80prozent, Sr. Member Posted: 16 August 2011 11:10 PM Total Posts: 335
[ # 20 ]
@ringo: befor i changed any code in cube.as, i tested varius 2x3, 3x2 grids for 6-tiled textures. none worked.
edit: ups…didnt realised their was allready a secound side for this thread…
BlackSheep, Newbie Posted: 12 September 2011 10:18 AM Total Posts: 1
[ # 21 ]
This is my first post on Away3d Forums and I had similiar trouble to other people who have posted on this thread but have to say the fix by 80prozent worked quite nicely for me, however I have some questions surrounding the skybox, Im currently building for the flash player 11 beta release, had to do another fix surrounding the viewport that was posted by another coder in order to get anything to build first off so my question is just a general wonderment about wether people are experiencing the same problem as me. I’m having trouble displaying a skybox, the error i get is around me not providing all the correct mip map levels for the skybox, this error also occurs on the broomstick example water demo so i know its not my code or my textures, however i able to run the example of the water demo off the website, so could I have broken the skybox myself by implementing the Cube UV fix or by implementing the ViewPort fix ? Does anyone have a skybox running correctly from their own source on Flash Player 11 Beta or is this a known problem? Thanks all
I’ve managed to get the cube displaying what it should, but it looks ver poor indeed, due to the texture being stretched out and then squashed back again… The tile6 method might work for cubes which are roughly equal in all dimensions, but for my purpose, a DVD case, it doesn’t look very good at all…
Mybe I would be better off making an actual DVD case in blender, and then writing the covers over the imported UV… Hmmm…
Actually, having looked again, it is actually alright, solong as the mouse isn’t moving, which for some reason blurs the textures… It’s also happening on the texture of my imported .obj, but only in one area..
ddddesigns, Newbie Posted: 14 September 2011 05:50 PM Total Posts: 19
[ # 25 ]
Yep weird, adding them without mouseEnabled = true; and it;s all fine…
I would show you an example but I get sandbox security errors with it live (never did quite understand what needed to be done with the .xml for that in order to get it to work, maybe now’s the time to find out….)