Well I have experienced what both Karsten and Joachim have seen. I have
some suggestions.
Let me explain my situation. Like Karsten, I use a JPanel to render my
off-screen buffer. In my applet, both menu and "mouse click and drag"
events cause repaints of the JPanel. The JPanel's paint method contains the
off-screen rendering code. For mouse events, I noticed, like Joachim did,
that it sometimes takes years for the off-screen rendering to occur - the
PrintCanvas3D demo that ships with the Java 3D SDK demonstrates this too.
What I did to improve the time taken to perform the off-screen rendering was
to ensure that the Java 3D thread priority was the same as the thread
priority of the thread that is executing the paint method. So for the
PrintCanvas3D example, in the file PrintCanvas3D.java, just before the call
to offScreenCanvas3D.doRender, I added the following line...
u.setJ3DThreadPriority( Thread.currentThread().getPriority() );
I actually sent an e-mail about this on August 8 (Subject: Off-screen
Canvas3D Memory Leak), but received no replies. Perhaps someone could
revisit that e-mail please?
So the thread priority should take care of the slow off-screen rendering.
However, when a menu event causes a repaint of the JPanel I found, like
Karsten, that the applet hangs with the call to waitForOffScreenRendering.
The only solution I have for this one is to ensure that menu events do not
cause a repaint for the applet. Another thing may be to perform the
off-screen rendering outside of any AWT paint loop.
Hope this helps and please let us know if a solution to the hang problem
exists.
Ciao,
Joe
-----Original Message-----
From: Joachim Diepstraten
[mailto:[EMAIL PROTECTED]]
Sent: Friday, August 24, 2001 9:47 AM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Waiting for offscreen buffer rendering stalls my
app
Hi Karsten
> > Aha so you have no View which the offScreen canvas is attached to?
>
> Not exactly: I have an attached view, which is running. But there is no
> OnScreen canvas attached to the view.
Aha hmm okay well that shouldn't matter.
> Which is the case in all the example i saw so far.
Well I rewrote HelloUniverse a bit to do something similair to your
case. I get rather interesting results. It doesn't freeze but the updates
sometimes takes "years" and sometimes don't seem to come at all. But could
be because of my fast hacking with paint/update, no Thread or something
which calls repaint. So code is rather fucked up. But it works.
I get a rendered picture shown without a Canvas3D. I can send you the code
maybe you can get your stuff working from there
Though I'm initialising a Canvas3D onScreen and get it's Screen3D to set
the size of the OffScreen Canvas3D. But I don't attach it to the
SimpleUniverse. I'll attach the offScreen Canvas3D to it.
> BTW, what are you doing with Java3D? I see you're quite active in the list
and
Well right now I'm doing my master thesis work with Java3D. But I'm closed
to being finished. At least the programming/designing part is
finished. The whole thing will go public in late autumn I think.
> is seems you have a strong
> background.
Thanks :). Well I'm interested in Computer Graphics since starting
studying.
EOF,
J.D.
--
Realtime Raytracer in JAVA
(http://www.antiflash.net/raytrace)
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".