Rendering problem in NetBeans Platform Application

Hi guys. I am hoping that someone has encountered this problem before and have some advice. I’ve have a custom implementation of an AWTPanel (two actually, one is a simple JPanel and the other one is a AWT canvas) and have embedded it into a NetBeans Platform application. Most of the time (for days) the scene works well and we do not have any issues whatsoever. But occasionally we get that the scene renders “garbage” and only the bottom left corner (quadrant) of the canvas becomes usable and renders correctly (see the image below). The only way to fix it is to restart the application.

It is very difficult to reproduce the problem and when it happens there are no errors. We have exhausted all avenues of debugging.

I apologise for not being able to post code here as I cannot extract a standalone test case that from our sources. I am hoping someone else have encountered the same problem before and have some advice. I guess the developers of JMonkeyPlatform should have had the same problem at some point with their NetBeans Platform application.

1 Like

Let me know which bug theories you’ve tested:

  • has to do something with resizing, the part of scene looks like what you render but with different width/height (does the issue require resizing to occur?)
  • has to do something with synchronization, maybe even with first point that somehow your buffer and the sizes get out of sync (check which Threads access what, and check if synchronization logic does not contain bugs)
  • check camera viewport, gl viewport settings (have a button to print these values once the bug occurs, and compare them with ones when all works fine)
1 Like

Have you checked the Code of our SDK to see if it differs?
However i guess we never have a Panel open for days, so we might not have seen this issue at all

1 Like

We have made sure it is not a threading issue. We also expect it has to do with resizing. But is does sometimes occur without resizing the canvas.

We will try the idea of dumping the gl viewport settings to a file when this happens.

We had a look at the SDK implementation and yes it does differ slightly. Our implementation is more closer to AWTPanels.

1 Like

So we did a bit of digging through the sources today. It seems that our implementation is very similar to how it was done in the JME SDK.

We also discovered that the red box that is rendered correctly in my example always has size 640x480. After digging deeper in the sources it seems that this is the default width and height found in the AppSettings class. Then after some more digging we found a potential problem in the LwjglOffscreenBuffer class. It would appear that the PBuffer is initialized once with sizes as assigned in AppSettings class (which in our case is initialised with the default values), but resize events upstream in the code never makes its way to the PBuffer. I am not sure if this is the issue but could potentially be?