hasemstickers.blogg.se

Java lwjgl 3d tile picking
Java lwjgl 3d tile picking












The first step to creating a display list is to generate one using the glGenLists method.

java lwjgl 3d tile picking

Here's how I'm generating the terrain display list: Display lists cannot be changed once they are created, so they're best to use for items that are expected to not change. Here's a brief overview on how I'm rendering the terrain (with some code, too).Īfter generating the height map, I create a display list which stores the vertex, color, and normals for the terrain.

#Java lwjgl 3d tile picking code

The next step is to implement some LOD code to further increase performance without affecting quality too much. In fact, I'm now getting about 440 million quads per second throughput (compared to 12.6 million quads per second before), which is pretty close to the specs of my graphics card. This takes a huge load off of the memory bus and CPU. I'm now caching the terrain into an OpenGL Display List which holds the draw instructions into a pre-compiled instruction set on the server (a.k.a.

java lwjgl 3d tile picking

I also upped the height map resolution from 300x300 up to 1024x1024, which is made possible by changes made to the render loop. For more details on how I generated the height map see this page.įor fun I switched the colors up to give brownish hue to make the terrain look more like rock. The aesthetics were greatly improved by switching from bilinear interpolation to a sine-based interpolation function. Made some changes to my code and pretty much everything is significantly better. I'm starting to modernize my code by moving to a shader-based model.












Java lwjgl 3d tile picking