Bug 996 - Stereo not working on Java 7
Summary: Stereo not working on Java 7
Status: UNCONFIRMED
Alias: None
Product: Java3D
Classification: General
Component: core (show other bugs)
Version: unspecified
Hardware: pc_x86_64 linux
: --- normal
Assignee: Phil Jordan
URL:
Depends on:
Blocks:
 
Reported: 2014-03-06 11:49 CET by Bartosz Borucki
Modified: 2020-02-02 02:37 CET (History)
4 users (show)

See Also:
Type: DEFECT
SCM Refs:
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bartosz Borucki 2014-03-06 11:49:57 CET
It seems that some changes introduced to Java 7 cause that stereo is not working. The same code using Canvas3D from Harvey's Java3D 1.6.0-pre9 works properly on JRE 1.6 and on JRE 1.7 only one eye is rendered.

This was tested on platform: Linux 64-bit + Nvidia Quadro 6000 + 331.38 driver + current JOGL + Java 3D 1.6.0-pre9


Example code:
-----------------------------
import com.sun.j3d.utils.geometry.ColorCube;
import com.sun.j3d.utils.universe.SimpleUniverse;
import java.awt.BorderLayout;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsEnvironment;
import javax.media.j3d.BranchGroup;
import javax.media.j3d.Canvas3D;
import javax.media.j3d.GraphicsConfigTemplate3D;
import javax.media.j3d.Shape3D;
import javax.media.j3d.View;
import javax.swing.JFrame;

public class Java3DTest {

    public static void main(String[] args) {
        GraphicsConfigTemplate3D template = new GraphicsConfigTemplate3D();
        template.setStereo(GraphicsConfigTemplate3D.REQUIRED);
        GraphicsConfiguration gcfg
                = GraphicsEnvironment.getLocalGraphicsEnvironment().
                getDefaultScreenDevice().getBestConfiguration(template);
        final Canvas3D canvas = new Canvas3D(gcfg);
        canvas.setStereoEnable(true);        

        JFrame frame = new JFrame("test frame");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setBounds(0, 0, 640, 480);
        frame.setLayout(new BorderLayout());
        frame.add(canvas, BorderLayout.CENTER);
        frame.setVisible(true);
                
        SimpleUniverse universe = new SimpleUniverse(canvas);
        View view = canvas.getView();

        BranchGroup scene = new BranchGroup();
        Shape3D shape = new ColorCube(0.5);
        scene.addChild(shape);
        universe.addBranchGraph(scene);
        universe.getViewingPlatform().setNominalViewingTransform(); 
    }
Comment 1 Harvey Harrison 2014-08-05 19:40:47 CEST
(In reply to comment #0)
> It seems that some changes introduced to Java 7 cause that stereo is not
> working. The same code using Canvas3D from Harvey's Java3D 1.6.0-pre9 works
> properly on JRE 1.6 and on JRE 1.7 only one eye is rendered.
> 
> This was tested on platform: Linux 64-bit + Nvidia Quadro 6000 + 331.38
> driver + current JOGL + Java 3D 1.6.0-pre9
> 
> 

I've just received a pull request that I will merge into a -pre11 release
that hopefully will fix this issue.  Do you still have the testscase handy
for testing?

Harvey
Comment 2 Bartosz Borucki 2014-08-06 15:03:17 CEST
(In reply to comment #1)
> (In reply to comment #0)
> > It seems that some changes introduced to Java 7 cause that stereo is not
> > working. The same code using Canvas3D from Harvey's Java3D 1.6.0-pre9 works
> > properly on JRE 1.6 and on JRE 1.7 only one eye is rendered.
> > 
> > This was tested on platform: Linux 64-bit + Nvidia Quadro 6000 + 331.38
> > driver + current JOGL + Java 3D 1.6.0-pre9
> > 
> > 
> 
> I've just received a pull request that I will merge into a -pre11 release
> that hopefully will fix this issue.  Do you still have the testscase handy
> for testing?
> 
> Harvey

Harvey, I can easily test new improvements both in simplified testcases and in out application. In the meantime I've double checked the described problem on J3D-pre8, pre9 and pre10 vs. Java 6, 7 and 8, and confirm the problem on all J3D versions so far with Java 7 and 8.
If you wish me to run some tests let me know where can I get the new J3D version. Should I use current GitHub contents?
Comment 3 Harvey Harrison 2014-08-07 23:45:45 CEST
I've released 1.6.0-pre11, please test.

http://jogamp.org/deployment/java3d/1.6.0-pre11/

I've also pushed out tags to github if you prefer to build from source...thanks
for testing!  Note that jogl version 2.2.0 is required for -pre11 (back out commit 8c020c06a4f552bb66edc72afdf2becba01df89c if you want to try with an earlier version of jogl)

Harvey