Skip to main content

Multiple canvas views of the same scene resulting in lost textures

8 replies [Last post]
pauldb
Offline
Joined: 2003-08-30
Points: 0

Hi,
I have two view objects in my universe.

One of the views has two canvases attached to it, the other has one canvas.

Therefore, I have three canvases, two of which have the same view of the virtual world.

Let me draw a quick scenegraph:

View 1 ---------------Canvas 1
|________________Canvas 2

View 2 ---------------Canvas 3

Occassionally - not always - this results in the rendition in one of the canvases having objects with no texture mapping on them - the objects merely appear to be white.

I should add that only one of canvas 2 and canvas 3 is visible at any one time - they are contained using a CardLayout.

So, what's the problem? Is it the card layout?
Is it the two canvas - one view thing?
Is there a graphics memory leak? It seems to happen after running for a while.

Any help would be appreciated.

I have a decent NVidia 128 MB graphics card, Windows XP, 1.5GB RAM, fast processor.

Thanks,
-Paul

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
nvaidya
Offline
Joined: 2004-08-03
Points: 0

Aha ! was planning to report a very similar issue. Apologies, however, if my issue happens to be unrelated.

I have an OnScreenCanvas3D (OnC) and an OffScreenCanvas3D (OffC) attached to the same View. The OffC is invoked on a button click for taking a snapshot of the OnC. Everything works fine, i.e. I can take as many snapshots of OnC using OffC, until I resize the OnC by moving the divider of the JSplitPane in the left part of which is housed the OnC. On doing this and when I take a snapshot *subsequently*, the OnC loses its texture. BUT the OffC continues to provide snapshots of the scene with the textures intact even when the OnC looks white.

I don't have a small testcase to demo this, but the issue can be deterministically reproduced in a very large app.

pauldb
Offline
Joined: 2003-08-30
Points: 0

Hi,
that is interesting and does sound related.

To further cloud the issue, I think it may also be related in some way to 2D graphics. In my application, I have a filechooser that previews 2D images (see the swing tutorial). I have found that the way for me to reproduce the problem is to open the filechooser, select and thereby preview a whole bunch of 2D images. It works or rather fails without fail.

I can also reproduce the problem if I open several images in a graphics package - outside of my application.

Is it my graphics card?
-Paul

Message was edited by: pauldb

nvaidya
Offline
Joined: 2004-08-03
Points: 0

This looks probably more like a graphics driver problem if it is not a general Java or a specific Java3D problem. I could be way off on this, but IIRC I discovered my issue probably after installing the nVidia 56.72 driver.

pauldb
Offline
Joined: 2003-08-30
Points: 0

Funnily enough, now you mention it - I've only noticed this happening in the past week or so after I installed a different driver.

I notice there's a new one on the NVidia site - I'm currently downloading that.

Good luck with your own problem.
-Paul

pauldb
Offline
Joined: 2003-08-30
Points: 0

Well the latest NVidia driver 61.77 didn't help.

I still get the problem.

It's only when I have two canvases attached to the same view. So, I do think it is a Java3D problem.

Anyone else seen it before?

-Paul

nvaidya
Offline
Joined: 2004-08-03
Points: 0

Paul,

I have worked on creating a small testcase to demo this issue. I had already sent Chien Yang a testcase to demo an issue related to OffScreenCanvas3D nearly 3 months back. All he has to do is to put the Canvas3D in a JSplitPane and follow the description of my problem above. No other changes anywhere in any of the other files.

The changes have to be made in PrintCanvas3D.java as follows. Replace the method "private AppPanel(..)" with the following:

private AppPanel(String args[]) {
setLayout(new BorderLayout());

// Create Canvas3D and scene graph
createCanvas3D(args);
JPanel ritePanel = new JPanel();
ritePanel.setLayout( new BoxLayout( ritePanel, BoxLayout.Y_AXIS ) );
ritePanel.add( new JButton( "Dummy_0" ) );
ritePanel.add( new JButton( "Dummy_1" ) );
ritePanel.add( new JButton( "Dummy_2" ) );
ritePanel.add( new JButton( "Dummy_3" ) );

JSplitPane spaneLR = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT );
spaneLR.setDoubleBuffered( true );
spaneLR.setOneTouchExpandable( true );
spaneLR.setContinuousLayout( true );
spaneLR.setResizeWeight( 0.95 );
spaneLR.setLeftComponent( canvas3D );
spaneLR.setRightComponent( ritePanel );

spaneLR.setDividerLocation( 300 );
add( spaneLR, BorderLayout.CENTER );
}
}

Observed Behavior:
On splitpane resizing, the Box on the OnScreenCanvas disappears (since it is fully textured). The snapshots, however, continue to be correct.

nvaidya
Offline
Joined: 2004-08-03
Points: 0

OK ! Have submitted an issue. Let me know if any additional info. is needed.

BTW, the same testcase also demonstrates that the OnScreenCanvas output is different from that of OffScreenCanvas output for BASE_LEVEL_LINEAR interpolation mode in conjunction with anything other than WRAP type end condition. It would be useful to have CLAMP and/or CLAMP_TO_EDGE working correctly also.

Message was edited by: NVaidya

nvaidya
Offline
Joined: 2004-08-03
Points: 0

Kevin,

Great that you could reproduce the Bug. Also noticed that you have discovered a related bug under Solaris.

On Part II of Issue 18 - OffC output doesn't match with OnC output for linear mode - looks like I'm stuck with a bad driver. There are a couple of pics. with Chien which clearly illustrate this issue I see with my config.

Many Thanks Again !

Paul,

You may want to keep track of Issue 18 to see if it fixes your problem also. You could grab the testcase called OffCBug.jar under Issue 18, and give it a shot on your config.

--Vaidya