Log in or register to post comments

ScanLine bar does not move

March 13, 2013 - 6:09am #1

Hi,

I'm developping a plugin for a 3D engine. I already did it with the old api version and all was ok.

Now I used the new API. The could recognition is working but the problem is that the scanline does not move and no points are drawn over the background camera frame. The scanline is frozen on the center of the screen.

Have you an idea for this problem?

How do you render the scanline and the point? in the drawVideoBackground Call?

Thanks

 

PS: The new api is amazing

ScanLine bar does not move

November 28, 2013 - 2:07am #19

Hi,

The builded version not showing the scanline after adding client acces key to the project .

I have added the key to CloudReco.h and after that i have builded the app. I am getting the result after scanning the image but i cant see the scan line while scanning. What might be the problem?

 

Thanks

ScanLine bar does not move

March 26, 2013 - 9:50am #18

Ok. If you find anything with your engine code which is worth sharing with other developers who might have similar issues with their own engines, please feel free to post it here.

ScanLine bar does not move

March 26, 2013 - 9:45am #17

Yep, it seems that something is wrong in my code. I give up, and will code my own scanline.

But the fact the the video background works and not your scanline is very strange.

ScanLine bar does not move

March 26, 2013 - 9:36am #16

Ok. 

could you try with this basic renderFrame() function code:

// Clear color and depth buffer
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    // Get the state from QCAR and mark the beginning of a rendering section
    QCAR::State state = QCAR::Renderer::getInstance().begin();

    // Explicitly render the Video Background
    QCAR::Renderer::getInstance().drawVideoBackground();
  
    glDisable(GL_DEPTH_TEST);
   
    QCAR::Renderer::getInstance().end();

If everything else is correctly set in your app (i.e. if the targetfinder is correctlty initialized and started, etc.), then you should be able to see the video background and the scanline on top of it.

If you don't, then it means there is something else wrong in your code...

 

ScanLine bar does not move

March 26, 2013 - 9:02am #15

I started the finder since it recognize my cloud trackers, and the CloudReco sample is showing the scanline.

ScanLine bar does not move

March 26, 2013 - 8:55am #14

Ok. If the scanlines never appear (even when you don't render anything), it probably means that you have not started the TargetFinder;

have you ?

does the CloudReco sample (the official one, without any change) shows the scanline ?

 

ScanLine bar does not move

March 26, 2013 - 8:46am #13

The scanline do not appears even when I do not display any models, so no for the textures.

I do not call glClear except the one mentionned in your sample.

And I exactly do your sample to render.

 

 

ScanLine bar does not move

March 26, 2013 - 8:01am #12

Augment, note that the first part of the rendering (before you call your 3d engine code) should be like this:

// Clear color and depth buffer
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);


    // Get the state from QCAR and mark the beginning of a rendering section
    QCAR::State state = QCAR::Renderer::getInstance().begin();

    // Explicitly render the Video Background
    QCAR::Renderer::getInstance().drawVideoBackground();

    glEnable(GL_DEPTH_TEST);
    glEnable(GL_CULL_FACE);

Then,  things to check are for instance:

- does you engine clears the buffer (i.e. does it call glClear( ....) ?)

- does your engine binds some texture or FBO and "forgets" to unbind them ?

 

ScanLine bar does not move

March 26, 2013 - 7:51am #11

It does not changes anything :(

ScanLine bar does not move

March 26, 2013 - 7:37am #10

Hi again Augment,

thanks for the details:

indeed, doing it that way is not correct, as the QCAR::Renderer::getInstance().end() function needs to be called at the end;

so, the right way of rendering would be this:

QCAR::Renderer::getInstance().begin();
bool returnedValue = QCAR::Renderer::getInstance().drawVideoBackground();

// PUT YOUR ENGINE RENDER CODE HERE

QCAR::Renderer::getInstance().end();

 

 

ScanLine bar does not move

March 26, 2013 - 7:33am #9

We have our own engine, and we call

  QCAR::Renderer::getInstance().begin();
  bool returnedValue = QCAR::Renderer::getInstance().drawVideoBackground();
  QCAR::Renderer::getInstance().end();

 

before rendering anything else in openGL, maybe that's the problem.

 

ScanLine bar does not move

March 26, 2013 - 7:30am #8

Hi Augment,

are you also using you own 3D engine ? or can you share a bit of context for your case ?

 

ScanLine bar does not move

March 26, 2013 - 7:28am #7

We have a similar problem: everything works fine,

except that the scanline and the dots are not printed!

ScanLine bar does not move

March 13, 2013 - 9:45am #6

The animation of the scanline is essentially based on some displacement delta which depends on time and on the size of the videoconfig;

since you see the videobackground and everything else works fine, the videoconfig size is correctly set;

so, as you mention, there could be an issue with the time update for some reason, when using your engine...

I will check with our team to see if I can get more tips about this....

(....and on Unity it is done differently, so not relevant ) 

ScanLine bar does not move

March 13, 2013 - 9:15am #5

The problem is that the engine is proprietary and I don't have access to the opengl calls.

But if it was a shader problem, you use a glUseProgram to display the line so the engine shaders are not active, for the culling I see the line so I don't think there is a problem with the faces, depth testing is disable? For the VBO and FBO even I can t watch the openGL Objects used, I think you generate your own Objects and retrieve your index ID so....

What I don't understand is that I can see the line but it's not moving. If the problem was a Bound Object I could not see this line. 

I know that the 3D Engine is really well coded with cleanup/restore OpenGl state. Can you tell me how do you move the line? I call the QCAR::Renderer::getInstance().end(); at the end of the frame rendering of the engine maybe you are using a dt for your animation line that cannot be properly set because of the time between the engine frames? How do you handle the scanline effect with Unity?

Thanks

ScanLine bar does not move

March 13, 2013 - 8:31am #4

The points are also rendered together with the line;

for the rest, you should compare what your own rendering engine does with the basic OpenGL code used by the samples;

you can check any OpenGL state (what shaders you bind, what textures you bind, do you setup some GL_CULL_FACE settings, do you change the depth test or depth writing, do you use VBO or FBO ? these are all possible OpenGL settings that you need to properly cleanup / restore).

 

ScanLine bar does not move

March 13, 2013 - 7:46am #3

I did the changes but the line is always frozen. Should not it be a problem with the shader and the mvp you use to move the bar?

When do you render the points too, because the points does not show up too maybe there is a link?

ScanLine bar does not move

March 13, 2013 - 6:23am #2

Hi, the scanline and scanpoints are not rendererd in the drawVideoBackground(), but rather at the end of the rendering phase (when you call QCAR::Renderer::getInstance().end();).

You should check that your own rendering engine does not mess up with the OpenGL state, as that could be an issue; in particular, you may want to make sure to cleanup the state before calling QCAR::Renderer::getInstance().end();

 

glDisable(GL_DEPTH_TEST);
 
#ifdef USE_OPENGL_ES_1_1        
    glDisable(GL_TEXTURE_2D);
    glDisableClientState(GL_VERTEX_ARRAY);
    glDisableClientState(GL_NORMAL_ARRAY);
    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
#else
    glDisableVertexAttribArray(vertexHandle);
    glDisableVertexAttribArray(normalHandle);
    glDisableVertexAttribArray(textureCoordHandle);
 
    glActiveTexture(GL_TEXTURE1);
    glBindTexture(GL_TEXTURE_2D, 0);

 

    glActiveTexture(GL_TEXTURE0);
    glBindTexture(GL_TEXTURE_2D, 0);
 
Log in or register to post comments