I'm still getting over the shock that java3d doesn't currently take lots of shortcuts inside the native layer..
It stills need to call opengl at some point. Only thing you gain by creating your own intermediate native layer (instead of direct JNI translation of opengl like jogl/gl4java) is reducing number of java<->transitions. While it is true that JNI is costly, we are talking about maybe 1 order of magnitude cost compared to normal call. Something like 1 JNI call = 10-50 java calls (call overhead only, time inside method is the same). I have done some debugging with java3d using instrumented opengl library and it was calling maybe 100-150 opengl calls per frame, for non-trivial scene. Only some of this calls could be coalesced(sp?), so we are getting only partial reduction in JNI transitions by creating intermediate native layer. Add the fact that opengl call itself is quite heavy anyway, that most of time is spend in transferring buffers/textures from memory to GPU and it turns out that cost of umpteen extra JNI calls per frame is really neglible.
Of course, if you will try to use a lot of glVertex3f, overhead might be bigger. But you cannot hope for any reasonable performance with per-vertex calls anyway - and for bulk methods, it is a memory transfer time which is limiting speed, not actual cpu cycles.
Artur
=========================================================================== 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".
