This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Bad textures in gles..


Bad textures in gles..

Postby RapchikProgrammer » Jan 9, 2010 @ 2:29pm

RapchikProgrammer
pm Member
 
Posts: 56
Joined: Oct 18, 2008 @ 7:08am


Postby edge » Jan 11, 2010 @ 9:03am

Hi,

The perspective shouldn't have influence on texture coordinates. Can you tell me if you're rendering your models manually or through an E3DSurface object?

The first thing I notice is that the first render uses linear interpolation when rendering the texture, while the second uses nearest neighbor interpolation. Is that intentional? If not, make sure the min and mag filters are set up properly for that texture.
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby RapchikProgrammer » Jan 12, 2010 @ 4:06am

Im rendering manually.. i am using shorts for vertices and texture coordinates.. i am then scaling the texture matrix by 1/32767 for the light map and XTiling/32767 and YTiling/32767 for the mesh texture to tile the texture.. i am using linear for min and mag filter.. you can see the difference between nearest and linear:

Linear:
Image

Image

Nearest:
Image

Image
RapchikProgrammer
pm Member
 
Posts: 56
Joined: Oct 18, 2008 @ 7:08am


Postby edge » Jan 12, 2010 @ 8:57am

Hi,

Alright, to solve your problem use different texture coordinates for OpenGL ES. It uses fixed point in 16:16 format which means you need to multiply each texture coordinate by 65536 (or shift 16 bits to the left). Pass GL_FIXED as the second parameter to glTexCoordPointer.
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby RapchikProgrammer » Jan 17, 2010 @ 6:26am

Hey, now a few questions.. firstly i fail to understand why this should help.. the only thing that this improves is the precision of the texture coordinates, and i have the same precision using shorts because i assign textures in -32767 and 32767 and translate and scale the matrix to get the same precision.. and just so you know it didnt help, even using floating point texture coords didnt help..

now another question, i have my own routines to render the code but nothing very fancy.. now the thing is, as far as i was using shorts for texture coords i could use vbo's on my n95 just fine.. but as soon as i use 4 byte data types, fixed/float my vbo overflows.. i have to render manually without vbos due to that, any clue why this might be happening? i thought when the space on the gpu fills up it pages the data on to ram..

any help would be appreciated, thanks..
RapchikProgrammer
pm Member
 
Posts: 56
Joined: Oct 18, 2008 @ 7:08am


Postby edge » Jan 21, 2010 @ 1:27pm

Hi,

Can you tell me exactly how the VBO overflows? Perhaps it's doing calculations which doesn't fit inside a 4-byte int (for example, multiplying high values).

I hope you can show me how you're transforming the texture coordinates. As far as I know those can only range from 0 to 1 (with the exception being fixed point for OpenGL ES)?
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Postby RapchikProgrammer » Jan 23, 2010 @ 9:53am

RapchikProgrammer
pm Member
 
Posts: 56
Joined: Oct 18, 2008 @ 7:08am


Postby edge » Jan 25, 2010 @ 9:12am

Hi,

Perhaps it's a better idea to start with something simple, and see where the problem comes from.

For example, start by rendering a textured cube (using your custom code). Then modify the texture matrix and finally set your own projection. This is the only way to find out where exactly it goes wrong.
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Return to EDGELIB


Sort


Forum Description

Powerful and affordable C++ middleware solution covering true multi-platform 2D, 3D and network features for Apple iPhone, Windows Mobile, Symbian S60, UIQ, Linux and Windows desktop.

Moderator:

edge

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron