MorphingTerrainBlock & Page


I've made a morphing terrain implementation. You can get it from here:


The first demo (start with testBlock.cmd) shows a block trough its morphing cycle. The second demo (testPage1.cmd) shows a generated heightmap put into a page, the third demo (testPage2.cmd) shows a terrain loaded from RAW heightmap. Keys 0 to 9 switch different options. Switch to wireframe with T to see how the blocks are stitched together. Holding left MB rotates camera, clicking on terrain moves the camera (WSAD works too).

I developed on an ATI Radeon 9700, and to my big dissapointment the first demo wont run on an NVidia card.  :frowning: Why cannot they all make their drivers behave the same?

Anyway, the sources of the demo and of modified jME classes is included in the zip. Feel free to re-use them.

Good stuff… combined with the normal mapping it really reduces noticable popping a lot. Too bad it doesn't work with nVidia (but demos 2 and 3 do work?)… well you released the source so they should be able to figure it out if they really want it :slight_smile:

Yes demos 2 and 3 do work on NVidia. I've been wondering why isn't there a big FPS increase when viewing the least detailed blocks? They are 2 triangles only, and without normal mapping, they should draw really fast. Read on the net that when drawing triangle list/strips, each vertex gets transformed which is in between the used indices. So for example when drawing a triangle with indices 0,1,100 the vertexes 2 to 99 get transformed, no matter that they are not used. So going with that info, i sorted the vertexes so that those present in least detailed block version get to the beginning of vert buffer, and those only visible in the most detailed version get to the end. And, no speed increase.  :?

I tested on OS X and it doesn't work:

Mar 27, 2006 11:25:53 PM com.jme.scene.state.lwjgl.LWJGLShaderObjectsState checkProgramError

SEVERE: ERROR: 0:79: 'nrml' : undeclared identifier

ERROR: 0:79: 'lightDir' : undeclared identifier

ERROR: 0:122: 'sum' : undeclared identifier

ERROR: 0:140: 'COLORRATIO' : undeclared identifier

ERROR: 0:141: 'cl' : undeclared identifier

10.4.5, PB 12" 1.5GHz 768MB RAM, GeForce FX Go5200, JDK 1.5.0_05-83, LWJGL 0.99

Pepez  :?

Can it be that OS X NV driver does not support the "#define" directive in shader code? All those variables are declared if certain "#define"'s are set.

Sad … wont work on an ati mobility 9000 either :frowning: