Log in or register to post comments

Really strange problem with textures

November 20, 2012 - 11:07pm #1

Hello, I have a really strange problem with textures. I using image markers to attach my 3d scene, and sometimes, the last object that I render have mixed their texture with the image of the video background!!!. I don't understand this behavior. The problem is fixed when I turn off - turn on the screen (is executed the onPause() method). Can someone explain this behavior???

Thanks in advanced:

elFerZur



Hi elFerZur, the process may

January 7, 2013 - 3:01am #26

Hi elFerZur, the process may still take some time as there are also other submissions under evaluation.

 

I'm working with new API 2.0,

January 7, 2013 - 1:41am #25

I'm working with new API 2.0, I like very much option of use custom pattern tacking one image from the camera!.

I don't hear back from Qualcomm within a few weeks about sharing my app (Share Your App with Qualcomm), they don't like my app?.

Regards.

 

@ elFerZur: hi elFerZur, you

December 17, 2012 - 6:08am #24

@ elFerZur:

hi elFerZur, you might be interested in trying out the new version of Vuforia SDK (2.0), which has been released few days ago.

This contains (beside lots of exciting new features) a fix for the video background texture issue; I believe there are good chances that this will also fix your problem with wierd textures (although you already implemented a workaround).

 

Hi masonhsiung, indeed the

December 14, 2012 - 7:34am #23

Hi masonhsiung,

indeed the issue looks somewhat similar (although in your case you use the SurfaceTexture, so there is some difference..).

I will follow up with you on the other Thread where you already posted your issue.

 

Really strange problem with textures

December 13, 2012 - 5:50am #22

Hi, I found this texture issue is kind of similar to mine, and it also happens on my Samsung Galaxy S2.

If I try to render video on the texture with SurfaceTexture(java), the SurfaceTexture failed to updateTexImage ( if I catch the exception, the video plays upside down).

If I use the texture with some images, then the texture is mixing with the camera video background, just like the issue what elFerZur has.

Unfortunately, I haven't been able to find workaround for this issue..

Here I have posted another topic for my issue - https://ar.qualcomm.at/content/surfacetexture-fails-updateteximageon-samsung-galaxy-s2

Thanks.

Really strange problem with textures

December 6, 2012 - 7:01am #21

Yeah, I see your app showing first in the list!

If you don't hear back from Qualcomm within a few weeks, send me a ping.

Really strange problem with textures

December 5, 2012 - 2:48am #20

O.K. I wait.

Curiously, when you search "Vuforia" at Google Play, my app appears in first place.

Regards:

elFerZur

Really strange problem with textures

December 4, 2012 - 12:54am #19

Hi, I verified that your App submission has been received; there is no issue with that, you App is listed for review, but this may take some time, as there are many other submissions under review as well.

When we have some news, you will be notified, don't worry.

 

Really strange problem with textures

December 3, 2012 - 3:59am #18

I submit the app without errors at Share Your App with Qualcomm , but nobody tell me something...

I don't know if you receive my request correctly.

 

Really strange problem with textures

December 3, 2012 - 3:45am #17

If I understand, you have succesfully submitted you App, but nobody answered to you yet with feedback;

or did you get any error/problem during the submission itself..?

 

Really strange problem with textures

December 3, 2012 - 12:38am #16

Hello, I try in many different phones (Samsung SII, SIII,HTC) and the problem is the same....

Another question, I trying to add my application to "Featured Vuforia Augmented Reality Apps" using the form (Share Your App with Qualcomm), but but I did not answer. What are the requeriments to add my application to the list???.

Thanks in advanced:

elFerZur

Really strange problem with textures

November 26, 2012 - 10:17am #15

I see.

Good that you can at least solve it with the "extra object" trick; did you try this on different devices ? I'm wondering if this is maybe an OpenGL driver bug on some phones, as it sounds really strange.

Really strange problem with textures

November 26, 2012 - 4:06am #14

Hi, currently I not using refection in AR View, only shadows is showing, and I not use multiple texture units in my code. Shadows are painting rendering the objects triangles another time applying proyection matrix and without textures.

I don't use any API to render objects, I working with opengl directly.

The problem is solved mysteriously when background texture is not next to any other "working" texture.

 

 

Really strange problem with textures

November 23, 2012 - 7:08am #13

What looks suspicious in your Java code is also the shadow / reflection rendering; those features certianly use texturing in some ways (probably on multiple texture units) and might as well cause some troubles; have you tried rendering the objects with no shadows/reflection enabled ?

 

Really strange problem with textures

November 22, 2012 - 9:04am #12

I really do not understand this behavior, the texture that is next to the background texture is mixing, and only when the number of textures is even.

I fix this problem adding fake object that create a texture that is not using to render, and always in last position. If background texture is not close to other texture, all works fine.

I would like understand why is happing this....

¿Do you try the app in your mobile, it's working wrong like me?

Thank you very much for your help

Really strange problem with textures

November 22, 2012 - 8:24am #11

This is probably due to the fact that the video background texture is laily initialized and probably it gets created AFTER your application textures are created;

so for instance your textures will get IDs 1,2,3,4,5  and the background will get texture ID = 6.

This is an interesting point, as it somehow explains why it is the last object in  your list to be always affected by the problem you mentioned (and not the first object for instance).

Beside that, I'm still not clear why it happens for an odd number of objects and not for an even number (or vice versa...).

 

Really strange problem with textures

November 22, 2012 - 8:04am #10

One question, my textureId's always start at number 1. If background paint happens first at every frame, why my textureId not start with 2???. TextureId number 1 must be the background quad texture???. How is binding the background texture ?

Really strange problem with textures

November 22, 2012 - 5:09am #9

Yeah, that's really weird; I see that you use a special Java API there; is that your own API or does it come from an external library ?

My guess is that there is some issu/bug in the way that custom/external API handles the OpenGL state;

if that's the case, there is not much I can do to help;

all I can say is that Vuforia renders the video background as a texture and this texture is bound to texture unit 0; 

if everything else is fully correct on the OpenGL side of your application, then this should not cause particular problems..

 

Really strange problem with textures

November 22, 2012 - 2:28am #8

Hi, I think that I have a pattern for the error: only works wrong with the last even object of the list. If there is one object, it paints correct, if two objects, second paint wrong, is there is three objects, paint all correct, if there is four objects, last paint wrong, if there is five objects, paint all correct, if there is six objects, last paint wrong... It have any sense????

Really strange problem with textures

November 22, 2012 - 2:04am #7

How many objects do you render from Java ? if you reduce the number of objects rendered (e.g. only render the first 3 and skip the rest, or so),

do you still see the problem (and always ont he last one) ?

Really strange problem with textures

November 22, 2012 - 1:59am #6

Hi, I make the changes, but nothing is changed, it still not works fine.

I'm using opengl 1.1, maybe I must include glClientActiveTexture sentences?.

¿Why the only object that mixing their texture with background is the last that it render?. I don't understand this....

Really strange problem with textures

November 22, 2012 - 1:17am #5

Hi, it might be due to OpenGL picking up the background texture which is still left in "binding" state from the native renderFrame();

could you add the following code inside the native renderFrame() function (in C++), right at the end of the function, i.e. just before exiting the function (please copy it exactly, with the lines in the same order as I paste them here):

glActiveTexture(GL_TEXTURE1);

glBindTexture(GL_TEXTURE_2D, 0);

glActiveTexture(GL_TEXTURE0);

glBindTexture(GL_TEXTURE_2D, 0);

And then do kind of the same in your Java code right after your "for" loop that renders your objects:

gl.glActiveTexture(GL.GL_TEXTURE1);

gl.glBindTexture(GL.GL_TEXTURE_2D, 0);

gl.glActiveTexture(GL.GL_TEXTURE0);

gl.glBindTexture(GL.GL_TEXTURE_2D, 0);

 

Really strange problem with textures

November 21, 2012 - 11:25pm #4

My render code:

        //Call native function
        renderFrame();

        gl.glEnable(GL10.GL_DEPTH_TEST);
        gl.glEnable(GL10.GL_CULL_FACE);
        gl.glEnable(GL10.GL_LIGHTING);   
        gl.glEnable(GL10.GL_LIGHT0);
        gl.glEnable(GL10.GL_BLEND);
       
        float[] lightPosition ={
                StaticReferences.mainWorld.lightPosition[0]*StaticReferences.AR_VIEW_SCALE,
                -StaticReferences.mainWorld.lightPosition[2]*StaticReferences.AR_VIEW_SCALE,
                StaticReferences.mainWorld.lightPosition[1]*StaticReferences.AR_VIEW_SCALE,
                StaticReferences.mainWorld.lightPosition[3]
        };
        gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, lightPosition,0);

        //Render our World
        for (IOpenGlObject openglObject:StaticReferences.mainWorld.adminGlObjectsBefore){
            if (openglObject.isVisible()){
                if (openglObject instanceof IGroundPlaneShadowObject){
                    ((IGroundPlaneShadowObject)openglObject).drawAR(
                            gl,
                            StaticReferences.mainWorld.userGlObjects,
                            lightPosition,
                            StaticReferences.mainWorld.shadowsActive,
                            StaticReferences.mainWorld.reflectionsActive);
                }   
            }
        }
       
        List<UserGlObjectAbs> userObjects=StaticReferences.mainWorld.userGlObjects;
        for (UserGlObjectAbs userObject:userObjects){
            if (userObject.visible){
                if ((userObject.texture!=null)&&(!userObject.texture.isEmulatedTexture()))
                    userObject.texture.setFilters(gl,GL10.GL_LINEAR, GL10.GL_NEAREST);
                userObject.draw(
                    gl,
                    false,
                    false,
                    true);
            }
        }
               
        gl.glDisable(GL10.GL_DEPTH_TEST);
        gl.glDisable(GL10.GL_CULL_FACE);
        gl.glDisable(GL10.GL_LIGHTING);
        gl.glDisable(GL10.GL_LIGHT0);
        gl.glDisable(GL10.GL_BLEND);
        //Final render
        postRenderFrame();

I don't understand why the last object is mixing their texture with background texture...

 

Really strange problem with textures

November 21, 2012 - 7:17am #3

My render code is not on "C++" code, I rendering the objects from java code. I recopile the code and I will send you.

You can view the problem if you install the android application at https://play.google.com/store/apps/details?id=com.modela3d

Problem occurs when:

1.- Draw some objects.

2.- Go to AR view. Works fine.

3.- Return to normal view.

4.- Add some other object.

5.- Go again to AR View.

6.- This last object is mixing the texture asigned with background.

Thanks in advanced:

elFerZur

 

 

Really strange problem with textures

November 21, 2012 - 7:03am #2

Hi,

it looks like there is some issue with the OpenGL texture binding (as the QCAR background also is a texture);

could you post the relevant code snippet of your _renderFrame() method ?

 

Log in or register to post comments