Is it possible create 4 million cubes with a frame rate of 35 fps with java Opengl like minecraft? If it's possible how can I do that? And could you give me some examples of source?
-
you know it depends on your graphics card. with display lists I can render 1.2 million polygons on 30 fps, and i got GeForce 6150SE.MoonBun– MoonBun2012-07-02 10:23:16 +00:00Commented Jul 2, 2012 at 10:23
-
I use a glcalllist() and with a for loop I draw the 3D cubes. My graphics card is a GeForce GT540M.user1491548– user14915482012-07-02 11:44:29 +00:00Commented Jul 2, 2012 at 11:44
-
What research have you done into this matter? Have you tried to create the cubes and see what happens? SO is not the place to ask others to write code for you. If you go try some things out and then get stuck, we'd be glad to take a look at the questions you come up with at that time. Maybe you HAVE already done research--but if so you didn't tell us about it. Please edit anything you've tried into your question so we can see the work you've done already and proceed from there. :)WendiKidd– WendiKidd2012-07-03 01:14:35 +00:00Commented Jul 3, 2012 at 1:14
4 Answers

Hi
I already do so in this project that uses JogAmp's Ardor3D Continuation with JOGL. I published some instructions on it here, look at the subsection containing the examples.
N.B: The original code written by MrCoder uses an abandoned and unmaintained version of Ardor3D with the renderer based on your favourite library.
Comments
In this case java is not the bottleneck if you properly preload your coordinate and texture data (preferably using a flyweight object pool) and avoid the use of "new" inside of loops.
There are ways of optimizing the number of drawn cubes. Just avoid drawing far objects like in most modern FPS games, using fog to conceal half finished shapes. The smaller your cubes, the harder they are to see and the nearer you can avoid drawing them. Also try falling back to display lists if your vbo gets too big.
3 Comments
Take a look at instanced rendering. Make sure you don't call OpenGL methods in some kind of loop, because that will kill your performance. If you don't want to use instanced rendering, use display lists (you won't be able to modify it though).
Comments
I'm doing something similar right now in jogl.
I'm sure you've already done it (in the 2 years you've had) but for onlookers and lurkers:
1.) VBOs (vertex buffer objects) is much better than immediate mode/display lists
2.) Custom Shaders (vertex and fragment)
3.) Instanced Rendering (which I'm trying to figure out right now)
Here are some useful links to other peoples opinion on faster multi-rendering:
http://sol.gfxile.net/cubes.html
http://www.opengl.org/wiki/Vertex_Rendering#Multi-Draw