Shawn Kendall wrote:True, it is not absolutely necessary for all app, but it is for some.> This is a serious core problem with Java3D IMHO. For many applications there
> must be a way to guarantee that all behaviors in a scene are updated before the
> scene is drawn.As an option, it would be useful, but not necessary.
The problem isI do understand the problem of multithreading 3d apps. I've been using Performer on SGIs since '95 and it uses multiple processing and multi-processors, but still keeps the App/Cull/Draw process in sync by overlapping their execution and buffering the scene changes. It looks like this:
dealing with SMP machines and also the multi-threaded architecture (two
separate problem areas).In SMP machines, the behaviour evaluation would be running on one CPU
while the rendering runs on another. Depending on the calculation times
in behaviours, you need to sync threads across the multiple CPUs, a
relatively difficult task in Java as it is (don't know if J3D uses java
threads or native OS threads) considering you don't know whether you are
dealing with a multi-CPU box or not. Some behaviours you want to run in
background mode without updating the scene every time it renders. If you
forced every behaviour to do that, then you might as well forgo the
multi-threaded implementation because behaviours couldn't start
calculations before the previous rendering pass has completed, and then
rendering couldn't start before behaviours have completed etc etc.
Processor 1 | APP |
Processor 2 | | CULL |
Processor 3 |
| DRAW |
so after a few frames it looks like this:
Processor 1 | APP3 | APP4 | APP5 ....
Processor 2 | CULL2 | CULL3 | CULL4....
Processor 3 | DRAW1 | DRAW2 | DRAW3....
Synching and multi-processing. The latency is the same as a single processor, but the frame rate is increased and the extra processor are utilized.
For single CPUs the problem then becomes one of thread scheduling. WhatNot true. I should still be able to use a scene graph API and have synchronization.
if the OS decided to pre-empt the behaviour thread to run the renderer.
The renderer has to know about how behaviour execution is going and
immediately yield if no complete. You loose a lot in context swapping
and extra overheads for this. It is much simpler to just assume they run
separately. Why do you think it took until Quake 3 before the engine
became multi-threaded (even then it only has 2 threads of execution)?> For certain animations, camera motion, etc., the playback must
> be on a per frame basis. At ANY frame rate, the savvy user will detect it if it
> is not. The only solution I can see is nothing short of replacing the entire
> Java3D behavior framework with our own!Correct. If you need guaranteed execution order, don't use a scenegraph
based API, or use one that does immediate mode rendering and do your own
implementation. Java 3D has immediate mode capabilities.
I've done it before elsewhere...
As for importance - for my applications (Walkthroughs and dynamic VR,Not true. Ask people making games. Even at >30 Hz, game players can see the difference. Believe me. Or try it yourself. As a matter of fact, I can send you a tiny app that renders one polygon, can run in the 100s of Hz on a good machine and you WILL see jitter and flash,etc when you shouldn't.
but not game playing) it isn't very important at all. So long as the
input movements are processed exactly for each frame, most of the rest
of the behaviours can act with one or two frames delay without adverse
effects. Also, as rendering speeds get higher the delay between frames
and behaviour execution becomes less and so is less noticable.
Also, but what makes you think that your inputs are synched? Why are your inputs not affect the same way as the behaviors?
--
Justin Couch Author, Java Hacker
Snr Software Engineer [EMAIL PROTECTED]
rbuzz.net http://www.vlc.com.au/~justin/
Java3D FAQ http://www.j3d.org/faq/
-------------------------------------------------------------------
"Look through the lens, and the light breaks down into many lights.
Turn it or move it, and a new set of arrangements appears... is it
a single light or many lights, lights that one must know how to
distinguish, recognise and appreciate? Is it one light with many
frames or one frame for many lights?" -Subcomandante Marcos
-------------------------------------------------------------------===========================================================================
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".
-- __________________________________________________________ Shawn Kendall Full Sail Real World Education Course Director 3300 University BLVD Real Time 3D for Gaming Winter Park FL 32792 [EMAIL PROTECTED] http://www.fullsail.com __________________________________________________________