Here comes the source code for those who don't want to download the file with the effects and graphics, but is curious how the source code looks like.
#include "DarkGDK.h"
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate (0);
dbSetWindowOff ();
dbSetDisplayMode (1280, 1024, 32);
dbHideMouse ( );
dbSetCameraRange ( 1.0f, 30000.0f );
dbScreenFPS ( );
dbColorBackdrop ( 0xFF8EB7ED ); // Blue sky
// Load sea object
dbLoadObject ( "Water1.dbo", 1 );
dbLoadObject ( "Water2.dbo", 1 );
dbLoadObject ( "Water3.dbo", 1 );
dbSetObject ( 1 , 1, 0, 0 );
// Setup effect
dbLoadEffect ( "Shading.fx", 1, 0 ); // Wave displacement shader
dbLoadImage ( "Waves.dds", 1 ); // Wave displacement maps
dbTextureObject ( 1, 0, 1 );
dbLoadImage ( "Sky.dds", 2, 2 ); // Sky-cubemap(fresnel reflection)
dbTextureObject ( 1, 1, 2 );
dbLoadImage ( "Sea.dds", 3, 2 ); // Sea-subemap(refraction)
dbTextureObject ( 1, 2, 3 );
// Apply effect
dbSetObjectEffect ( 1, 1 );
// Set effect values
dbSetEffectConstantFloat ( 1, "oct1Scale", 0.0005 ); // Scale of the waves, worldX/Z pos * scale
dbSetEffectConstantFloat ( 1, "oct2Scale", 0.002 );
dbSetEffectConstantFloat ( 1, "oct3Scale", 0.005 );
dbSetEffectConstantFloat ( 1, "oct2Time", 1.5 ); // Cycle speed of octaves
dbSetEffectConstantFloat ( 1, "oct3Time", 0.8 );
dbSetEffectConstantFloat ( 1, "oct1Power", 5.0 ); // Max wave height for each octave
dbSetEffectConstantFloat ( 1, "oct2Power", 0.75 );
dbSetEffectConstantFloat ( 1, "oct3Power", 0.125 );
dbSetEffectConstantFloat ( 1, "oct1Scroll", 0.01 ); // Displacement map scroll speed by UV*time
dbSetEffectConstantFloat ( 1, "oct2Scroll", 0.02 );
dbSetEffectConstantFloat ( 1, "oct3Scroll", 0.06 );
dbSetEffectConstantFloat ( 1, "sampleWidth", 2.0 ); // Width of each water mesh grid tile
dbSetEffectConstantFloat ( 1, "sampleHeight", 4.0 ); // Tile width * 2.0
// position the camera
dbPositionCamera ( 434, 115, -517 );
// camera variables
float fCameraAngleX = 0.0f;
float fCameraAngleY = 0.0f;
// our main loop
while ( LoopGDK ( ) )
{
// move the camera using the arrow keys
dbControlCameraUsingArrowKeys ( 0, 5.0f, 0.3f );
// create a rotation axis based on mouse movement
fCameraAngleX = dbWrapValue ( fCameraAngleX + dbMouseMoveY ( ) * 0.4f );
fCameraAngleY = dbWrapValue ( fCameraAngleY + dbMouseMoveX ( ) * 0.4f );
// rotate camera
dbXRotateCamera ( fCameraAngleX );
dbYRotateCamera ( fCameraAngleY );
// Show FPS
dbText ( 10, 10, dbStr ( dbScreenFPS ( ) ) );
// update the screen
dbSync ( );
}
// return back to windows
return;
}