You can subscribe to this list here.
1999 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2000 |
Jan
(39) |
Feb
(22) |
Mar
(41) |
Apr
(44) |
May
(47) |
Jun
(25) |
Jul
(28) |
Aug
(39) |
Sep
(35) |
Oct
(31) |
Nov
(31) |
Dec
(3) |
2001 |
Jan
(18) |
Feb
(43) |
Mar
(47) |
Apr
(38) |
May
(9) |
Jun
(20) |
Jul
(8) |
Aug
(11) |
Sep
(15) |
Oct
(43) |
Nov
(27) |
Dec
(73) |
2002 |
Jan
(42) |
Feb
(47) |
Mar
(49) |
Apr
(58) |
May
(12) |
Jun
(68) |
Jul
(42) |
Aug
(9) |
Sep
(19) |
Oct
(36) |
Nov
(28) |
Dec
(12) |
2003 |
Jan
(13) |
Feb
(24) |
Mar
(40) |
Apr
(52) |
May
(39) |
Jun
(46) |
Jul
(17) |
Aug
(5) |
Sep
(4) |
Oct
(9) |
Nov
(13) |
Dec
(12) |
2004 |
Jan
(1) |
Feb
(17) |
Mar
(4) |
Apr
(2) |
May
(1) |
Jun
(1) |
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
(6) |
Nov
(6) |
Dec
(3) |
2005 |
Jan
|
Feb
|
Mar
(8) |
Apr
(1) |
May
|
Jun
(1) |
Jul
(2) |
Aug
(5) |
Sep
(4) |
Oct
(3) |
Nov
(3) |
Dec
(1) |
2006 |
Jan
(2) |
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
(5) |
Sep
(8) |
Oct
(9) |
Nov
(8) |
Dec
(5) |
2007 |
Jan
(3) |
Feb
(11) |
Mar
(5) |
Apr
(5) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(5) |
2008 |
Jan
(7) |
Feb
(8) |
Mar
(30) |
Apr
(17) |
May
(20) |
Jun
(8) |
Jul
(19) |
Aug
(10) |
Sep
(7) |
Oct
(2) |
Nov
(1) |
Dec
|
2009 |
Jan
(13) |
Feb
(7) |
Mar
(13) |
Apr
(27) |
May
(95) |
Jun
(77) |
Jul
(43) |
Aug
(25) |
Sep
(24) |
Oct
(32) |
Nov
(6) |
Dec
(6) |
2010 |
Jan
|
Feb
(2) |
Mar
(30) |
Apr
(58) |
May
(60) |
Jun
(72) |
Jul
(32) |
Aug
(45) |
Sep
(19) |
Oct
(4) |
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2016 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Sven G. <sgo...@ja...> - 2001-12-03 00:19:13
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sunday 02 December 2001 23:50, Alex Alessandra wrote: > Hi guys, > > Is out there someone who can tell me how to find documentation about the > GL4Java projects ? > some hints: - look out for it ;-) - search 'em - read 'em - write 'em sorry, i can't resist ;-) > I'm in a very advanced porting of a Quake III Arena bsp viewer in Java + > GL4Java but i think the things are going too messy !!! sorry for your inconvinience, choose a different tool ;-) i can't help 'ya > > I need more documentation about new features on the lib, but I noticed > that: > > 1) JauSoft GL4Java upgrades are poor, not to say inexistent (so I > downloaded the new versions from SourceForge) what what ? ;-) who do you think does sourceforge's gl4java ? right: kenneth, alban, max, ... & me (the last and the first ;-) > > 2) The SourceForge project of GL4Java lacks every kind of documentation, > the forums are desert, what's goin on ? go and have some fish & dine - have some liquids then return to the mailinglist, the ascii-readme's, the little FAQ, the little doc's. well gl4java 2.8 is going on to being released - thats it 8-] with the big help of kenneth, alban cousine, max, and the many others, we do code, document and help people a lot. > > Sorry for annoying all of you prj mantainers, but don't you think you're in > need for help in writing tutorials, docs, etc. ? YES INDEED go ahead, join us - this would be a great thing join adding something to the FAQ, create an online tutorial .. etc. may be "just" doing first step html based java integrated live docs .. see - why not using the demo's, especially the nehe ones .. and it's docu, and create a nice convinient tutor for newbies ? > > ...maybe I can't know how to find what I need... (I'm Italian, sorry for my > bad english). neither do i - always seeking for a good life ;-) > > Greetz in advance, Alex. > well, i know this will not help 'ya, but it might change your attitude. read about the stuff i have written about this project & opensource in the introduction .. so your help - everybodies help is welcome. and like kenneth have said: there is a whole lot of documentation qbout this piece of <WHATYAWANT/> - - if you are able to _read_ java code ;-) looks like you are not very familiar with this kinda projects, aren't you ? so this post is for all i won't make you upset i just wanted to say more than RTFM have a nice day - live long & prosper -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8CsTyHdOA30NoFAARAgSvAJ4nATscep1R4ZtXG31+XIdiSM/S1gCfYT5x YHyt49a8htcHVdn7yL+ey6w= =5wBC -----END PGP SIGNATURE----- |
From: Kenneth B. R. <kbr...@al...> - 2001-12-02 23:52:35
|
> Is out there someone who can tell me how to find documentation about the > GL4Java projects ? > > I'm in a very advanced porting of a Quake III Arena bsp viewer in Java + > GL4Java but i think the things are going too messy !!! > > I need more documentation about new features on the lib The API documentation (Javadoc) should be up-to-date and provide information about GL4Java-specific functionality. The "demos" directory also contains a lot of examples of usage of various parts of the library. Aside from this, look to OpenGL documentation like the "Red Book" ("OpenGL Programming Guide, Second Edition") for information on how to use OpenGL effectively. If you find particular pieces of GL4Java which should be documented more thoroughly, send suggestions to this mailing list. |
From: Alex A. <az...@ne...> - 2001-12-02 22:54:40
|
Hi guys, Is out there someone who can tell me how to find documentation about the GL4Java projects ? I'm in a very advanced porting of a Quake III Arena bsp viewer in Java + GL4Java but i think the things are going too messy !!! I need more documentation about new features on the lib, but I noticed that: 1) JauSoft GL4Java upgrades are poor, not to say inexistent (so I downloaded the new versions from SourceForge) 2) The SourceForge project of GL4Java lacks every kind of documentation, the forums are desert, what's goin on ? Sorry for annoying all of you prj mantainers, but don't you think you're in need for help in writing tutorials, docs, etc. ? ...maybe I can't know how to find what I need... (I'm Italian, sorry for my bad english). Greetz in advance, Alex. |
From: Kenneth B. R. <kbr...@al...> - 2001-12-01 21:59:12
|
> Do you know of any existing multimedia timer wrappers for Java? It = > would probably be OS-specific (unless it was very thorough), but I don't = > really mind that much. If all else fails I'll write my own interface = > with JNI. It is trivial to write. One static initialization routine which calls timeBeginPeriod(1) and one getTime() routine which returns timeGetTime(). Note that increasing the timer resolution may decrease the performance of your application, which is why HotSpot does not do it by default. From what I have heard the performance hit for CPU-intensive applications is roughly 10%. > Also, on my system, I got 111fps max, instead of 800-900. Do you know = > what might be causing this? No. |
From: Kenneth B. R. <kbr...@al...> - 2001-12-01 04:12:16
|
> I am having problems getting GL4Java to perform quite as well as I = > expected it to. I created a small demo with a triangle that you can fly = > around the screen. It's just a single non-textured, non-lit polygon. = > But I can't seem to get a FPS higher than 83 or so on my Athlon 1.4 = > Geforce3 system (at 85Hz refresh and with VSYNC on). Also, every so = > often it'll just skip for a second, and the ship will appear somewhere = > else. If I turn VSYNC off the skipping is MUCH worse, but I get around = > 99.4 fps. On my friends' computer running Win98, it runs so crappily = > you can barely tell where the ship is at any given point. I think there are three problems. The first is that the system clock is being sampled each frame. On Windows the granularity of the system clock (as measured by the system call behind currentTimeMillis()) is 10 ms. You can decrease this to 1 ms by writing native code to use the multimedia timers, but a better and more portable strategy is to sample the clock only once every several frames. The second problem is that System.out.println is being called each frame. The Windows console is extremely slow and in a 3D application println should absolutely not be called each frame. The third problem is that in order to reach an FPS higher than the vertical scan rate (even though all of those rendered frames won't actually be displayed) it is necessary to have triple buffering enabled. It looks like in certain screen modes the driver automatically takes care of enabling triple buffering, but that there isn't any way to request that a given window be triple-buffered. Please email the mailing list if you know more about this. Even the fullscreen support in JDK 1.4 doesn't seem to enable whatever mode switch the driver is looking for. Incidentally, the fullscreen support in the Sun JDK is likely to only work properly with OpenGL on Windows when specifying -Dsun.java2d.noddraw=true on the command line. Attached is a version of your test which runs at the maximum framerate on my monitor when vertical sync is enabled, and which claims to be running at between 900-1000 FPS when it is disabled. import gl4java.*; import gl4java.awt.*; import gl4java.drawable.*; import java.awt.*; import java.util.*; import java.awt.event.*; import java.awt.image.*; import javax.swing.*; import java.net.*; public class GL4JavaTest implements GLEventListener, MouseListener, KeyListener { private static class MovingTriangle { // physics private double x; private double y; private double rotation; private double vx; private double vy; // display private static float[][][] mesh; private static int displayList = -1; // input private boolean bRotRight = false; private boolean bRotLeft = false; private boolean bAccel = false; private boolean bReverse = false; // default non-static parameters private double rotRate; private double accelRate; private double maxRate; // default static initialization static { float[][][] newMesh = { { { 3.0f, 0.0f, 0.0f }, { -2.598f, 1.5f, 0.0f }, { -2.598f,-1.5f, 0.0f } } }; mesh = newMesh; } // default non-static initialization { rotRate = 270.0; accelRate = 80.0; maxRate = 35.0; } public MovingTriangle() { this(0.0, 0.0, 0.0, 0.0, 90.0); } public MovingTriangle(double locX, double locY, double velX, double velY, double rot) { x = locX; y = locY; vx = velX; vy = velY; rotation = rot; } private void createDisplayList(GLAnimCanvas glc) { displayList = glc.gl.glGenLists(1); glc.gl.glNewList(displayList, GL_COMPILE); glc.gl.glBegin(GL_TRIANGLES); for (int i = 0; i < mesh.length; i++) { glc.gl.glVertex3f(mesh[i][0][0], mesh[i][0][1], mesh[i][0][2]); glc.gl.glVertex3f(mesh[i][1][0], mesh[i][1][1], mesh[i][1][2]); glc.gl.glVertex3f(mesh[i][2][0], mesh[i][2][1], mesh[i][2][2]); } glc.gl.glEnd(); glc.gl.glEndList(); } public void tick(double deltaTime) { x += vx * deltaTime; y += vy * deltaTime; if (bRotRight) addRotation(-rotRate * deltaTime); else if (bRotLeft) addRotation(rotRate * deltaTime); if (bAccel) accelerate(accelRate * deltaTime); } public void render(GLAnimCanvas glc) { if (displayList == -1) createDisplayList(glc); glc.gl.glTranslated(x , y, -100.0); glc.gl.glRotated(rotation, 0.0, 0.0, 1.0); glc.gl.glCallList(displayList); } public void addRotation(double addRot) { rotation = (rotation + addRot) % 360.0; if (rotation < 0.0) rotation = 360.0 + (rotation % 360.0); } public void accelerate(double deltaTime) { vx += deltaTime * Math.cos(Math.toRadians(rotation)); vy += deltaTime * Math.sin(Math.toRadians(rotation)); double length = Math.sqrt(vx*vx + vy*vy); if (length > maxRate) { vx = (vx / length) * maxRate; vy = (vy / length) * maxRate; } } public void setInput(boolean bRR, boolean bRL, boolean bA) { bRotRight = bRR; bRotLeft = bRL; bAccel = bA; } } private static GLAnimCanvas canvas; private static GL4JavaTest gl4JavaTest; private static GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); private static GraphicsDevice gd = ge.getDefaultScreenDevice(); private static int frameCount = 0; private static MovingTriangle myTriangle = new MovingTriangle(); private static boolean[] keys = new boolean[255]; private static long lastTime; private static long firstTime; private static double deltaTime = 33.0; private static long numFrames = 0; private static final int WIDTH = 1280; private static final int HEIGHT = 1024; public static void main(String args[]) { gl4JavaTest = new GL4JavaTest(); Frame glWindow = new Frame("Java Test - Moving Triangle!"); GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Cursor hiddenCursor = null; GLCapabilities glCaps = new GLCapabilities(); glWindow.setUndecorated(true); glWindow.setLayout(new BorderLayout()); glWindow.setIgnoreRepaint(true); glWindow.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { gd.setFullScreenWindow(null); System.exit(0); } }); canvas = GLDrawableFactory.getFactory().createGLAnimCanvas(glCaps, WIDTH, HEIGHT); canvas.addGLEventListener((GLEventListener)gl4JavaTest); canvas.addKeyListener(gl4JavaTest); canvas.setUseRepaint(false); canvas.setUseFpsSleep(false); canvas.setUseYield(false); //canvas.setAnimateFps(85); glWindow.add("Center", canvas); glWindow.pack(); glWindow.setVisible(true); canvas.setVisible(true); canvas.setIgnoreRepaint(true); canvas.repaint(); canvas.start(); gd.setFullScreenWindow(glWindow); gd.setDisplayMode(new DisplayMode(WIDTH, HEIGHT, 32, 60)); canvas.requestFocus(); lastTime = firstTime = System.currentTimeMillis(); } public void reshape (GLDrawable glDrawable, int w, int h) { GLAnimCanvas glc = (GLAnimCanvas)glDrawable; glc.gl.glViewport(0,0,WIDTH,HEIGHT); // Reset The Current Viewport glc.gl.glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glc.gl.glLoadIdentity(); // Reset The Projection Matrix glc.glu.gluPerspective(45.0f,(float)WIDTH/(float)HEIGHT,0.1f,100.0f); glc.gl.glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glc.gl.glLoadIdentity(); } public void display (GLDrawable glDrawable) { GLAnimCanvas glc = (GLAnimCanvas)glDrawable; glc.gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); myTriangle.setInput(keys[KeyEvent.VK_NUMPAD6], keys[KeyEvent.VK_NUMPAD4], keys[KeyEvent.VK_NUMPAD8]); if (keys[KeyEvent.VK_ESCAPE]) { gd.setFullScreenWindow(null); System.exit(0); } if ((++numFrames % 100) == 0) { long curTime = System.currentTimeMillis(); long diff = curTime - lastTime; deltaTime = diff / 100.0; System.out.println("Average FPS: " + (1000.0 / deltaTime)); System.out.println("Num Frames: " + numFrames); System.out.println("Elapsed Time: " + (curTime - firstTime)/1000.0); lastTime = curTime; } myTriangle.tick(deltaTime); glc.gl.glLoadIdentity(); myTriangle.render(glc); } public void init (GLDrawable glDrawable) { GLAnimCanvas glc = (GLAnimCanvas)glDrawable; glc.gl.glShadeModel(GL_SMOOTH); // Enable Smooth Shading glc.gl.glClearColor(0.0f, 0.0f, 0.0f, 0.5f); // Black Background glc.gl.glClearDepth(1.0f); // Depth Buffer Setup glc.gl.glEnable(GL_DEPTH_TEST); // Enables Depth Testing glc.gl.glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do glc.gl.glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);// Really Nice Perspective Calculations } public void preDisplay(GLDrawable canvas) {} public void postDisplay(GLDrawable canvas) {} public void cleanup(GLDrawable canvas) {} public void keyPressed (KeyEvent keyEvent) { keys[keyEvent.getKeyCode()] = true; } public void keyReleased (KeyEvent keyEvent) { keys[keyEvent.getKeyCode()] = false; } public void keyTyped (KeyEvent keyEvent) { } public void mouseExited (MouseEvent mouseEvent) { } public void mouseReleased (MouseEvent mouseEvent) { } public void mousePressed (MouseEvent mouseEvent) { } public void mouseClicked (MouseEvent mouseEvent) { } public void mouseEntered (MouseEvent mouseEvent) { } } |
From: Kevin N. <kn...@ca...> - 2001-12-01 01:00:29
|
Oh, by the way, here is one of my log files: GLINFO: loaded OpenGL library OPENGL32.DLL! GLINFO: loaded GLU library GLU32.DLL! GLINFO: found wglGetProcAddress in OPENGL32.DLL fetched GL/GLU functions succesfully ! Average FPS: Infinity Num Frames: 1 Elapsed Time: 0.0 Num MS in last frame: 0 Average FPS: Infinity Num Frames: 2 Elapsed Time: 0.0 Num MS in last frame: 0 Average FPS: 150.0 Num Frames: 3 Elapsed Time: 0.02 Num MS in last frame: 20 Average FPS: 80.0 Num Frames: 4 Elapsed Time: 0.05 Num MS in last frame: 30 Average FPS: 100.0 Num Frames: 5 Elapsed Time: 0.05 Num MS in last frame: 0 Average FPS: 100.0 Num Frames: 6 Elapsed Time: 0.06 Num MS in last frame: 10 Average FPS: 98.59154929577466 Num Frames: 7 Elapsed Time: 0.071 Num MS in last frame: 11 Average FPS: 87.91208791208791 Num Frames: 8 Elapsed Time: 0.091 Num MS in last frame: 20 Average FPS: 89.10891089108911 Num Frames: 9 Elapsed Time: 0.101 Num MS in last frame: 10 Average FPS: 90.09009009009009 Num Frames: 10 Elapsed Time: 0.111 Num MS in last frame: 10 Average FPS: 90.9090909090909 Num Frames: 11 Elapsed Time: 0.121 Num MS in last frame: 10 Average FPS: 91.6030534351145 Num Frames: 12 Elapsed Time: 0.131 Num MS in last frame: 10 Average FPS: 92.1985815602837 Num Frames: 13 Elapsed Time: 0.141 Num MS in last frame: 10 Average FPS: 86.95652173913044 Num Frames: 14 Elapsed Time: 0.161 Num MS in last frame: 20 Average FPS: 87.71929824561403 Num Frames: 15 Elapsed Time: 0.171 Num MS in last frame: 10 Average FPS: 88.39779005524862 Num Frames: 16 Elapsed Time: 0.181 Num MS in last frame: 10 Average FPS: 89.00523560209425 Num Frames: 17 Elapsed Time: 0.191 Num MS in last frame: 10 Average FPS: 89.55223880597015 Num Frames: 18 Elapsed Time: 0.201 Num MS in last frame: 10 Average FPS: 90.04739336492891 Num Frames: 19 Elapsed Time: 0.211 Num MS in last frame: 10 Average FPS: 86.58008658008657 Num Frames: 20 Elapsed Time: 0.231 Num MS in last frame: 20 Average FPS: 87.13692946058092 Num Frames: 21 Elapsed Time: 0.241 Num MS in last frame: 10 Average FPS: 87.64940239043824 Num Frames: 22 Elapsed Time: 0.251 Num MS in last frame: 10 Average FPS: 88.12260536398468 Num Frames: 23 Elapsed Time: 0.261 Num MS in last frame: 10 Average FPS: 88.56088560885608 Num Frames: 24 Elapsed Time: 0.271 Num MS in last frame: 10 Average FPS: 85.9106529209622 Num Frames: 25 Elapsed Time: 0.291 Num MS in last frame: 20 Average FPS: 86.37873754152824 Num Frames: 26 Elapsed Time: 0.301 Num MS in last frame: 10 Average FPS: 81.57099697885197 Num Frames: 27 Elapsed Time: 0.331 Num MS in last frame: 30 Average FPS: 82.11143695014663 Num Frames: 28 Elapsed Time: 0.341 Num MS in last frame: 10 Average FPS: 80.33240997229917 Num Frames: 29 Elapsed Time: 0.361 Num MS in last frame: 20 Average FPS: 80.86253369272237 Num Frames: 30 Elapsed Time: 0.371 Num MS in last frame: 10 Average FPS: 81.36482939632546 Num Frames: 31 Elapsed Time: 0.381 Num MS in last frame: 10 Average FPS: 81.84143222506394 Num Frames: 32 Elapsed Time: 0.391 Num MS in last frame: 10 Average FPS: 82.29426433915212 Num Frames: 33 Elapsed Time: 0.401 Num MS in last frame: 10 Average FPS: 82.72506082725062 Num Frames: 34 Elapsed Time: 0.411 Num MS in last frame: 10 Average FPS: 81.20649651972158 Num Frames: 35 Elapsed Time: 0.431 Num MS in last frame: 20 Average FPS: 81.63265306122449 Num Frames: 36 Elapsed Time: 0.441 Num MS in last frame: 10 Average FPS: 82.03991130820398 Num Frames: 37 Elapsed Time: 0.451 Num MS in last frame: 10 Average FPS: 82.4295010845987 Num Frames: 38 Elapsed Time: 0.461 Num MS in last frame: 10 Average FPS: 82.80254777070064 Num Frames: 39 Elapsed Time: 0.471 Num MS in last frame: 10 Average FPS: 83.16008316008316 Num Frames: 40 Elapsed Time: 0.481 Num MS in last frame: 10 Average FPS: 81.83632734530939 Num Frames: 41 Elapsed Time: 0.501 Num MS in last frame: 20 Average FPS: 82.1917808219178 Num Frames: 42 Elapsed Time: 0.511 Num MS in last frame: 10 Average FPS: 80.97928436911488 Num Frames: 43 Elapsed Time: 0.531 Num MS in last frame: 20 Average FPS: 81.33086876155268 Num Frames: 44 Elapsed Time: 0.541 Num MS in last frame: 10 Average FPS: 80.2139037433155 Num Frames: 45 Elapsed Time: 0.561 Num MS in last frame: 20 Average FPS: 80.56042031523643 Num Frames: 46 Elapsed Time: 0.571 Num MS in last frame: 10 Average FPS: 80.89500860585198 Num Frames: 47 Elapsed Time: 0.581 Num MS in last frame: 10 Average FPS: 81.21827411167513 Num Frames: 48 Elapsed Time: 0.591 Num MS in last frame: 10 Average FPS: 81.53078202995009 Num Frames: 49 Elapsed Time: 0.601 Num MS in last frame: 10 Average FPS: 81.83306055646482 Num Frames: 50 Elapsed Time: 0.611 Num MS in last frame: 10 Average FPS: 80.82408874801902 Num Frames: 51 Elapsed Time: 0.631 Num MS in last frame: 20 Average FPS: 81.1232449297972 Num Frames: 52 Elapsed Time: 0.641 Num MS in last frame: 10 Average FPS: 81.41321044546851 Num Frames: 53 Elapsed Time: 0.651 Num MS in last frame: 10 Average FPS: 81.69440242057489 Num Frames: 54 Elapsed Time: 0.661 Num MS in last frame: 10 Average FPS: 81.96721311475409 Num Frames: 55 Elapsed Time: 0.671 Num MS in last frame: 10 Average FPS: 82.23201174743025 Num Frames: 56 Elapsed Time: 0.681 Num MS in last frame: 10 Average FPS: 81.31241084165478 Num Frames: 57 Elapsed Time: 0.701 Num MS in last frame: 20 Average FPS: 81.57524613220816 Num Frames: 58 Elapsed Time: 0.711 Num MS in last frame: 10 Average FPS: 81.83079056865465 Num Frames: 59 Elapsed Time: 0.721 Num MS in last frame: 10 Average FPS: 82.07934336525308 Num Frames: 60 Elapsed Time: 0.731 Num MS in last frame: 10 Average FPS: 82.32118758434548 Num Frames: 61 Elapsed Time: 0.741 Num MS in last frame: 10 Average FPS: 82.55659121171772 Num Frames: 62 Elapsed Time: 0.751 Num MS in last frame: 10 Average FPS: 81.60621761658031 Num Frames: 63 Elapsed Time: 0.772 Num MS in last frame: 21 Average FPS: 81.84143222506394 Num Frames: 64 Elapsed Time: 0.782 Num MS in last frame: 10 Average FPS: 82.07070707070707 Num Frames: 65 Elapsed Time: 0.792 Num MS in last frame: 10 Average FPS: 82.29426433915212 Num Frames: 66 Elapsed Time: 0.802 Num MS in last frame: 10 Average FPS: 82.51231527093596 Num Frames: 67 Elapsed Time: 0.812 Num MS in last frame: 10 Average FPS: 81.73076923076924 Num Frames: 68 Elapsed Time: 0.832 Num MS in last frame: 20 Average FPS: 81.94774346793349 Num Frames: 69 Elapsed Time: 0.842 Num MS in last frame: 10 Average FPS: 82.15962441314554 Num Frames: 70 Elapsed Time: 0.852 Num MS in last frame: 10 Average FPS: 82.36658932714617 Num Frames: 71 Elapsed Time: 0.862 Num MS in last frame: 10 Average FPS: 82.56880733944953 Num Frames: 72 Elapsed Time: 0.872 Num MS in last frame: 10 Average FPS: 82.76643990929705 Num Frames: 73 Elapsed Time: 0.882 Num MS in last frame: 10 Average FPS: 82.03991130820398 Num Frames: 74 Elapsed Time: 0.902 Num MS in last frame: 20 Average FPS: 82.23684210526315 Num Frames: 75 Elapsed Time: 0.912 Num MS in last frame: 10 Average FPS: 82.4295010845987 Num Frames: 76 Elapsed Time: 0.922 Num MS in last frame: 10 Average FPS: 82.61802575107296 Num Frames: 77 Elapsed Time: 0.932 Num MS in last frame: 10 Average FPS: 82.80254777070064 Num Frames: 78 Elapsed Time: 0.942 Num MS in last frame: 10 Average FPS: 82.98319327731093 Num Frames: 79 Elapsed Time: 0.952 Num MS in last frame: 10 Average FPS: 82.3045267489712 Num Frames: 80 Elapsed Time: 0.972 Num MS in last frame: 20 Average FPS: 82.4847250509165 Num Frames: 81 Elapsed Time: 0.982 Num MS in last frame: 10 Average FPS: 82.66129032258064 Num Frames: 82 Elapsed Time: 0.992 Num MS in last frame: 10 Average FPS: 82.83433133732535 Num Frames: 83 Elapsed Time: 1.002 Num MS in last frame: 10 Average FPS: 83.00395256916995 Num Frames: 84 Elapsed Time: 1.012 Num MS in last frame: 10 Average FPS: 83.17025440313111 Num Frames: 85 Elapsed Time: 1.022 Num MS in last frame: 10 Average FPS: 82.53358925143954 Num Frames: 86 Elapsed Time: 1.042 Num MS in last frame: 20 Average FPS: 81.92090395480226 Num Frames: 87 Elapsed Time: 1.062 Num MS in last frame: 20 Average FPS: 82.08955223880596 Num Frames: 88 Elapsed Time: 1.072 Num MS in last frame: 10 Average FPS: 82.25508317929759 Num Frames: 89 Elapsed Time: 1.082 Num MS in last frame: 10 Average FPS: 81.66969147005445 Num Frames: 90 Elapsed Time: 1.102 Num MS in last frame: 20 Average FPS: 81.83453237410072 Num Frames: 91 Elapsed Time: 1.112 Num MS in last frame: 10 Average FPS: 81.9964349376114 Num Frames: 92 Elapsed Time: 1.122 Num MS in last frame: 10 Average FPS: 82.15547703180212 Num Frames: 93 Elapsed Time: 1.132 Num MS in last frame: 10 Average FPS: 82.31173380035027 Num Frames: 94 Elapsed Time: 1.142 Num MS in last frame: 10 Average FPS: 82.46527777777779 Num Frames: 95 Elapsed Time: 1.152 Num MS in last frame: 10 Average FPS: 81.91126279863482 Num Frames: 96 Elapsed Time: 1.172 Num MS in last frame: 20 Average FPS: 82.06429780033841 Num Frames: 97 Elapsed Time: 1.182 Num MS in last frame: 10 Average FPS: 82.21476510067114 Num Frames: 98 Elapsed Time: 1.192 Num MS in last frame: 10 Average FPS: 82.36272878535775 Num Frames: 99 Elapsed Time: 1.202 Num MS in last frame: 10 Average FPS: 82.50825082508251 Num Frames: 100 Elapsed Time: 1.212 Num MS in last frame: 10 Average FPS: 82.65139116202946 Num Frames: 101 Elapsed Time: 1.222 Num MS in last frame: 10 Average FPS: 82.1256038647343 Num Frames: 102 Elapsed Time: 1.242 Num MS in last frame: 20 Average FPS: 82.26837060702876 Num Frames: 103 Elapsed Time: 1.252 Num MS in last frame: 10 Average FPS: 82.40887480190175 Num Frames: 104 Elapsed Time: 1.262 Num MS in last frame: 10 Average FPS: 82.54716981132076 Num Frames: 105 Elapsed Time: 1.272 Num MS in last frame: 10 Average FPS: 82.6833073322933 Num Frames: 106 Elapsed Time: 1.282 Num MS in last frame: 10 Average FPS: 81.55487804878048 Num Frames: 107 Elapsed Time: 1.312 Num MS in last frame: 30 Average FPS: 81.69440242057489 Num Frames: 108 Elapsed Time: 1.322 Num MS in last frame: 10 Average FPS: 81.83183183183182 Num Frames: 109 Elapsed Time: 1.332 Num MS in last frame: 10 Average FPS: 81.96721311475409 Num Frames: 110 Elapsed Time: 1.342 Num MS in last frame: 10 Average FPS: 82.10059171597632 Num Frames: 111 Elapsed Time: 1.352 Num MS in last frame: 10 Average FPS: 81.63265306122449 Num Frames: 112 Elapsed Time: 1.372 Num MS in last frame: 20 Average FPS: 81.76555716353113 Num Frames: 113 Elapsed Time: 1.382 Num MS in last frame: 10 Average FPS: 81.89655172413794 Num Frames: 114 Elapsed Time: 1.392 Num MS in last frame: 10 Average FPS: 82.02567760342369 Num Frames: 115 Elapsed Time: 1.402 Num MS in last frame: 10 Average FPS: 82.1529745042493 Num Frames: 116 Elapsed Time: 1.412 Num MS in last frame: 10 Average FPS: 82.27848101265823 Num Frames: 117 Elapsed Time: 1.422 Num MS in last frame: 10 Average FPS: 81.83079056865465 Num Frames: 118 Elapsed Time: 1.442 Num MS in last frame: 20 Average FPS: 81.95592286501378 Num Frames: 119 Elapsed Time: 1.452 Num MS in last frame: 10 Average FPS: 82.02323991797675 Num Frames: 120 Elapsed Time: 1.463 Num MS in last frame: 11 Average FPS: 82.14528173794976 Num Frames: 121 Elapsed Time: 1.473 Num MS in last frame: 10 Average FPS: 82.2656776803776 Num Frames: 122 Elapsed Time: 1.483 Num MS in last frame: 10 Average FPS: 82.38446081714667 Num Frames: 123 Elapsed Time: 1.493 Num MS in last frame: 10 Average FPS: 81.95637805684072 Num Frames: 124 Elapsed Time: 1.513 Num MS in last frame: 20 Average FPS: 82.07485226526593 Num Frames: 125 Elapsed Time: 1.523 Num MS in last frame: 10 Average FPS: 82.19178082191782 Num Frames: 126 Elapsed Time: 1.533 Num MS in last frame: 10 Average FPS: 82.30719377835386 Num Frames: 127 Elapsed Time: 1.543 Num MS in last frame: 10 Average FPS: 82.42112041210561 Num Frames: 128 Elapsed Time: 1.553 Num MS in last frame: 10 Average FPS: 82.53358925143954 Num Frames: 129 Elapsed Time: 1.563 Num MS in last frame: 10 Average FPS: 82.122552116235 Num Frames: 130 Elapsed Time: 1.583 Num MS in last frame: 20 Average FPS: 82.23477715003139 Num Frames: 131 Elapsed Time: 1.593 Num MS in last frame: 10 Average FPS: 82.34560199625702 Num Frames: 132 Elapsed Time: 1.603 Num MS in last frame: 10 Average FPS: 82.4550526968382 Num Frames: 133 Elapsed Time: 1.613 Num MS in last frame: 10 Average FPS: 82.56315465187923 Num Frames: 134 Elapsed Time: 1.623 Num MS in last frame: 10 Average FPS: 82.16676810712111 Num Frames: 135 Elapsed Time: 1.643 Num MS in last frame: 20 Average FPS: 82.27465214761041 Num Frames: 136 Elapsed Time: 1.653 Num MS in last frame: 10 Average FPS: 82.38123872519543 Num Frames: 137 Elapsed Time: 1.663 Num MS in last frame: 10 Average FPS: 82.48655110579797 Num Frames: 138 Elapsed Time: 1.673 Num MS in last frame: 10 Average FPS: 82.5906120023767 Num Frames: 139 Elapsed Time: 1.683 Num MS in last frame: 10 Average FPS: 82.69344359125812 Num Frames: 140 Elapsed Time: 1.693 Num MS in last frame: 10 Average FPS: 82.31173380035025 Num Frames: 141 Elapsed Time: 1.713 Num MS in last frame: 20 Average FPS: 82.4143934997098 Num Frames: 142 Elapsed Time: 1.723 Num MS in last frame: 10 Average FPS: 82.51586843623774 Num Frames: 143 Elapsed Time: 1.733 Num MS in last frame: 10 Average FPS: 82.61617900172116 Num Frames: 144 Elapsed Time: 1.743 Num MS in last frame: 10 Average FPS: 82.7153451226469 Num Frames: 145 Elapsed Time: 1.753 Num MS in last frame: 10 Average FPS: 82.81338627339763 Num Frames: 146 Elapsed Time: 1.763 Num MS in last frame: 10 Average FPS: 82.44531688166013 Num Frames: 147 Elapsed Time: 1.783 Num MS in last frame: 20 Average FPS: 82.54322364751813 Num Frames: 148 Elapsed Time: 1.793 Num MS in last frame: 10 Average FPS: 82.64004437049363 Num Frames: 149 Elapsed Time: 1.803 Num MS in last frame: 10 Average FPS: 82.7357970215113 ...etc. |
From: Kevin N. <kn...@ca...> - 2001-12-01 00:54:34
|
Hey all. I'm new to OpenGL and GL4Java, so please bear with me. I am having problems getting GL4Java to perform quite as well as I = expected it to. I created a small demo with a triangle that you can fly = around the screen. It's just a single non-textured, non-lit polygon. = But I can't seem to get a FPS higher than 83 or so on my Athlon 1.4 = Geforce3 system (at 85Hz refresh and with VSYNC on). Also, every so = often it'll just skip for a second, and the ship will appear somewhere = else. If I turn VSYNC off the skipping is MUCH worse, but I get around = 99.4 fps. On my friends' computer running Win98, it runs so crappily = you can barely tell where the ship is at any given point. I created the GLAnimCanvas using GLDrawableFactory as suggested on this = list, and called canvas.setUseRepaint(false), = canvas.setUseFpsSleep(false), canvas.setUseYield(false) on it. Possible explanations... 1) I'm feeding GL4Java such a tiny rendering job that it finished too = quickly and is having timing problems? However, I don't think this is = the case, because when I call setUseFpsSleep(true) and = setAnimateFps(60), I get a frame rate of around 34. With VSYNC off and = setUseFpsSleep(true) and setAnimateFps(85) at 85Hz, I get 83fps, but = then I have other problems. 2) I am calculating my FPS wrong? This is how I currently do it. Every = time display() is called, I get the amount of time between this tick and = last tick by calling ((new Date()).getTime() - lastTick)/1000.0, which = should give me a double that is the amount of time in seconds since the = last tick. However, this "delta-time" is ALWAYS a multiple of 10 = milliseconds. I don't understand that. Is GL4Java somehow locked at = 100 fps max? Even that wouldn't explain it, because I should be able to = get 11ms delta-times, and 12, 13, etc. But I always get 10s, 20s, and = 30s. Which really sucks. Also, is Date.getTime the best way to handle ticking? There must be a = better way out there (maybe something like the windows API high = performance counter?)... My code is included...it is all in one file, so it should be easy to = read. Thanks much in advance for any help! -Kevin ******************************************************************* import gl4java.*; import gl4java.awt.*; import gl4java.drawable.*; import java.awt.*; import java.util.*; import java.awt.event.*; import java.awt.image.*; import javax.swing.*; import java.net.*; public class GL4JavaTest implements GLEventListener, MouseListener, = KeyListener { private static class MovingTriangle { // physics private double x; private double y; private double rotation; private double vx; private double vy; =20 // display private static float[][][] mesh; private static int displayList =3D -1; =20 // input private boolean bRotRight =3D false; private boolean bRotLeft =3D false; private boolean bAccel =3D false; private boolean bReverse =3D false; =20 // default non-static parameters private double rotRate; private double accelRate; private double maxRate; =20 // default static initialization static { float[][][] newMesh =3D { { { 3.0f, 0.0f, 0.0f }, { -2.598f, 1.5f, 0.0f }, { -2.598f,-1.5f, 0.0f } } }; mesh =3D newMesh; } =20 // default non-static initialization { rotRate =3D 270.0; accelRate =3D 80.0; maxRate =3D 35.0; } =20 public MovingTriangle() { this(0.0, 0.0, 0.0, 0.0, 90.0); } =20 public MovingTriangle(double locX, double locY, double velX, = double velY, double rot) { x =3D locX; y =3D locY; vx =3D velX; vy =3D velY; rotation =3D rot; } =20 private void createDisplayList(GLAnimCanvas glc) { displayList =3D glc.gl.glGenLists(1); glc.gl.glNewList(displayList, GL_COMPILE); glc.gl.glBegin(GL_TRIANGLES); for (int i =3D 0; i < mesh.length; i++) { glc.gl.glVertex3f(mesh[i][0][0], mesh[i][0][1], = mesh[i][0][2]); glc.gl.glVertex3f(mesh[i][1][0], mesh[i][1][1], = mesh[i][1][2]); glc.gl.glVertex3f(mesh[i][2][0], mesh[i][2][1], = mesh[i][2][2]); } glc.gl.glEnd(); glc.gl.glEndList(); } =20 public void tick(double deltaTime) { x +=3D vx * deltaTime; y +=3D vy * deltaTime; =20 if (bRotRight) addRotation(-rotRate * deltaTime); else if (bRotLeft) addRotation(rotRate * deltaTime); =20 if (bAccel) accelerate(accelRate * deltaTime); } =20 public void render(GLAnimCanvas glc) { if (displayList =3D=3D -1) createDisplayList(glc); glc.gl.glTranslated(x , y, -100.0); glc.gl.glRotated(rotation, 0.0, 0.0, 1.0); glc.gl.glCallList(displayList); } =20 public void addRotation(double addRot) { rotation =3D (rotation + addRot) % 360.0; if (rotation < 0.0) rotation =3D 360.0 + (rotation % 360.0); } =20 public void accelerate(double deltaTime) { vx +=3D deltaTime * Math.cos(Math.toRadians(rotation)); vy +=3D deltaTime * Math.sin(Math.toRadians(rotation)); double length =3D Math.sqrt(vx*vx + vy*vy); if (length > maxRate) { vx =3D (vx / length) * maxRate; vy =3D (vy / length) * maxRate; } } =20 public void setInput(boolean bRR, boolean bRL, boolean bA) { bRotRight =3D bRR; bRotLeft =3D bRL; bAccel =3D bA; } =20 } =20 private static GLAnimCanvas canvas; private static GL4JavaTest gl4JavaTest; private static GraphicsEnvironment ge =3D = GraphicsEnvironment.getLocalGraphicsEnvironment(); private static GraphicsDevice gd =3D ge.getDefaultScreenDevice(); private static int frameCount =3D 0; private static MovingTriangle myTriangle =3D new MovingTriangle(); private static boolean[] keys =3D new boolean[255]; private static long lastTick; private static long numFrames =3D 0; private static long elapsedTime =3D 0; private static final int WIDTH =3D 1280; private static final int HEIGHT =3D 1024; =20 public static void main(String args[]) { gl4JavaTest =3D new GL4JavaTest(); Frame glWindow =3D new Frame("Java Test - Moving Triangle!"); GraphicsEnvironment ge =3D = GraphicsEnvironment.getLocalGraphicsEnvironment(); Cursor hiddenCursor =3D null; GLCapabilities glCaps =3D new GLCapabilities(); =20 glWindow.setUndecorated(true); glWindow.setLayout(new BorderLayout()); glWindow.setIgnoreRepaint(true); =20 glWindow.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { gd.setFullScreenWindow(null); System.exit(0); } }); =20 canvas =3D = GLDrawableFactory.getFactory().createGLAnimCanvas(glCaps, WIDTH, = HEIGHT); canvas.addGLEventListener((GLEventListener)gl4JavaTest); canvas.addKeyListener(gl4JavaTest); canvas.setUseRepaint(false); canvas.setUseFpsSleep(false); canvas.setUseYield(false); //canvas.setAnimateFps(85); =20 glWindow.add("Center", canvas); glWindow.pack(); glWindow.setVisible(true); canvas.setVisible(true); canvas.setIgnoreRepaint(true); canvas.repaint(); canvas.start(); =20 gd.setFullScreenWindow(glWindow); gd.setDisplayMode(new DisplayMode(WIDTH, HEIGHT, 32, 60)); canvas.requestFocus(); } =20 public void reshape (GLDrawable glDrawable, int w, int h) { GLAnimCanvas glc =3D (GLAnimCanvas)glDrawable; glc.gl.glViewport(0,0,WIDTH,HEIGHT); // Reset The Current = Viewport glc.gl.glMatrixMode(GL_PROJECTION); // Select The = Projection Matrix glc.gl.glLoadIdentity(); // Reset The Projection = Matrix = glc.glu.gluPerspective(45.0f,(float)WIDTH/(float)HEIGHT,0.1f,100.0f); glc.gl.glMatrixMode(GL_MODELVIEW); // Select The = Modelview Matrix glc.gl.glLoadIdentity(); } =20 public void display (GLDrawable glDrawable) { long newTick; double deltaTime; GLAnimCanvas glc =3D (GLAnimCanvas)glDrawable; glc.gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); myTriangle.setInput(keys[KeyEvent.VK_NUMPAD6], = keys[KeyEvent.VK_NUMPAD4], keys[KeyEvent.VK_NUMPAD8]); if (keys[KeyEvent.VK_ESCAPE]) { gd.setFullScreenWindow(null); System.exit(0); } newTick =3D (new Date()).getTime(); deltaTime =3D (newTick - lastTick)/1000.0; myTriangle.tick(deltaTime); glc.gl.glLoadIdentity(); myTriangle.render(glc); =20 /* REMOVE ME */ elapsedTime +=3D newTick - lastTick; /* REMOVE ME */ numFrames++; System.out.println("Average FPS: " + = numFrames/(elapsedTime/1000.0)); System.out.println("Num Frames: " + numFrames); System.out.println("Elapsed Time: " + (elapsedTime/1000.0)); System.out.println("Num MS in last frame: " + (newTick - = lastTick)); try { while((new Date()).getTime() - lastTick < 10000) wait(1); } catch(Exception e) { } lastTick =3D newTick; } =20 public void init (GLDrawable glDrawable) { GLAnimCanvas glc =3D (GLAnimCanvas)glDrawable; glc.gl.glShadeModel(GL_SMOOTH); // Enable Smooth = Shading =20 glc.gl.glClearColor(0.0f, 0.0f, 0.0f, 0.5f); // Black = Background glc.gl.glClearDepth(1.0f); // Depth Buffer Setup glc.gl.glEnable(GL_DEPTH_TEST); // Enables Depth = Testing glc.gl.glDepthFunc(GL_LEQUAL); // The Type Of Depth = Testing To Do glc.gl.glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);// = Really Nice Perspective Calculations =20 lastTick =3D (new Date()).getTime(); } =20 public void preDisplay(GLDrawable canvas) {} public void postDisplay(GLDrawable canvas) {} public void cleanup(GLDrawable canvas) {} =20 public void keyPressed (KeyEvent keyEvent) { keys[keyEvent.getKeyCode()] =3D true; } =20 public void keyReleased (KeyEvent keyEvent) { keys[keyEvent.getKeyCode()] =3D false; } =20 public void keyTyped (KeyEvent keyEvent) { } =20 public void mouseExited (MouseEvent mouseEvent) { } =20 public void mouseReleased (MouseEvent mouseEvent) { }=20 =20 public void mousePressed (MouseEvent mouseEvent) { } =20 public void mouseClicked (MouseEvent mouseEvent) { } =20 public void mouseEntered (MouseEvent mouseEvent) { } } |
From: Lamy Jean-B. <a1...@So...> - 2001-11-30 12:21:40
|
Le Mercredi 28 Novembre 2001 07:58, vous avez =E9crit : > Hi > > Thank you for the interest and the reply!!! > > I am doing exactly the thing you suggested (Texture Map the QUAD). I u= sed > to clear both the Frame buffer and the Depth Buffer; thanks to your > suggesstion I now clear the DEPTH BUFFER only. As you suggested I have > added the texture mapping and QUAD generating code to the display list= . > Thanks!!!! > > By the way the image I'm trying to load is 1024*1024!!!! > > I have included my code for the said operation. I you don't mind can y= ou > please point out where I can tweak my code. (Code is below...) > > Thank You > Regards > Asiri You should not recreate your display list in every rendering ! Create it THE FIRST TIME ONLY, then re-use it ! Other consideration : - Are you sure that it is the quad that take so long time to render, and= not the hexagone ? - Are you using software 3D ? Software rendering is typically slowed dow= n by texture changement, and speed is quasi proportionnal to the surface draw= n (so a big quad may be VERY slow). - 1024*1024 may be too big for a texture ? try smaller ! You can also disable some useless OpenGL flag when rendering the quad (e= .g. lights, fog, depth test...); it may be a little faster (but probably not= a lot). Jiba |
From: Asiri W. <as...@fc...> - 2001-11-28 09:09:52
|
Hi All I am a newbie to OpenGL :-) I am experimenting with a small app these days which need to load a = static background image (Say a JPG). On top of this I am displaying some = polygons.=20 Currently I refresh the background image plus the polygons... As = expected the it takes a decade to render the scene!!!!!! Is there a way to place a image in a seperate layer may be and only = update the polygons???? I've heard of Depth-Buffered images but I have = no clue of going about it. This method was suggested in the RedBook of = OpenGL programming which uses the depth buffer and the stencil buffer... Thank you in advance for any advice Regards Asiri |
From: <pet...@ba...> - 2001-11-27 07:12:49
|
Must be me then...just thought I'd try and eliminate that option before I spent too much time looking into it... Thanks. > -----Original Message----- > From: kbr...@al... [mailto:kbr...@al...] > Sent: Tuesday, November 27, 2001 6:35 AM > To: pet...@ba... > Cc: gl4...@li... > Subject: Re: [gl4java-usergroup] glDrawElements > > > *** WARNING *** > > This mail has originated outside your organization, > either from an external partner or the Global Internet. > Keep this in mind if you answer this message. > > > > > Java doesn't have any unsigned data types, so this method > dies a death > > when the signed data is read as unsigned, it becomes > massive and the > > native code tries to read beyond the end of the array. > > > > Or at least thats what I think is happening. I can't find > any examples > > in the demos that use glDrawElements: is this because it > doesn't work? > > http://java.sun.com/products/jfc/tsc/articles/jcanyon/ > > See the source code, specifically terrain.MultiResTile. > > Signed versus unsigned only really becomes an issue when > promoting to a larger type; for example, byte to int. If the high > bit is set and the type is signed (as all types are in Java) then > the value will be sign-extended. In Java this is most problematic > when dealing with byte and short types which automatically get > promoted to ints in intermediate expressions. I frequently > promote to int early, masking appropriately if necessary, and > deal with ints from then on. > > However, when dealing with OpenGL, one can pretty much ignore the > issue. You need to ensure that you are using the correct Java > data type to match the one expected by OpenGL (byte for > GL_UNSIGNED_BYTE, short for GL_UNSIGNED_SHORT, and int for > GL_UNSIGNED_INT). Even if the values in the array overflow into > the high bit (and therefore become negative in Java's view), > OpenGL will treat them properly. > ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ******************************************************************** |
From: Kenneth B. R. <kbr...@al...> - 2001-11-27 06:35:09
|
> Java doesn't have any unsigned data types, so this method dies a death > when the signed data is read as unsigned, it becomes massive and the > native code tries to read beyond the end of the array. > > Or at least thats what I think is happening. I can't find any examples > in the demos that use glDrawElements: is this because it doesn't work? http://java.sun.com/products/jfc/tsc/articles/jcanyon/ See the source code, specifically terrain.MultiResTile. Signed versus unsigned only really becomes an issue when promoting to a larger type; for example, byte to int. If the high bit is set and the type is signed (as all types are in Java) then the value will be sign-extended. In Java this is most problematic when dealing with byte and short types which automatically get promoted to ints in intermediate expressions. I frequently promote to int early, masking appropriately if necessary, and deal with ints from then on. However, when dealing with OpenGL, one can pretty much ignore the issue. You need to ensure that you are using the correct Java data type to match the one expected by OpenGL (byte for GL_UNSIGNED_BYTE, short for GL_UNSIGNED_SHORT, and int for GL_UNSIGNED_INT). Even if the values in the array overflow into the high bit (and therefore become negative in Java's view), OpenGL will treat them properly. |
From: <pet...@ba...> - 2001-11-26 18:52:43
|
Hello, I have an application which would be very hard to restructure to just use glDrawArrays, so I've been forced to use glDrawElements instead. The third parameter for glDrawElements has to be one of either GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT or GL_UNSIGNED_INT. Java doesn't have any unsigned data types, so this method dies a death when the signed data is read as unsigned, it becomes massive and the native code tries to read beyond the end of the array. Or at least thats what I think is happening. I can't find any examples in the demos that use glDrawElements: is this because it doesn't work? I've had this problem before with native code: when pulling values out of the opengl buffers they come back as unsigned data, which i've then had to convert into signed again. Do I always have to do this? Couldn't you put it into the native code? Hope I'm not hugely missing the point here! Thanks, Pete ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ******************************************************************** |
From: Kenneth B. R. <kbr...@al...> - 2001-11-23 20:58:47
|
> The reason for the upgrade to XServer 4.1.0 was to get my old Voodoo II to > actually do something under X. Does anybody here know how I can turn on > hardware acceleration with gl4Java? This is automatic but might depend on the visual that is selected. You should be able to use GLDrawableFactory and GLCapabilities to choose a similar visual to that created in C code. Also keep in mind that GLJPanel and GLAnimJPanel are curently not hardware accelerated, as they render to an offscreen buffer and copy pixels to the screen; use GLCanvas or GLAnimCanvas instead. |
From: Romain S. <ro...@zz...> - 2001-11-23 09:03:51
|
On Fri, 23 Nov 2001, Romain Slootmaekers wrote: > Yo, > > After upgrading my XFree86 server to version 4.1.0 from 4.0.3, my > installment of gl4Java stopped working.... upgrading to the 2.8.0.8 > version didn't help > either. Fixed: appearantly. libGL.so and LibGLU.so get dumped in to /usr/X11R6/lib instead of in /usr/lib . The first is not in my LD_LIBRARY_PATH. adding a few soft links fixed the problem. The reason for the upgrade to XServer 4.1.0 was to get my old Voodoo II to actually do something under X. Does anybody here know how I can turn on hardware acceleration with gl4Java? Sloot. |
From: Kenneth B. R. <kbr...@al...> - 2001-11-23 04:33:25
|
> GLERROR: cannot access OpenGL library libGL.so > fetched GL/GLU functions succesfully ! > Exception occurred during event dispatching: > java.lang.StackOverflowError > at gl4java.GLContext.openOpenGLNative(Native Method) Turn on GLContext.gljClassDebug and the other debugging flags to see what is going on in the implementation. Usually the JVM can't gracefully recover from stack overflows in native code, so the fact that this is reported as one is pretty suspicious. It's possible that the native code is actually crashing because it couldn't find an appropriate visual or something similar. |
From: Romain S. <ro...@zz...> - 2001-11-23 00:43:19
|
Yo, After upgrading my XFree86 server to version 4.1.0 from 4.0.3, my installment of gl4Java stopped working.... upgrading to the 2.8.0.8 version didn't help either. Additional info: 1) the Mesa demo's (gears,reflect,....) work fine. 2) so do the C opengl progams I build. 3) the gl4Java demo's that used to work fine, have the same problem. 4) the relevant part of the gl4Java messages is: GLERROR: cannot access OpenGL library libGL.so fetched GL/GLU functions succesfully ! Exception occurred during event dispatching: java.lang.StackOverflowError at gl4java.GLContext.openOpenGLNative(Native Method) at gl4java.GLContext.gljInit(GLContext.java:1984) at gl4java.GLContext.createGLContext(GLContext.java:1930) at gl4java.GLContext.<init>(GLContext.java:1153) at gl4java.GLContext.<init>(GLContext.java:1213) at gl4java.GLContext.<init>(GLContext.java:1278) at gl4java.awt.GLCanvas.paint(GLCanvas.java:430) at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:43) at sun.awt.RepaintArea.paint(RepaintArea.java:309) at sun.awt.motif.MComponentPeer.handleEvent(MComponentPeer.java:348) at java.awt.Component.dispatchEventImpl(Component.java:2719) at java.awt.Component.dispatchEvent(Component.java:2553) at java.awt.EventQueue.dispatchEvent(EventQueue.java:401) at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:109) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:99) at java.awt.EventDispatchThread.run(EventDispatchThread Does anyone have similar experiences ? TIA, Sloot. |
From: Kenneth B. R. <kbr...@al...> - 2001-11-13 15:57:24
|
> The GLCapabilities class of GL4JAVA seems quite different from the base > capabilities class of JAVA. How do we know what capabilities are used by > GLCapabilities ? I mean...it's unclear if page flipping is used, or if multi > bufferring is used for example... are these details hidden from the user, or > did Sven find out it wasn't worst using them ? To the best of my knowledge it is not possible to request, for example, triple buffering in an OpenGL context. It looks like this is hidden at the driver level. The GLCapabilities abstracts most of the parameters in the PIXELFORMATDESCRIPTOR on Windows and the XVisualInfo on X11. > public class OMWindow extends JFrame implements GLEventListener{ > > My program was crashing at runtime, and I finally figured out it was GL4Java > that was no longer calling the init(GLDrawable drawable) with this class > configuration depending wich fullscreen resolution I was using. At > 640x480x60Hz the init() method was called, at 1280x960x85Hz it wasn't...this > behavior was very weird. This is unfortunate and very strange but is probably due to some sort of bad interaction with the AWT native code. > I decided to split the GLEventListener from the JFrame like it's done in > jCanyon and put it as a nested class : > > public class OMWindow extends JFrame { > ... > > class Listener implements GLEventListener { > > public void init(GLDrawable drawable){} > > ... > } > } > > After the modification, everything went fine... Personally I don't like subclassing AWT or Swing widgets because it seems to me there are too many hidden invariants in the implementations that I don't know how to maintain. Thus the introduction of the GLEventListener model. > My second problem was that I was still calling the following methods in my > display function : > public void display() > { > //Ensure GL is initialised correctly > if (!glj.gljMakeCurrent())return; > > //display code goes here > //... > > gl.glFlush(); > //Swap buffers > glj.gljSwap(); > glj.gljCheckGL(); > glj.gljFree(); > } > The result was that I had my memory use increasing at the speed of 1 meg > every 10 second, as well as my CPU use wich would increase up to a 100% in a > minute, resulting in the application slowdown and finally its crash. > I should have known, since it's written in the FAQ (but has been added by > Sven in a second pass and I didn't figure it) that when using the listener > model, these methods are already called by GL4JAVA and you musn't call them > again. the only method you should keep call is glj.gljCheckGL(); in order to > track for OpenGL Errors. So with the listener model, the display loop should > look like this : > > public void display() > { > //display code goes here > //... > > glj.gljCheckGL(); > } I recall having a similar, but not identical, problem when porting some applications to the GLEventListener model. Sorry it wasn't easier to debug this. If you can supply a small test case which is easy to switch between the "right" and "wrong" behavior perhaps we can add some code to check for some of these errors. |
From: Kenneth B. R. <kbr...@al...> - 2001-11-13 15:40:16
|
> The application I'm programming requires that I set up some display > lists in OpenGL before I actually paint a single picture (in fact, > before the GLCanvas comes onscreen). Because GL4Java creates it's > context immediately prior to sending it's first display() event, this > method of setting up display lists before the first draw doesn't work... Create the display lists in your init() method, preferably by installing a GLEventListener into the GLCanvas and implementing init() in it, but alternatively by subclassing GLCanvas and overriding init(). |
From: <pet...@ba...> - 2001-11-13 08:27:42
|
We've found a bit of a problem with GL4Java too...or at least I think so. The application I'm programming requires that I set up some display lists in OpenGL before I actually paint a single picture (in fact, before the GLCanvas comes onscreen). Because GL4Java creates it's context immediately prior to sending it's first display() event, this method of setting up display lists before the first draw doesn't work... Any ideas? ******************************************************************** This email and any attachments are confidential to the intended recipient and may also be privileged. If you are not the intended recipient please delete it from your system and notify the sender. You should not copy it or use it for any purpose nor disclose or distribute its contents to any other person. ******************************************************************** |
From: Alban C. <aco...@wa...> - 2001-11-12 10:48:38
|
>Hi, > I'm just guessing here, but when you do the opengl swapbuffers command, > I'm pretty sure it has to wait for the next vertical refresh on your > monitor before it happens. So your swaps are quantized to 85hz, > or whatever your monitor is set to. > If you increase the resolution so that it can no longer run at > that speed, suddenly it should jump to half that speed. Thanks for the tip noisebrain :) This is an important issue for fullscreen mode. I think this paragraph from a Power VR whitepaper explains why : Frame Rate Limiting/Locking Most games today allow the frame rate to seek it's own level and to go up and down as the scene complexity changes. This looks ok when you're running at less than 30 frames per second but if your game occasionally bounces between 30 and 60 frames per second (or even 30 and 120!) the speed changes start to get pretty jarring since your talking about frequent doubling/halving of speed. The higher your average frame rate is, the more necessary it is to keep the frame rate constant for things to look smooth. For this reason, most games will want to throttle their performance and lock in on a frame rate that they can maintain fairly consistently. There are a lot of ways to do this which I won't go into here, the main thing you want to be sure of is that you pick the RIGHT number to lock in on. You need to determine the refresh rate of the monitor and pick a frame rate that is a multiple of that monitor's refresh rate. If, for example, you try to lock in at a 30hz frame rate when the monitor is running at 75hz, your frame rate will tend to wobble between 37.5 and 25hz. The overall effect is not immediately obvious (usually the game still feels "fast" but not "smooth") but over time it can cause considerable eyestrain and fatigue in the player. In addition to locking in at a multiple of the monitor refresh frequency, it 's also a good idea to run the monitor at the highest refresh rate it can manage as it gives you more potential "notches" you can lock into. At 60hz you only get four choices from max speed down to 15 hz (60, 30, 20 and 15) At 120 hz you get 8 (120, 60, 40, 30, 24, 20, 17, and 15) which gives you more chances to pick your highest speed, and makes the change less noticeable if your engine accidentally skips a frame. Regards, Alban |
From: Alban C. <aco...@wa...> - 2001-11-12 10:27:08
|
Hello Kenneth, hi all :) In reply to a mail of Kenneth, I'm posting a copy of this email to the mailing list, since I beleive some elements could be interesting for everyone... > > (...) I've coded fullscreen mode yesterday and I must say it rocks !! It has > > solved my fill rate problem, and my plane model of the little benchmarck I > > posted on the mailing list yesterday now runs at 85 FPS at 1280*960*85Hz > > while it was running at 43 FPS at the same resolution in windowed mode ! > What platform are you running on? Are you using the built-in > fullscreen support in JDK 1.4? I > noticed that some fullscreen bits came into the GLCapabilities > class in Sven's latest putback but it isn't clear to me whether > it's fully implemented. As long as one specifies > -Dsun.java2d.noddraw=true on the command line (on Windows), the > JDK's full-screen support works with gl4java. The fullscreen mode works on windows 2000 with JDK 1.4 beta 2 gl4Java is rel-2-8-0-8-prerelease. I haven't had to use any special trick, such as command line parameter tweaking. Everything went fine, as long as I used GL4JAVA properly. BUT before succeeding having it working, I met the problems descibed below in section [PROBLEMS], due to an innapropriate use of GL4JAVA... The code I have made is very close of jCanyon's, since it was the only sample implementation I found, except the ones of the Java Tutorial. Kenneth, here is the GLCapabilities bit config : gc = new GLCapabilities(true, false, true, 0, 0, 0, 0, 0); it's exactly the same as in jcanyon. The GLCapabilities class of GL4JAVA seems quite different from the base capabilities class of JAVA. How do we know what capabilities are used by GLCapabilities ? I mean...it's unclear if page flipping is used, or if multi bufferring is used for example... are these details hidden from the user, or did Sven find out it wasn't worst using them ? [PROBLEMS] While implementing the listener model and fullscreen mode, I've met some problems : I had first designed a JFrame class implementing the GLEventListener interface. the design was like this : public class OMWindow extends JFrame implements GLEventListener{ My program was crashing at runtime, and I finally figured out it was GL4Java that was no longer calling the init(GLDrawable drawable) with this class configuration depending wich fullscreen resolution I was using. At 640x480x60Hz the init() method was called, at 1280x960x85Hz it wasn't...this behavior was very weird. I decided to split the GLEventListener from the JFrame like it's done in jCanyon and put it as a nested class : public class OMWindow extends JFrame { ... class Listener implements GLEventListener { public void init(GLDrawable drawable){} ... } } After the modification, everything went fine... My second problem was that I was still calling the following methods in my display function : public void display() { //Ensure GL is initialised correctly if (!glj.gljMakeCurrent())return; //display code goes here //... gl.glFlush(); //Swap buffers glj.gljSwap(); glj.gljCheckGL(); glj.gljFree(); } The result was that I had my memory use increasing at the speed of 1 meg every 10 second, as well as my CPU use wich would increase up to a 100% in a minute, resulting in the application slowdown and finally its crash. I should have known, since it's written in the FAQ (but has been added by Sven in a second pass and I didn't figure it) that when using the listener model, these methods are already called by GL4JAVA and you musn't call them again. the only method you should keep call is glj.gljCheckGL(); in order to track for OpenGL Errors. So with the listener model, the display loop should look like this : public void display() { //display code goes here //... glj.gljCheckGL(); } I hope this will help some people avoid doing the same mistakes... Regards, Alban Cousinie |
From: Laurent M. <la...@mi...> - 2001-11-11 22:48:02
|
Thanks for your answer ! Functions are really loaded after glcontext creation ... ----- Original Message ----- From: "Kenneth B. Russell" <kbr...@al...> To: "Laurent Michot" <la...@mi...> Cc: <gl4...@li...> Sent: Sunday, November 11, 2001 11:21 PM Subject: Re: [gl4java-usergroup] Multitexturing functions not implemented > > > I got a geForce, and when I start any gl4java app, I've got lots of "not > > implemented functions", especially for . > > I've already read in the mailing list archive that it's due to an hardware > > issue, not a GL4Java issue ... > > So, GeForce does not support multitexuring ??? Or gl4java don't use my > > accelerated hardware ? > > What are the consequences of using non implemented functions ? > > Thanks in advance for any help, > > Just this weekend we found a problem where many extensions didn't > become available until an OpenGL context was first made current > in the process. This seems to be true at least on Windows and at > least with NVidia's drivers. A bug fix for this has just been > checked into the CVS repository and will be present in the final > 2.8 release. > > If one attempts to use an unimplemented extension it will > silently return without doing anything. One can check for the > existence of an extension with GLContext.gljTestGLProc(<function > name>). > |
From: Kenneth B. R. <kbr...@al...> - 2001-11-11 22:22:02
|
> I got a geForce, and when I start any gl4java app, I've got lots of "not > implemented functions", especially for . > I've already read in the mailing list archive that it's due to an hardware > issue, not a GL4Java issue ... > So, GeForce does not support multitexuring ??? Or gl4java don't use my > accelerated hardware ? > What are the consequences of using non implemented functions ? > Thanks in advance for any help, Just this weekend we found a problem where many extensions didn't become available until an OpenGL context was first made current in the process. This seems to be true at least on Windows and at least with NVidia's drivers. A bug fix for this has just been checked into the CVS repository and will be present in the final 2.8 release. If one attempts to use an unimplemented extension it will silently return without doing anything. One can check for the existence of an extension with GLContext.gljTestGLProc(<function name>). |
From: Kenneth B. R. <kbr...@al...> - 2001-11-11 20:40:34
|
> you refered to this in a post - what is it? This is an improvement to the OpenGL for Java implementation which avoids doing OpenGL context makeCurrent/free calls each frame. It takes effect automatically when a GLAnimCanvas is used. |
From: Laurent M. <la...@mi...> - 2001-11-11 12:26:18
|
Hi everybody, I got a geForce, and when I start any gl4java app, I've got lots of "not implemented functions", especially for . I've already read in the mailing list archive that it's due to an hardware issue, not a GL4Java issue ... So, GeForce does not support multitexuring ??? Or gl4java don't use my accelerated hardware ? What are the consequences of using non implemented functions ? Thanks in advance for any help, Regards, Laurent |