Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I've had some issues with the com.jogamp.opengl.util.awt.TextRenderer. Namely, it seems to leave something in a strange state such that my own VBO code crashes after using this class to render text on some ATI graphics cards. For now I have a workaround that calling setUseVertexArrays(false) fixes my issues.
I did a little research and it seems that this class has been abandoned for the better com.jogamp.graph.curve.opengl.TextRenderer. However, I am unable to figure out exactly how to use this class and I can't find a good example either. Can anyone provide an example of how to use this class to draw text on the screen. Specifically I'm interested in 2 scenarios: 1. Drawing text on a Heads Up Display with statistics. This will always be done in Ortho 2D. 2. Drawing labels near items in my 3D scene. These labels will always be "billboarded" toward the camera, but they will move with respect to the camera. This will be done in Perspective 3D, but as mentioned they will always face the camera. Thanks! Luke |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
Hi
I had the same problem, it didn't occur anymore once I unbind my VBOs correctly, I didn't try to use another text renderer. The best way to avoid these crash consists in avoiding using VBOs when the text renderer uses only vertex arrays, which happens with graphics cards supporting VBOs but not OpenGL 1.5, it was the case of my previous graphics card ATI Radeon 9250 Pro.
Julien Gouesse | Personal blog | Website
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Can you elaborate on what you mean by "unbind my VBOs correctly"?
After every glBindBuffer call, I have a matching glBindBuffer call that binds it to 0. Is that what you mean? I'm still getting issues though. Also, the ATI graphics card and driver I'm using have GL 1.5 available. The card is a Radeon HD 5700 series with the latest driver. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
That's what I meant. I think that you get crash because of interlacing calls to the text renderer and calls to other drawings. Do you use some VBOs between the beginning and the end of text rendering?
Julien Gouesse | Personal blog | Website
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
So I wasn't actually getting a crash (though I've seen the issue you are talking about on the older ATI cards). My vertex array was just getting messed up and things weren't displaying where they should be. I have tracked it down and I figured out that it was because I was not calling glVertexAttribPointer before every glDrawElements. I was just calling it once after every glBufferData.
For some reason on NVidia hardware, this wasn't a problem, but on ATI hardware I have to call glVertexAttribPointer again before every glDrawElements when I use the TextRenderer. My guess is that this is a property that gets push'd/pop'd on NVidia hardware and not on ATI hardware, probably due to some ambiguity in the OpenGL specification. I would still like to know how the other TextRenderer class works though, especially if it performs better. It's in the code base, why not have an example showing how to use it, right? Thanks! Luke |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
In reply to this post by lukej
In preparation of reviewing our graph package, I have pushed a one-file unit test
hopefully describing the new graph text renderer: http://jogamp.org/git/?p=jogl.git;a=blob;f=src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT00.java;hb=HEAD The other unit test / demos are here: http://jogamp.org/git/?p=jogl.git;a=tree;f=src/test/com/jogamp/opengl/test/junit/graph;hb=HEAD http://jogamp.org/git/?p=jogl.git;a=tree;f=src/test/com/jogamp/opengl/test/junit/graph/demos;hb=HEAD http://jogamp.org/git/?p=jogl.git;a=tree;f=src/test/com/jogamp/opengl/test/junit/graph/demos/ui;hb=HEAD Goal is to solve the 'setup' performance problem: http://forum.jogamp.org/Best-way-to-drawing-a-lot-of-strings-td3893249.html and to clarify the API. |
Free forum by Nabble | Edit this page |