jogl textrenderer has artefacts at the end of strings

dear all,

i am having problems with my current project. the text renderer works fine with normal amounts of text (about 1000 words at a time), but whenever i increase to more, i get ugly artefacts (fine broken lines) either at the end of each string, or beneath it. i am using the 3d rendering function, and a nighlty build. has this something to do with the sync (now markdirty) method not working properly?

if you need any more information about the code or setup, let me know.

many thanks in advance

micha

ok, found it myself.

edited the source of the text renderer so that it executes the debugging function:

 Graphics2D g = getGraphics2D();
  Composite composite = g.getComposite();
  g.setComposite(AlphaComposite.Clear);
  g.fillRect(r.x(), r.y(), r.w(), r.h());
  g.setComposite(composite);

in the method clearUnusedEntries always. that got rid of these ugly displayerrors. as i haven’t got the time at the moment to dig deeper into the source: can someone explain? and is this a bug, that should probably fixed?

It may very well be a bug. I fixed a bug not too long ago in this area but it should have propagated to the nightly builds by now. In order for us to diagnose and fix this, please provide a small and self-contained test case which shows the problem.

dear ken,

i will post an example as soon as i can find the time, currently working 24/7 on my diploma. hopefully i can find the time next week!

all the best and until then,

micha

just wanted to pop in and confirm this issue. it seems though, it only happens when text is rendered in 3D. so i suspect this is an artifact of the opengl texture wrapping. maybe set it to CLAMP?

Again, can someone provide a test case please?

ill see what i can do, though i think it is quite hard to provide a reasonabl test-case, since the issue depends on how the strings are layed out on the textrenderer-texture.

it mostly appears at the end of a string when the string is viewed enlarged and the next letter to the string on the texture is for example an uppercase “L” then, the pixels from the L would flow over to the previous string.

yepp, this is a good description…looks exactly like that, and these artefact are not the same, but always flicker, depending on the strings next to the original texture area.

here is a screenshot of the artefacts highlighted in red.

http://www.embege.com/misc/kl.png

this is jogl 1.1.0, java6, winxp, GF7300

OK, thanks for the screen shot. I think this is being caused by newer cards using more than just the adjacent pixel for texture interpolation and isn’t due to incorrect texture coordinates being computed. I’ve filed Issue 304 to track this.

are there any updates on this issue?
maybe it has something to do with the GL_CLAMP setting of the texture?

John Burkey is close to having a new glyph-based implementation of the TextRenderer ready to go. This will address the performance issues people have been encountering with the string-by-string caching the TextRenderer currently does, and I hope will also address this artifact issue. It should be checked in soon.

i was trying the latest nightlies and notices that the artifacts are gone.

so i guess these changes are checked in yet?

No, John’s new TextRenderer isn’t checked in yet. Probably this weekend. However, at least a couple of months ago more spacing was added between adjacent strings on the current TextRenderer’s backing store, so I actually would expect that the artifacts previously seen are already no longer present.

i have been using RC7 now for a while and i noticed a very small version of the artifacts occurring again.

here is a screenshot:

http://www.embege.com/misc/tr_artefacts.png

http://www.embege.com/misc/tr_artefacts.png

these artefacts do not occur as often as the ones in the “old” textrenderer.

Again can you provide a test case?

RC7 hasn’t been “officially” promoted – I’ve been swamped and wasn’t able to produce signed jars yet. Maybe today.