Archived

This topic is now archived and is closed to further replies.

[java] Software 3D API - testers needed

This topic is 5659 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i just finished a first preview version of jPCT, an API for doing software-rendered 3D graphics in JAVA (1.1 or higher). I''m now looking for some people who want to have a look at it, play a little bit with it and give me some feedback (what''s good (prefered!), what''s bad, wishes for future versions...that kind of stuff). The current preview version includes a jar-file with all API-classes (the source itself is NOT included), the documentation for the API in its current state and a simple example with source. So if you are interested in it, here is the URL: http://home.t-online.de/home/helge.foerster/pre/jpct.zip Other stuff made with jPCT (using an earlier version of the API) can be found here: http://jpct.de Any kind of feedback will be appreciated.

Share this post


Link to post
Share on other sites
I checked it out this afternoon-

The demo ran at ~10 fps on my P3 866 jre 1.4.0 ie 5.5

Tearing and flicker was incredibly bad; I noticed the demo wasn't double buffered though, why not? I was also impressed that entire library wieghs in at a fly wieght 102kb. I'm guessing with environment mapping turned of on the spheres you would get a BIG increase in fps? Haven't read over the documentation yet though but looks very impressive even more so since its jdk 1.1!

EDIT:
I reran the demo and this time I got around 20 fps; I also looked at the code alot more closely and yes, its is double buffered if you consider that the FrameBuffer is the first buffer; maybe a third buffer would eliminate tearing?

[edited by - nonnus29 on June 28, 2002 10:30:45 PM]

Share this post


Link to post
Share on other sites
I don't think that a third buffer would help here. To eliminate tearing, i would have to use a kind of syncronization with the monitor's refresh rate and i honestly don't know how to do that in Java (i don't think that it's possible...maybe when going fullscreen...) :-)
At the moment, the image is rendered into a backbuffer and then displayed on the component of your choice using drawImage(). I never noticed a problem with tearing on any machine i've tried.
What will flicker for sure are the counters in the upper right corner and the version info text in the lower right. This is because they are simply drawn over the displayed image and not into the backbuffer. If anyone tells me how to get the Graphics-object of a memoryimagesource, this could be changed.

Edit: I retested the applet on a Win98 machine using SUN's Java plugin 1.4.0 and i now know what you mean by "flickering"...it looks really awfull using this combination. But i don't know why...it looks fine when running the same setup under Win2K...strange...i'll have to investigate, but many thanx for the information.



[edited by - EgonOlsen on June 29, 2002 5:43:03 AM]

Share this post


Link to post
Share on other sites
You could be right about the third buffer fixing this problem albeit it's not what i would call "tearing". It's just that an unfinished frame is displayed when update() is called by anyone but the applet-code itself. This is no problem under Win2K (it simply doesn't happen) but under Win98 using the JAVA-plugin, update() seems to be called like there is no tomorrow (i really would like to know why....???). I uploaded a "fixed" version where i've overwritten update() with nothing and putted the drawing-stuff in my own method. Anyway...i'll have to look for a better solution (i really don't want to use another buffer because of the memory that would eat up).

Edit: The problem with the flickering using the JAVA-plugin under Win9x resulted from the fact that calling repaint() and putting the actual drawing in the update()-method just scheduled the repaint to be executed if other tasks permit it. This seemed to happen more or less immediatly under Win2K...but not under Win9x. So sometimes (quite often...) a framebuffer was painted that was already used in the process of rendering another frame. In addition, update() seems to be called under Win9x quite often with no need by the VM (or by whatever). I tried to use an additional buffer as you suggested. That worked, i.e. it helped to avoid the flickering, but (a big but..:-)) it didn't fix the strange update()-calling under Win9x. update() was called everytime i moved the mousepointer over the applet and repainting the image from the frontbuffer everytime caused the applet to come to a complete halt. So i'm still using my own update()-method called myUpdate() in the demo-applet and paint() and update() are empty. So far, so good...but why in hell is update() called if the mouse moves over the applet (only under Win9x, not under Win2K). The mousepointer is hardware accelerated...there is no need for the OS or the VM to update the pixels underneath it "by hand" when it moves. This is ridiculous...

[edited by - EgonOlsen on June 29, 2002 4:05:41 PM]

Share this post


Link to post
Share on other sites
I''ve noticed some very eratic behavior from the jre 1.4 in the past. As far as performance of your library under 1.4 maybe all the old deprecated 1.1 stuff is becoming corrupted in the new jre.

Share this post


