About Store Forum Documentation Contact
Donations:
158$/mo



Post Reply 
[iOS] Vertex Index Buffer
Author Message
MrPi Offline
Member

Post: #1
[iOS] Vertex Index Buffer
I'm using this code to circumvent the missing 2d/3d render combine mode on iOS.

PHP Code:
case RM_BLEND:
      {
         
SetMatrix();
         
Vtx3DTex v[4];
         
v[0].pos.set(3.7, -2.084, -1); v[0].tex.set(01);
         
v[1].pos.set(3.72.084, -1); v[1].tex.set(00);
         
v[2].pos.set(-3.72.084, -1); v[2].tex.set(10);
         
v[3].pos.set(-3.7, -2.084, -1); v[3].tex.set(11);
         
VI.image(_image());
         
VI.face(v[0], v[1], v[2], v[3]);
         
VI.end(); 
         break;
      } 

It renders an image fullscreen and works on both Windows and Mac OSX, but on iOS the result is this:

   

Any tip how this can be fixed?
Thank you in advance!
12-18-2013 09:04 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: [iOS] Vertex Index Buffer
Hi,
And what was the expected result?
Can you attach the image that you're using? In its original form.
I think I know what could be the issue.
The image size is not a power of 2?
I do handle this for Image.draw* functions, but I don't think it's handled in some of VI rendering.
If you can attach the expected result, then I'll provide more info.
Thank you
12-19-2013 12:42 AM
Find all posts by this user Quote this message in a reply
MrPi Offline
Member

Post: #3
RE: [iOS] Vertex Index Buffer
The expected result is that the image covers the entire screen without these stretches. The clean part on the top left is almost everything of the image.
Again, this works on Windows and Mac. I also tried clicking "Power of 2" in the image editor, but the result was pretty much the same.

Attached is the source file. I had to compress it to jpg because of the forum limits. It's not created by us, just some sample downloaded from Google for testing.


Attached File(s) Image(s)
   
(This post was last modified: 12-19-2013 01:05 AM by MrPi.)
12-19-2013 01:03 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: [iOS] Vertex Index Buffer
Thank you, this is related to:
-texture non power of 2 size
-auto conversion to iOS PVRTC pow2 and square size
-the fact the VI (for 3d faces at least) doesn't handle properly non-pow 2 sizes

I'll try to do something about it for next release.
12-19-2013 01:06 AM
Find all posts by this user Quote this message in a reply
MrPi Offline
Member

Post: #5
RE: [iOS] Vertex Index Buffer
I have manually resized the source image to a power of 2 and then it worked.
So I guess the only problem is the automatic resizing/conversion in the background.
12-19-2013 03:19 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: [iOS] Vertex Index Buffer
This will work ok in next release as long as you set
VI.image(..
before
VI.face(
12-21-2013 05:11 AM
Find all posts by this user Quote this message in a reply
Post Reply