"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Load textures from apk at runtime

Hey Guys,

Need help on a small thing. What i want to do is that i want to load textures from apk or from sdcard at runtime and be able to use them. I do not want to initialise them at the startup of the app e.g. if a user presses a button these textures should load from the sdcard or apk and be ready for use. Also i have got a basic idea that i can do this using the async task in background but not able to implement it i.e.what function calls to do in order to go complete the total loading process and update mtextures. Could somebody please give me some hints on how to move forward on this?

Thanks in advance,

Tarun

AlessandroB

Mon, 10/22/2012 - 09:18

It is certainly possible to load textures at runtime; to do that you will need to pay attention to the following (I’m referring to the ImageTargets sample to have a common point of

Hey,
Tried everything as you said and the textures are being loaded into the system. But when it comes to render the textures it turns out black(the image is 256*256). Not getting what the problem is? Any help or pointers please?

 

Thanks 

AlessandroB

Mon, 12/03/2012 - 11:27

Hi, can you paste here the relevant code snippets where you do:

1- create your textures in OpenGL (code with glGenTextures(...) and surrounding code)

2- bind your texture to render them (code with glBindTexture() and its surrounding code)

?

Hi.

 

i have the same problem, trying to load textures at run time does not work for me,

i found a work-around for the time beeing: i followed everything allesandroB suggested , as well as calling

Hi ozieg,

if I understand correctly, you call glTexImage at every rendering frame, are you?

Note that this should not be necessary, i.e. you should call glTexImage only if you detect that a new image has been loaded and a new texture must be created;

Hi AllessandroB.

 

thanks for your fast replay, i now managed to solve the issue and load textures at run-time

 

 

thanks alot

ozi

CarterBao

Sat, 08/13/2016 - 10:28

Hi! I just solved this problem and I'd like to share my methods with you. The key problem is not about the texture size( it doesn't need to be size of power of 2).