Show Posts
|
|
Pages: [1] 2
|
|
2
|
Java Game APIs & Engines / JOGL Development / Re: animator
|
on: 2005-06-25 14:26:39
|
|
I think the Animator is for an accruate FPS. While FPSAnimator can't get enough high FPS for the timer accuracy and the thread scheduling model, however FPSAnimator can reduce CPU usage.
|
|
|
|
|
3
|
Java Game APIs & Engines / JOGL Development / Re: Do s and Don't s?
|
on: 2005-06-25 14:03:06
|
I think you can try display list and compare the performance difference for you don't have much choice  I don't know if Xith3D has similar functionalities you want, I think if Xith3D can support cylinders and torus well you many use Xith3D for Xith3D can support VBO well. Or maybe you generate these shapes manually?
|
|
|
|
|
4
|
Java Game APIs & Engines / JOGL Development / Re: Do s and Don't s?
|
on: 2005-06-25 08:28:24
|
To Malek: I mean if you leave the event handling to the system, i.e., the rendering thread of JOGL controlled by the system rather than manullay called in the Animator, things will go smoothly. As to your last post, I didn't undertand much. Do you mean that after you used VBO for your torus and cylinders then what kind of calling methods you should use? If you don't have tens of thounds of objects I think you can just call them with glDrawElements, and instead, if you want to get better ( but maybe a little better) performance, you can use display list. And to gverig: Google is the biggest PhD supervisor in China now One can found answers of most of his problems in Google, however, forums and mail lists are very important too.
|
|
|
|
|
6
|
Java Game APIs & Engines / JOGL Development / Re: yet another Timer question
|
on: 2005-06-25 08:13:21
|
|
What's the timer used for ? for FPS or some other stuff?
As to where to put the timer, I think it depends the thread model you use.
If you use Animator like rendering that call JOGL display in your own thread then you can put the timer where you like, however, if you leave the rendering thread controlled by system I'm afraid that you have to put the code in display.
|
|
|
|
|
8
|
Java Game APIs & Engines / JOGL Development / Re: Random color function for a simple triangle
|
on: 2005-06-24 15:41:44
|
|
Riven's right of the problem that changeColor == false.
I've tested the program on Linux, for the most time the vertices change color well and for a few times the three vertices will have the same color for the problem Riven pointed out.
I think a better way is to put the changed color in an array instead of this method.
|
|
|
|
|
9
|
Java Game APIs & Engines / JOGL Development / Re: Do s and Don't s?
|
on: 2005-06-22 13:11:29
|
I suggest you not use the Animator. Your demo is 100% CPU usage on my P4 2.4Gc, Nvidia 5700LE. When nothing changes, it should not keep drawing.  And I don't think VBO will improve this unless you abandon Animator .
|
|
|
|
|
11
|
Java Game APIs & Engines / JOGL Development / Re: If you use VBO u should set ByteOrder to LITTLE_ENDIAN on Intel platform
|
on: 2005-06-22 12:26:20
|
There are many examples in C++ in the following URL http://www.devmaster.net/forums/index.php?showtopic=360I also have some code but not very clear  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| public void initBufferObject(GL gl) { gl.glEnableClientState(GL.GL_VERTEX_ARRAY); gl.glGenBuffersARB(4, bufID); gl.glBindBufferARB(GL.GL_ARRAY_BUFFER_ARB, bufID[0]); gl.glBufferDataARB(GL.GL_ARRAY_BUFFER_ARB, vbuf.capacity() ), vbuf, GL.GL_STATIC_DRAW_ARB); System.out.println(vbuf.capacity() + " " + counter.end()); gl.glVertexPointer(3, GL.GL_FLOAT, 0, BufferUtils.bufferOffset(0)); vbuf = null; System.gc(); buf_size = (int) ( ); gl.glBindBufferARB(GL.GL_ELEMENT_ARRAY_BUFFER_ARB, bufID[1]); gl.glBufferDataARB(GL.GL_ELEMENT_ARRAY_BUFFER_ARB, fbuf.capacity() * BufferUtils.SIZEOF_FLOAT, fbuf, GL.GL_STATIC_DRAW_ARB); fbuf = null; System.gc(); if (vertexNormal) { gl.glEnableClientState(GL.GL_NORMAL_ARRAY); gl.glBindBufferARB(GL.GL_ARRAY_BUFFER_ARB, bufID[2]); gl.glBufferDataARB(GL.GL_ARRAY_BUFFER_ARB, nbuf.capacity() * BufferUtils.SIZEOF_FLOAT, nbuf, GL.GL_STATIC_DRAW_ARB); gl.glNormalPointer(GL.GL_FLOAT, 0, BufferUtils.bufferOffset(0)); nbuf = null; System.gc(); } if (RGBPointsAvailable) { gl.glEnableClientState(GL.GL_COLOR_ARRAY); gl.glBindBufferARB(GL.GL_ARRAY_BUFFER_ARB, bufID[3]); gl.glBufferDataARB(GL.GL_ARRAY_BUFFER_ARB, cbuf.capacity(), cbuf, GL.GL_STATIC_DRAW_ARB); gl.glColorPointer(3, GL.GL_UNSIGNED_BYTE, 0, BufferUtils.bufferOffset(0)); cbuf = null; System.gc(); } } public void drawBufferObject(GL gl) { gl.glDrawElements(GL.GL_TRIANGLS, numTri * 3, GL.GL_UNSIGNED_INT, BufferUtils.bufferOffset(0)); } } |
There may be some errors, but I've deleted some mess code here.
|
|
|
|
|
12
|
Java Game APIs & Engines / JOGL Development / Time precision in Java
|
on: 2005-06-22 09:26:50
|
|
Do not use System.currentTimeMillis() on Windows platform. Use JDK 1.5 and System.nanoTime()
I read the source of JDK 1.5, the implementation of System.nanoTime is: QueryPerformanceCounter on Windows ( the highest precision method on Windows) gettimeofday for most Linux ( 1 microsecond precsion, just print the nanosecond, if it ends with 000, then JVM uses gettimeofday)
However the implementation of System.cuurentTimeMillis() is: GetSystemTimeAsFileTime on Windows which has only 10 - 15ms granularity on Windows XP and 2000 on Linux, it still uses gettimeofday, just divide the microseconds wth 1000.
However, the java.util.Timer still used System.currentTimeMillis() in JDK 1.5, so it can not get a frequecy higher than 65Hz on Windows platform.
Hope this be useful.
|
|
|
|
|
13
|
Java Game APIs & Engines / JOGL Development / Re: Where can I find articles on performance comparation of JOGL and native Open
|
on: 2005-06-21 07:52:58
|
|
VA needs to transfer the buffer to VRAM every frame while VBO should prefer to be in the RAM. From the API you can say VBO sits on VA, but the performance differs large. This is extremely important for people like me who want to draw models of several millions triangles.
However according to my test, it seems that NV cards doesn't put VBO in the VRAM after the size of total VBOs exceed 128M, even on a card with 256 VRAM installed, I don't know where to ask for more informations about it. For with a 256M VRAM, models of 10million triangles or less can be held fully in the VRAM, while the FPS showed that it's not the case. Both 6800GT and 5950Ultra have the problem.
I don't have ATI card with 256M VRAM so I don't know about it.
|
|
|
|
|
17
|
Java Game APIs & Engines / JOGL Development / Re: Where can I find articles on performance comparation of JOGL and native Open
|
on: 2005-06-19 16:50:34
|
|
Vertex Arrays are still immediate mode, for the maximum speed one should use Vertex Buffer Object. Due to the high overehead of JNI calls, glVertex calls will be the bottleneck, especially for high polygon count. For example I can render a 1 million happy budday model at 14-21fps ( no triangle strips used) with VBO mode while with glVertex I can only render at 1.2fps on my 5700LE.
However, according to my experience of various benchmarks, JOGL can only reach about 60% of the corresponding C++ code.
For example C++ code can render a 176 million triangle model at 55fps on 9700 pro, while JOGL can only reach 34 fps ( but not the same model and no triangle strips used both)
|
|
|
|
|
22
|
Java Game APIs & Engines / JOGL Development / Re: Hi, Guys, what's your maximum fps with JOGL on Windows??
|
on: 2005-06-15 10:51:51
|
Thank you all, I know what the problem is!!!! For I use a timer to drive the JOGL rendering, and I don't know before that the time precision on Windows can only reach 15ms. I found it's very strange that the fps can't exceed 65fps, so I searched google for "java 15ms", and I got it http://forum.java.sun.com/thread.jspa?threadID=612991&messageID=3387915They call it "damn windows", maybe some truth, it means that under windows you can't use a timer to reach more than 65 Hz, really bad. However, I'm very glad to find the answer at last and learned much from the forum, it's great!! Thank all who helped me. Welcome to China!
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|