Log in or register to post comments

drawVideoBackground() kills my text engine?

December 11, 2014 - 11:50am #1

Hello from germany :)

I have some problems using different text engines to draw text in openGL ES 2.0 with the vuforia SDK with Android (Java). I know the different approaches (texture atlas, generate bitmap, ...), but none of the different engines seems to work for me...

Now I'm using the textengine from this site: http://androidblog.reindustries.com/a-real-opengl-es-2-0-2d-tutorial-part-8-rendering-text/

When everything in the renderFrame() function is commented out, it works perfect:

void renderFrame()
    {
        GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);
        //Create a new Textmanager (tm) with default text
        SetupText();
        
        if(tm!=null)
			tm.Draw(mtrxProjectionAndView,0);
}

But as soon as I uncomment the drawVideoBackground() function, it doesn't render correctly:

void renderFrame()
    {
        GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);

        State state = Renderer.getInstance().begin();
        
        //no more text, just black fields
        Renderer.getInstance().drawVideoBackground();
        
        //Create a new Textmanager (tm) with default text
        SetupText();
        
        if(tm!=null)
			tm.Draw(mtrxProjectionAndView,0);

        Renderer.getInstance().end();
}

It looks the same if I comment out the drawVideoBackground() call and enable GL_DEPTH_TEST. But with the drawVideo call it makes no difference whether GL_DEPTH_TEST is activated or not. 

So I think, the text-engine is working, but something is weird, I'm missing something or so...

Thanks for your help,

Steffen

drawVideoBackground() kills my text engine?

April 13, 2017 - 8:39am #5

Hello,



I am trying to adapt a text rendering engine to my Android application using the Vuforia SDK in Java.

 

I used the same tutorial as you (http://androidblog.reindustries.com/a-real-opengl-es-2-0-2d-tutorial-part-8-rendering-text/) to adapt it to the Vuforia-OpenGL Structure and I am facing exactly the same issue : the first letter of each word is drawn correctly while the others are only distinguishable but not properly drawn.



Did you overcome this issue ? If not, did you find another solution / approach / tutorial / library / ... to be able to draw text using Vuforia and OpenGL mechanisms ? 

Thanks for your reply !

drawVideoBackground() kills my text engine?

January 10, 2017 - 12:44am #4

Did you solve your problem?

I need help   e-mail :  sirius@oneworldtech.net

drawVideoBackground() kills my text engine?

January 10, 2017 - 12:42am #3

brotleuchte wrote:

Hello from germany :)

I have some problems using different text engines to draw text in openGL ES 2.0 with the vuforia SDK with Android (Java). I know the different approaches (texture atlas, generate bitmap, ...), but none of the different engines seems to work for me...

Now I'm using the textengine from this site: http://androidblog.reindustries.com/a-real-opengl-es-2-0-2d-tutorial-part-8-rendering-text/

When everything in the renderFrame() function is commented out, it works perfect:

void renderFrame()
    {
        GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);
        //Create a new Textmanager (tm) with default text
        SetupText();
        
        if(tm!=null)
			tm.Draw(mtrxProjectionAndView,0);
}

But as soon as I uncomment the drawVideoBackground() function, it doesn't render correctly:

void renderFrame()
    {
        GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);

        State state = Renderer.getInstance().begin();
        
        //no more text, just black fields
        Renderer.getInstance().drawVideoBackground();
        
        //Create a new Textmanager (tm) with default text
        SetupText();
        
        if(tm!=null)
			tm.Draw(mtrxProjectionAndView,0);

        Renderer.getInstance().end();
}

It looks the same if I comment out the drawVideoBackground() call and enable GL_DEPTH_TEST. But with the drawVideo call it makes no difference whether GL_DEPTH_TEST is activated or not. 

So I think, the text-engine is working, but something is weird, I'm missing something or so...

Thanks for your help,

Steffen

drawVideoBackground() breaks up dynamic loaded textures

December 13, 2014 - 7:02am #2

I've found a  workaround.

I'm creating Bitmaps, draw Text on a Canvas and use them as a Texture. For one text-string, one texture. Not as efficient as the texture atlas method by the way...

Problem with new method:

If textures were loaded at runtime AFTER the drawVideoBackgound()-call, the textureID starts at 4, not at 1.

Because of the wrong textureIDs, i got the same problems with the glitching / overlaying videobackground textures as before SDK 2.0 (I'm using 3.0.9):

https://developer.vuforia.com/forum/android/really-strange-problem-textures&sort=2

https://developer.vuforia.com/forum/device-support/surfacetexture-fails-updateteximageon-samsung-galaxy-s2

 

It would be helpful for others, if this could be mentioned in the Knowledge Base.

 

I can't get the atlas method to work with vuforia....

Log in or register to post comments