The screen turns blank when I resize the window

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

The screen turns blank when I resize the window

Rii933
Hello ,
I have a problem in my Java3D program, whenever I try to resize the window, it turns blank and the figure disappears. I followed the instructions in this link:  https://gouessej.wordpress.com/2012/08/01/java-3d-est-de-retour-java-3d-is-back/ and even tried the first example here: http://java3d.org/samples.html  but the problem is still there.
Reply | Threaded
Open this post in threaded view
|

Re: The screen turns blank when I resize the window

gouessej
Administrator
Please indicate precisely your operating system, your GPU, your driver number, etc...
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: The screen turns blank when I resize the window

philjord
By blank do you mean black or grey? If grey have you followed this advice?

Thanks,
Phil

----- Reply message -----
From: "gouessej [via jogamp]" <[hidden email]>
To: "philjord" <[hidden email]>
Subject: The screen turns blank when I resize the window
Date: Tue, Mar 1, 2016 17:41

Please indicate precisely your operating system, your GPU, your driver number, etc...


If you reply to this email, your message will be added to the discussion below:
http://forum.jogamp.org/The-screen-turns-blank-when-I-resize-the-window-tp4036401p4036404.html
To start a new topic under java3d, email [hidden email]
To unsubscribe from java3d, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: The screen turns blank when I resize the window

Rii933
In reply to this post by gouessej
Processor Intel® Core™ i5-2450M CPU @ 2.50GHz
RAM 4,00 Go
Operating System: Windows 8, 64 Bits
Hard Disk 449 GB
Reply | Threaded
Open this post in threaded view
|

Re: The screen turns blank when I resize the window

Rii933
In reply to this post by philjord
It turns grey.
I have just read you reply on that post and followed what you said but nothing has changed.
Reply | Threaded
Open this post in threaded view
|

Re: The screen turns blank when I resize the window

gouessej
Administrator
In reply to this post by Rii933
Please run this program and post the result here:
http://jogamp.org/deployment/jogamp-current/jogl-application-version.jnlp

You may have to add jogamp.org to the exception list to run it:
https://www.java.com/en/download/faq/exception_sitelist.xml
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: The screen turns blank when I resize the window

Rii933
This is what I got as result:



-----------------------------------------------------------------------------------------------------
Platform: WINDOWS / Windows 8.1 6.3 (6.3.0), amd64 (X86_64, GENERIC_ABI), 4 cores, littleEndian true
MachineDataInfo: runtimeValidated true, 32Bit false, primitive size / alignment:
  int8    1 / 1, int16   2 / 2
  int     4 / 4, long    4 / 4
  int32   4 / 4, int64   8 / 8
  float   4 / 4, double  8 / 8, ldouble 16 / 16
  pointer 8 / 8, page    4096
Platform: Java Version: 1.8.0_73 (1.8.0u73), VM: Java HotSpot(TM) 64-Bit Server VM, Runtime: Java(TM) SE Runtime Environment
Platform: Java Vendor: Oracle Corporation, http://java.oracle.com/, JavaSE: true, Java6: true, AWT enabled: true
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Package: com.jogamp.common
Extension Name: com.jogamp.common
Specification Title: GlueGen Java Bindings Generator
Specification Vendor: JogAmp Community
Specification Version: 2.3
Implementation Title: GlueGen Run-Time
Implementation Vendor: JogAmp Community
Implementation Vendor ID: com.jogamp
Implementation URL: http://jogamp.org/
Implementation Version: 2.3.2
Implementation Build: 2.3-b900-20151009
Implementation Branch: origin/master
Implementation Commit: cc1e9bc698b7f11097c1e114027e53121552f280
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Package: com.jogamp.opengl
Extension Name: com.jogamp.opengl
Specification Title: Java Bindings for OpenGL API Specification
Specification Vendor: JogAmp Community
Specification Version: 2.3
Implementation Title: Java Bindings for OpenGL Runtime Environment
Implementation Vendor: JogAmp Community
Implementation Vendor ID: com.jogamp
Implementation URL: http://jogamp.org/
Implementation Version: 2.3.2
Implementation Build: 2.3-b1469-20151010
Implementation Branch: origin/master
Implementation Commit: e794fc40ba723f2fca4ac892e873975fb393e007
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
WindowsGraphicsDevice[type .windows, connection decon]:
        Natives
                GL4bc true [4.5 (Compat profile, arb, compat[ES2, ES3, ES31], FBO, hardware)]
                GL4 true [4.5 (Core profile, arb, compat[ES2, ES3, ES31], FBO, hardware)]
                GLES3 false
                GL3bc true [4.5 (Compat profile, arb, compat[ES2, ES3, ES31], FBO, hardware)]
                GL3 true [4.5 (Core profile, arb, compat[ES2, ES3, ES31], FBO, hardware)]
                GL2 true [4.5 (Compat profile, arb, compat[ES2, ES3, ES31], FBO, hardware)]
                GLES2 false
                GLES1 false
                Count 5 / 8
        Common
                GL4ES3 true
                GL2GL3 true
                GL2ES2 true
                GL2ES1 true
        Mappings
                GL3bc GLProfile[GL3bc/GL4bc.hw]
                GL2ES1 GLProfile[GL2ES1/GL4bc.hw]
                GL4ES3 GLProfile[GL4ES3/GL4.hw]
                GL2ES2 GLProfile[GL2ES2/GL4.hw]
                GL4bc GLProfile[GL4bc/GL4bc.hw]
                GL2 GLProfile[GL2/GL4bc.hw]
                GL4 GLProfile[GL4/GL4.hw]
                GL3 GLProfile[GL3/GL4.hw]
                GL2GL3 GLProfile[GL2GL3/GL4bc.hw]
                default GLProfile[GL4bc/GL4bc.hw]
                Count 9 / 12

