Model corruption with Background Node
Posted by
StrangelyTyped on
Sep 02, 2021; 6:28pm
URL: https://forum.jogamp.org/Model-corruption-with-Background-Node-tp4041238.html
This is a continuation of this stackoverflow thread
https://stackoverflow.com/questions/69005206/offscreen-rendering-corrupts-after-first-render after gouessej suggested I open a topic here.
I have since tested with Jogamp's Java3d 1.6.2 and 1.7.0. The former resulted in the same behaviour as observe under all other configurations, while 1.7.0 continue to fail to boot with the following exception observed during application startup before any rendering is requested:
Exception in thread "J3D-RenderStructureUpdateThread-1" java.lang.NullPointerException: Cannot invoke "java.awt.Graphics2D.getTransform()" because "g2d" is null
at org.jogamp.java3d.CanvasViewCache.computeCanvasInfo(CanvasViewCache.java:592)
at org.jogamp.java3d.CanvasViewCache.doComputeDerivedData(CanvasViewCache.java:513)
at org.jogamp.java3d.CanvasViewCache.computeDerivedData(CanvasViewCache.java:411)
at org.jogamp.java3d.Canvas3D.updateViewCache(Canvas3D.java:3783)
at org.jogamp.java3d.RenderBin.computeViewFrustumBBox(RenderBin.java:4305)
at org.jogamp.java3d.RenderBin.processMessages(RenderBin.java:1791)
at org.jogamp.java3d.StructureUpdateThread.doWork(StructureUpdateThread.java:98)
at org.jogamp.java3d.J3dThread.run(J3dThread.java:271)
Unless there are any other migration steps required to move from 1.6.x to 1.7 besides changing the imports, I'm not sure what's causing this exception as all other attempted combinations of JDK / Java3d boot just fine without code changes aside from imports.
I should also note that it appears fine when rendered to an on-screen canvas, this behaviour appears to be exclusive to off-screen rendering after the first frame is rendered.
Some samples of the behaviour described.
Scene 1 (Render 1)Scene 1 (Render 2)Scene 2 (Render 1 - after application restart)Scene 2 (Render 2)