JOGL3Viewer doesn't support the transparency?

jReality backends
Post Reply
cznlzq
Posts: 17
Joined: Mon 5. Mar 2012, 22:55

JOGL3Viewer doesn't support the transparency?

Post by cznlzq » Fri 1. Nov 2013, 22:27

I got the latest version from git.

Test the LineShaderExample a little bit.

The JOGLViewer has the transparency but the JOGL3Viewer doesn't.

Shouldn't be my PC problem since the JOGLViewer works.

Just curious it's a bug or what?

Thanks.

benjamin.kutschan
Posts: 48
Joined: Mon 16. May 2011, 16:29

Re: JOGL3Viewer doesn't support the transparency?

Post by benjamin.kutschan » Mon 4. Nov 2013, 19:11

Ah, I see. If you have an IndexedFaceSet, then the jogl3-Viewer supports order-independent transparency. However, in the LineShaderExample you have a LineSet, where the edges have the transparency attribute.

When writing the jogl3-backend I saw no use for transparent edges. So I didn't implement them. But if needed that could be added I think.

cznlzq
Posts: 17
Joined: Mon 5. Mar 2012, 22:55

Re: JOGL3Viewer doesn't support the transparency?

Post by cznlzq » Tue 5. Nov 2013, 18:40

It looks like the transparency for the IndexedFaceSet is not working either.

I'm running the Intro02.java, for the JOGLViewer, I set the transparency to 0.6, the result is like this:
CaptureOld.PNG
CaptureOld.PNG (233.95 KiB) Viewed 2899 times
However, when I switch it to the JOGL3Viewer, the same transparency, the result is like this:
CaptureNew.PNG
CaptureNew.PNG (164.08 KiB) Viewed 2899 times
Probably I need some settings? How can I enable the order-independent transparency?

And for the IndexedLineSet,
I think the line in JReality has two options, one is to draw the openGL line, one is to draw the tube as the line.
Both of them have the transparency support in the JOGLViewer.

Could you please add that for the IndexedLineSet in the jogl3-backend?

Thank you.
benjamin.kutschan wrote:Ah, I see. If you have an IndexedFaceSet, then the jogl3-Viewer supports order-independent transparency. However, in the LineShaderExample you have a LineSet, where the edges have the transparency attribute.

When writing the jogl3-backend I saw no use for transparent edges. So I didn't implement them. But if needed that could be added I think.

benjamin.kutschan
Posts: 48
Joined: Mon 16. May 2011, 16:29

Re: JOGL3Viewer doesn't support the transparency?

Post by benjamin.kutschan » Wed 6. Nov 2013, 11:19

Hi,

are you using the newest version of jReality from git?
[url]git://gitorious.org/jreality/jreality.git[/url]

If I enable transparency in the RenderingHintsShader of the "root appearance" and set the transparency value in the polygonShader of the Appearance of the dodecahedron, then it works in both backends. How are you enabling transparency?

And about the transparent lines: Maybe I find time in December. Not sure yet. Sorry.

benjamin.kutschan
Posts: 48
Joined: Mon 16. May 2011, 16:29

Re: JOGL3Viewer doesn't support the transparency?

Post by benjamin.kutschan » Wed 6. Nov 2013, 11:22

Hmm. Appears that you're enabling the transparency as I do. Can you post your system configuration (GPU, OS, graphics driver version)?

cznlzq
Posts: 17
Joined: Mon 5. Mar 2012, 22:55

Re: JOGL3Viewer doesn't support the transparency?

Post by cznlzq » Wed 6. Nov 2013, 18:57

Windows 7,

Driver like this:
CaptureDriver.PNG
CaptureDriver.PNG (2.68 KiB) Viewed 2885 times
benjamin.kutschan wrote:Hmm. Appears that you're enabling the transparency as I do. Can you post your system configuration (GPU, OS, graphics driver version)?

cznlzq
Posts: 17
Joined: Mon 5. Mar 2012, 22:55

Re: JOGL3Viewer doesn't support the transparency?

Post by cznlzq » Wed 6. Nov 2013, 19:05

I'm glad that you will work on it sooner or later.

I think the transparent lines are great and important features in JReality.

The JOGL3Viewer is supposed to be better than the JOGLViewer.
Or at least it's reasonable to make them consistent as the JOGLViewer, right? :P

benjamin.kutschan wrote:Hi,

are you using the newest version of jReality from git?
[url]git://gitorious.org/jreality/jreality.git[/url]

If I enable transparency in the RenderingHintsShader of the "root appearance" and set the transparency value in the polygonShader of the Appearance of the dodecahedron, then it works in both backends. How are you enabling transparency?

And about the transparent lines: Maybe I find time in December. Not sure yet. Sorry.