Swap Interval  1
GL Profile     GLProfile[GL4bc/GL4bc.hw]
GL Version     4.5 (Compat profile, arb, compat[ES2, ES3, ES31], FBO, hardware) - 4.5.13416 Compatibility Profile Context 15.300.1025.1001 [GL 4.5.0, vendor 15.300.1025 (Compatibility Profile Context 15.300.1025.1001)]
Quirks         [NoDoubleBufferedBitmap, NoSurfacelessCtx]
Impl. class    jogamp.opengl.gl4.GL4bcImpl
GL_VENDOR      ATI Technologies Inc.
GL_RENDERER    AMD Radeon HD 7500/7600 Series
GL_VERSION     4.5.13416 Compatibility Profile Context 15.300.1025.1001
GLSL           true, has-compiler-func: true, version: 4.40 / 4.40.0
GL FBO: basic true, full true
GL_EXTENSIONS  266
GLX_EXTENSIONS 24
-----------------------------------------------------------------------------------------------------
Reply | Threaded
Open this post in threaded view
|

Re: The screen turns blank when I resize the window

gouessej
Administrator
Thanks. Please can you indicate which workarounds you tried?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: The screen turns blank when I resize the window

Rii933
I tried to refresh the canvas so I added this code:
 
 RefreshCanvas3D canvas3D =
        new RefreshCanvas3D(config);
   
    class RefreshCanvas3D extends Canvas3D {
                public RefreshCanvas3D(GraphicsConfiguration config) {
          super(config);
        }
                public void paint(Graphics g) {
          super.paint(g);
          Toolkit.getDefaultToolkit().sync();
        }
      }
Reply | Threaded
Open this post in threaded view
|

Re: The screen turns blank when I resize the window

gouessej
Administrator
Ok but philjord suggested two other workarounds. Please give them a try so that we know what works and what doesn't work. Then, I will write a bug report and investigate if possible.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: The screen turns blank when I resize the window

Rii933
This post was updated on .
yes , I tried that too (I forgot to mention it)

I added : System.setProperty("sun.awt.noerasebackground", "true");  in the first line of my main.
and this:  c.getView().setMinimumFrameCycleTime(50);  after creating the canvas and adding it to a universe

I tried to add a non passive behaviour too (like Phil said)
           
 
       private static class GoBehavior extends Behavior
       {
               private WakeupCondition FPSCriterion = new WakeupOnElapsedFrames(0, false);

               public GoBehavior()
               {
                       setSchedulingBounds(new BoundingSphere(new Point3d(0.0, 0.0, 0.0), Double.POSITIVE_INFINITY));
                       setEnable(true);
               }

               public void initialize()
               {
                       wakeupOn(FPSCriterion);
               }

               @SuppressWarnings("rawtypes")
               public void processStimulus(Enumeration criteria)
               {

                       wakeupOn(FPSCriterion);
               }
       }

GoBehavior go = new GoBehavior();

then added it to my nodeRoot:    nodeRoot.addChild(go);
Reply | Threaded
Open this post in threaded view
|

Re: The screen turns blank when I resize the window

philjord
Rii933,

It looks like you're doing the right tests, I know it's painful but can you put a System.out.println("hello"); in your processStimulous method and ensure the console gets filled with that message. Just to ensure the main render loop is running furiously.

And also belt and braces I assume you are running 1.6.0pre12?

Thanks,
Phil
Reply | Threaded
Open this post in threaded view
|

Re: The screen turns blank when I resize the window

Rii933
I did that now and yes the console got filled with the word "hello" .
Yes I am using  1.6.0-pre12 version
Reply | Threaded
Open this post in threaded view
|

Re: The screen turns blank when I resize the window

philjord
OK,
so you've given us a SSCCE in the form of the Pyramid example, and you've tried the code I suggested (Java3DSimpleTest).

I presume, given that you mentioned the sync work around that's on the net, you also tried
 Canvas3D canvas3D = new Canvas3D(SimpleUniverse.getPreferredConfiguration()){
            public void paint(Graphics g) {
                try {
                    Thread.sleep(100);
                } catch (Exception e){}
                super.paint(g);
//                Toolkit.getDefaultToolkit().sync();
        };  

?? If not please do :) .

Can you confirm that the grey is coming from the Canvas3D component parent by putting canvas3D.setBackground(new Color(1,0,1)); in and see the grey become a pink. If it doesn't then the problem is probably not with Canvas3D redrawing and we can attack other avenues of investigation.

Thanks,
Phil.







Reply | Threaded
Open this post in threaded view
|

Re: The screen turns blank when I resize the window

Rii933
Hello,
Yeah I tried the paint method but it didn't solve the problem.
I just did what you suggested and added canvas3D.setBackground(new Color(1,0,1)); but the color didn't turn into pink , it turned into BLACK.
Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: The screen turns blank when I resize the window

philjord
ha ha, no of course not, I should have said 1.0f,0.0f,1.0f the Color class is a crazy ambiguous thing, 1,0,1 are three ints that are almost 0 (versus 255 range max).

So something is painting the Canvas3D grey using the background color.

And if you don't resize it you see a nice Jogl window of 3D  "stuff", so you know the actual GLSurface is working initially?
Reply | Threaded
Open this post in threaded view
|

Re: The screen turns blank when I resize the window

Rii933
oh yes , when I changed them to float numbers, it turned pink.
yeah, if I don't resize the window the shape appears normally.