Link to post
Share on other sites
Well, who knows...but the library itself doesn't use much "deprecated stuff" at all and if run in applications (there is one available for download on my page) it performs great under Java1.4. The applet used to use the standard repaint()/update()-overwrite-mechanism, but because i'm not using any GUI-elements from AWT or Swing in it, it's not a great loss that i'm not using these methods any more in the newest version. Anyway, a bad feeling remains...
Any comments other than these (but thanx again for discovering this problem even if it's more related to the demo-applet and not to the API itself)?

[edited by - EgonOlsen on June 29, 2002 5:30:58 PM]

Share this post


Link to post
Share on other sites
Really nice work!
I get about 20 fps on a 733MHz PIII, 384Mb ram, WinNT 4.0sp6a, jre 1.4.0, IE 5.5. The number goes down to 7~8 if I turn on all the options.
And no "tearing".

Really a good job

D-

-----------
Érdely!

Share this post


Link to post
Share on other sites
very impressive!
Er, please can you implement a mini-GL as well?

Cas

Cas

Share this post


Link to post
Share on other sites
quote:
Original post by princec
very impressive!
Er, please can you implement a mini-GL as well?

Cas

Cas


Doesn''t GL4Java do that already?

Share this post


Link to post
Share on other sites
It does, but in hardware of course!
I''d love to see a very cut-down GL api and rasterizer implemented in Java.
For my own secret purposes of course

Cas

Cas

Share this post


Link to post
Share on other sites
Actually, egonolsons library is way higher level than opengl; so unless you just wanna port over you opengl code why bother?

Too bad i''m not doing 3d yet or i''d spend alot more time playing with it.

Share this post


Link to post
Share on other sites
Yes, OpenGL is a 3D API while jPCT is more like 3D engine API with some lower level stuff for the tasks that are not covered by the higher level methods. One may do low-level programming using jPCT to a degree but it''s really not as low-level as OpenGL is.

Share this post


Link to post
Share on other sites
Yes, I was hoping you''d turn your 3d texture mapping skills and such into a low-level Java software 3D renderer which would be nice. You know, just for the hell of it


Cas

Share this post


Link to post
Share on other sites
Well, seems like i have to be my own beta-tester...again.
I finally managed to pursuade my boss that we are in desperate need of a (rather simple) 3D applet game for one of our web-portals. So can combine testing with fun and i''m even being paid for it.

Share this post


Link to post
Share on other sites
9-13 fps on a 667 Celeron. I''ll test it on a decent system in about an hour.

Share this post


Link to post
Share on other sites
For a larger audience I would post your engine on javagaming.org forums. If you haven''t been over there, i''m sure you''ll love it. I gaurantee your engine will be a hit with that crowd. Also some of Suns Java graphics engineers will probably check it out too, apparently they got nothing better to do all day then post those forums!

Share this post


Link to post
Share on other sites
Runs at 7-8 fps on my p2-350. Got java 1.4 (1.4.0_01)
No flickering. Win 98

Share this post


Link to post
Share on other sites
In case anyone is interested: The simple game using jPCT is done. It can be found here:

http://hannover.stadtmagazine.de/games/numbers/

It''s in german, but that shouldn''t matter at all. The rules are quite simple: You always draw horizontal and the computer draws vertical (or vice versa...it''s randomly chosen before a new game starts). Green tiles will add their value to your score and red tiles will decrease your score (the same for the computer-player). The game ends if the current player can''t move or no more red and green tiles remain.
And yes...i know that the lightsource lights the tiles a little bit too much (can be seen as a feature too...) and that the model is a quake2 one...but we do have permission to use it for this game.


Share this post


Link to post
Share on other sites
Pretty fun puzzle game! But the AI needs some work.
It seems too easy to beat!


~~~~
Kami no Itte ga ore ni zettai naru!

Share this post


Link to post
Share on other sites
quote:
Original post by tangentz
Pretty fun puzzle game! But the AI needs some work.
It seems too easy to beat!

Hmm...the decision tree used by the AI has a depth level of 6, which is enough to beat most people that play-tested the game. I think that there is some room for improvement but on the other hand, it should be used as an online-game for a web-portal. Our users are not that much experienced with games (to be honest, they don''t seem to have an experience of any kind )...so i think it''ll do the job for now.

Share this post


Link to post
Share on other sites
I never played the game before, but I was able to beat it
in all my games. I played it 6 times, since it was fun!
I guess I "looked" deeper than the AI without knowing it but
I wasn''t really trying...

But since you said the lookahead level of 6, that should
be enough for casual players.


~~~~
Kami no Itte ga ore ni zettai naru!

Share this post


Link to post
Share on other sites
I was playing for the first time and about half way through the game internet explorer crashed on me; I didn''t have to restart but the window froze and I waited a couple of minutes for it to unfreeze but it didn''t. Couldn''t open the java console window to see what it said either.

P3, IE 5.5, jre 1.4

Otherwise the applet was fine and the graphics were superb. Loading time was about 2 minutes at ~50kbps.

Share this post


Link to post
Share on other sites
quote:
Original post by nonnus29
I was playing for the first time and about half way through the game internet explorer crashed on me; I didn''t have to restart but the window froze and I waited a couple of minutes for it to unfreeze but it didn''t. Couldn''t open the java console window to see what it said either.

P3, IE 5.5, jre 1.4

I encountered a similar problem once (while using Netscape 7.0PR1 together with 1.4)...the browser froze and i had to kill it. I never encountered this using the MS-VM (as much as i hate to say this...). I believe that it is somehow related to threading (the applet uses a main thread, a timer thread, a cpu-move-thread and an end-game-thread) but i don''t know how to debug it because i can''t reproduce it anymore...


Share this post


Link to post
Share on other sites
quote:
Original post by princec
very impressive!
Er, please can you implement a mini-GL as well?

Cas

Cas


actually, I have done this. it is finished, but it needs to be cleaned up before it's released to the public. it is NOT optimized at all; i wrote it to learn how low level graphics work (both 2D and 3D).
when i find time i'll clean the code up and release it, how's that?

you can find more info at http://mill.3dfxsweden.net (Apps | Crap3D)

_______________________
http://mill.3dfxsweden.net

[edited by - mill-o on July 21, 2002 8:40:27 AM]

Share this post


Link to post
Share on other sites