benjamin.kutschan
Posts: 48
Joined: Mon 16. May 2011, 16:29

Re: JOGL3Viewer doesn't support the transparency?

Post by benjamin.kutschan » Fri 8. Nov 2013, 18:20

Probier mal den Treiber der Version 13.9.
Mit anderen Treibern haben wir's auf unseren Radeons auch nicht zum Laufen gekriegt.

Gruß
Benjamin

cznlzq
Posts: 17
Joined: Mon 5. Mar 2012, 22:55

Re: JOGL3Viewer doesn't support the transparency?

Post by cznlzq » Thu 5. Dec 2013, 19:12

Some updates.

Without updating the drivers,

tested with the DepthPeeling.java by adding the gl.glDrawBuffer(gl.GL_NONE);
in the public void peelDepth(GL3 gl) function can make the transparency correctly.

public void peelDepth(GL3 gl){

gl.glViewport(0, 0, width, height);

gl.glEnable(gl.GL_TEXTURE_2D);
gl.glActiveTexture(gl.GL_TEXTURE0);
gl.glBindTexture(gl.GL_TEXTURE_2D, texs[1]);
depth.useShader(gl);

gl.glUniform1i(gl.glGetUniformLocation(transp.shaderprogram, "image"), 0);
gl.glUniform1i(gl.glGetUniformLocation(transp.shaderprogram, "width"), width);
gl.glUniform1i(gl.glGetUniformLocation(transp.shaderprogram, "height"), height);

gl.glClearColor(0, 0, 0, 1);
gl.glClear(gl.GL_COLOR_BUFFER_BIT);
gl.glClearDepth(1);
gl.glClear(gl.GL_DEPTH_BUFFER_BIT);


gl.glBindBuffer(gl.GL_ARRAY_BUFFER, quadVerts.getID());
gl.glVertexAttribPointer(gl.glGetAttribLocation(depth.shaderprogram, quadVerts.getName()), quadVerts.getElementSize(), quadVerts.getType(), false, 0, 0);
gl.glEnableVertexAttribArray(gl.glGetAttribLocation(depth.shaderprogram, quadVerts.getName()));

gl.glDrawBuffer(gl.GL_NONE);

gl.glDrawArrays(gl.GL_TRIANGLES, 0, quadVerts.getLength()/4);

gl.glDisableVertexAttribArray(gl.glGetAttribLocation(depth.shaderprogram, quadVerts.getName()));

depth.dontUseShader(gl);
}
benjamin.kutschan wrote:Probier mal den Treiber der Version 13.9.
Mit anderen Treibern haben wir's auf unseren Radeons auch nicht zum Laufen gekriegt.

Gruß
Benjamin

benjamin.kutschan
Posts: 48
Joined: Mon 16. May 2011, 16:29

Re: JOGL3Viewer doesn't support the transparency?

Post by benjamin.kutschan » Mon 9. Dec 2013, 18:12

Can you explain what this command (glDrawBuffer) exactly does in this case?

cznlzq
Posts: 17
Joined: Mon 5. Mar 2012, 22:55

Re: JOGL3Viewer doesn't support the transparency?

Post by cznlzq » Tue 10. Dec 2013, 00:59

In DepthPeeling.java, two FBOs are used.
One of them mount with the color and depth
and the other one mount with only the depth.

glDrawBuffer with GL_NONE means No color buffers are written
which fits the one with the depth only.
benjamin.kutschan wrote:Can you explain what this command (glDrawBuffer) exactly does in this case?

cznlzq
Posts: 17
Joined: Mon 5. Mar 2012, 22:55

Re: JOGL3Viewer doesn't support the transparency?

Post by cznlzq » Tue 26. Aug 2014, 16:19

Hi,

Besides LineShaderExample is still not working using JOGL3Viewer,
Just let you guys know that the ClippingPlaneExample doesn't work either if I use the JOGL3Viewer.

It looks like we have a long way to go if we want the same feature of the old viewer.

Thanks.
cznlzq wrote:I'm glad that you will work on it sooner or later.

I think the transparent lines are great and important features in JReality.

The JOGL3Viewer is supposed to be better than the JOGLViewer.
Or at least it's reasonable to make them consistent as the JOGLViewer, right? :P

benjamin.kutschan wrote:Hi,

are you using the newest version of jReality from git?
[url]git://gitorious.org/jreality/jreality.git[/url]

If I enable transparency in the RenderingHintsShader of the "root appearance" and set the transparency value in the polygonShader of the Appearance of the dodecahedron, then it works in both backends. How are you enabling transparency?

And about the transparent lines: Maybe I find time in December. Not sure yet. Sorry.

Post Reply