Login  Register

Re: Problem with displaying the line segments

Posted by philjord on Apr 26, 2017; 11:08pm
URL: https://forum.jogamp.org/Problem-with-displaying-the-line-segments-tp4037890p4037902.html

world,
Thanks for this further testing, I don't get the any difference when setting and altering the initialRotation, I suspect it's because of the distance sorting issue I mentioned, where all cubes have the same center so they get rendered in an arbitrary order, and your system choose two different orders but mine doesn't.

In your ordered group example you've done what I did when I first tried it, which is to put all four of the objects into the ordered group, you'll notice I put only the lines in the ordered pass, to force them to run before the boxes. Putting the boxes all into ordered groups actually causes some boxes and lines to be not rendered at all, which I don't understand yet, and which I need to read more about the exact order of operations. Possibly the ordered pass forces depth writing for some reason.

Can you try it once more with anti-aliasing left on and

trans.addChild(new Box(w, w, w, app));
//trans.addChild(lineShape(w, lineColor));
og.addChild(lineShape(w, lineColor));

Another interesting point to note is that in a opaque line drawing situation there is a mechanism to stop these sorts of problems
PolygonAttributes polyAttr = new PolygonAttributes()
polyAttr.setCullFace(PolygonAttributes.CULL_NONE);
polyAttr.setPolygonOffset(0.2f);
polyAttr.setPolygonOffsetFactor(0.2f);

app.setPolygonAttributes(polyAttr);
This pulls the poly forward towards the screen and means it succeed at depth tests and gets nicely drawn over any other opaque poly that has the same depth.

Unfortunately in the transparent pass our lines are testing depth but not writing it so other transparent objects also draw, meaning the offset calls don't help.

You can do the same thing with some complex stencil buffer settings, but that's probably overkill




As you mentioned the white background shows through on the second frame and causes transparent colors to match up, it's easier to see the effects with a red background and a black background, otherwise you're eyes play tricks on you regarding what's drawn and what's not.

Thanks,
Phil.