Not logged in, Join Here! or Log In Below:  
News Articles Search    

Submitted by David Galeano, posted on April 12, 2001

Image Description, by David Galeano

The terrain size is 16 kilometers by 16 kilometers and the far plane is located 5 kilometers away of the camera. This map has more than 100,000 plants.

The terrain is a simple quadtree rendered using static LOD. The plants close to the camera are pre-lighted models with 2 LOD, when they are far away they are draw as impostors depending of the angle with the camera.

The water is simulated using 2 quads with the texture tiling and moving in opposite directions. The water reflection is rendered to a texture than later is blended with the water applying a vertical blur.

The Sky is formed by a semi-sphere with a gradient of color from white to blue than is blended with a clouds texture that fades to the fog color in the distance.

For more screenshots: (Mirror)

Also, there is a demo available for downloading where you can see more effects that those I have described: (Mirror)

Image of the Day Gallery


Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
David Galeano

April 13, 2001, 01:48 PM

I have found that in some situations I have problems with the water visibility, perhaps it has something to do with the occlusion culling system, I’ll try to fix it. Thanks.

I think that DirectInput has some problems under W2K, anyway I need change the camera system for a more stable one.

David Galeano

April 13, 2001, 01:52 PM

No, it works perfectly in non-T&L cards like the G400 or the TNT.

Some months ago I tried the demo with a Voodoo but it give me many problems; the Voodoo cards don’t support rendering to a texture and many other things that I don’t remember now.

David Galeano

April 13, 2001, 01:53 PM

I’m using D3DX for loading the textures and it’s supposed they resize the texture to a size that the card can support…

David Galeano

April 13, 2001, 02:01 PM

For the terrain I have a texture of 2048x2048, while the resolution of the terrain is 512x512. Also I’m using multitexturing with a noise texture for the ground patches near the camera, plus a detail patch applied over the terrain surrounding the camera. You can find this textures in the directory “TEXTURES”: “noise.bmp” and “”.

David Galeano

April 13, 2001, 02:09 PM

The resolution of the map is 256x256.

This is the code for calculating the view matrix of the reflected viewpoint:

D3DXMATRIX matView, matReflect, matPosition;
D3DXPLANE plane;

// Create the water plane
D3DXPlaneFromPointNormal(&plane, &D3DXVECTOR3(0, nWaterLevel, 0), &D3DXVECTOR3(0, 1, 0));

// Create a reflection matrix from the plane
D3DXMatrixReflect(&matReflect, &plane);

// Apply the reflection matrix to the current camera position
D3DXMatrixMultiply(&matView, &matReflect, &g_matView);

g_pD3DDevice->SetTransform(D3DTS_VIEW, &matView);

David Galeano

April 13, 2001, 02:13 PM

I think that the full name is “OCR A Extended”. Every font of the OCR family looks very nice.

This font is used in the title of many Sci-Fi books :)

David Galeano

April 13, 2001, 02:20 PM

My machine has a Pentium III 667 128 Mb ram with a GeForce 2 GTS.

Your machine is good enough to run much faster than now. Please, check your drivers or your display settings; anyway I have never tried it in a MX…
You can E-mail me directly if you keep on having problems…

David Galeano

April 13, 2001, 02:23 PM

This demo has problems with the Radeon, but I don’t have any card to test it…

If anyone could send me the caps of this card I would try to fix this problems…

David Galeano

April 13, 2001, 02:31 PM

This is the code for capturing the screen to a file:



if(SUCCEEDED(hr = g_pD3DDevice->GetRenderTarget(&pBackBuffer)))
LPTEXTURE pBackBufferCopy;

// create aux texture
if(!(g_D3DDeviceDesc.TextureCaps&D3DPTEXTURECAPS_SQUAREONLY) )
hr=CreateEmptyTexture(g_nWidth, g_nHeight, SYSMEM, &pBackBufferCopy);
hr=CreateEmptyTexture(g_nWidth, g_nWidth, SYSMEM, &pBackBufferCopy);
hr=CreateEmptyTexture(1024, 1024, SYSMEM, &pBackBufferCopy);

// copy the back buffer
LPDIRECT3DSURFACE8 pBackBufferCopySurface;
pBackBufferCopy->GetSurfaceLevel(0, &pBackBufferCopySurface);

g_pD3DDevice->CopyRects(pBackBuffer, NULL, 0, pBackBufferCopySurface, NULL);

// return backbuffer

// save the copy to the file


// save to a file



return hr;

David Galeano

April 13, 2001, 02:45 PM

The map is just a grayscale image and the terrain is a big texture, of course both of them can be generated at runtime, but it’s my opinion that you can never beat the creativity of a good artist mixing fractal terrains with hand-made art.

The code isn’t ready to be released, but you can e-mail me directly if you like to make a demo working together…

David Galeano

April 13, 2001, 03:10 PM

Switching to 16bit of color depth give me some problems that I couldn’t fix, I think it’s due to a bad release of the textures in video memory, but I’m unable to find the bug…

The non-overlapping shadows are done using the stencil buffer in two rendering passes, but in some cards you can’t have stencil if using 16 bit of color depth. I have more control over the rendering process using the stencil buffer that using a destination alpha, but I’ll give it a change someday...

Yes, the mouse sucks…I’ll try to change how the camera works.

The resolution of the reflections map is fixed to 256x256. I’ll have in mind the option of resizing it depending on the resolution on the screen.

Yes, the trees only have a big axis aligned bounding box. If I have free time to code it, I would like to calculate at load time, two or tree bounding boxes that fits closely each engine object.

The radar only shows the objects inside the frustum, it was only a debugging tool…

The soldiers are Quake 3 models, and as you have noticed they are disabled in the original configuration. They don’t have any intelligence and aren’t part of the collision detection process. It was only a try to put something animated in the demo.


David Galeano

April 13, 2001, 03:18 PM


I was thinking in a mix between Diablo II and Giants :)


April 13, 2001, 04:38 PM

I have a Celeron 633 MHZ with a Creative Geforce2 MX. Just as BigB I have low memory (64 MB). Can it be a memory problem?


April 14, 2001, 07:06 AM

Please don't talk about Giants, I'm laughing my ass of every time I think about it =) That is one of the best games I've ever played, insane colouring and storyline, if you manage to do something like that, you have my promise I'll buy that game as soon as I can.

You got a storyline outline ready for your game? I'm working on a couple of ideas myself, when I'm not busy with school and work.


April 14, 2001, 07:18 AM

How can we have such quality programmers in Spain, and only have seven or so quality game development teams?.

Nice work, downloading just now. I'm really impressed by the graphical look.

Perhaps there is more things to say about this but I'm just back from a three days Quake match, and I'm tired. Someday I would code something similar. Someday.


David Galeano

April 14, 2001, 08:11 AM

The demo doesn’t take too much system memory. The problem could be the video memory but my GeForce only has 32 MB, the same of yours, so I think that the problems are due to the drivers or the capabilities they exposed, but without debugging under your cards I can’t assure anything…

David Galeano

April 14, 2001, 08:20 AM

No, I don’t have any storyline for a game, just some ideas. I’d like to receive some help from a good artist to finish the look of the demo, and later, begin to think about the ‘game’. As you have said, it’s difficult to do something ‘serious’ when you don’t have time to.

David Galeano

April 14, 2001, 08:32 AM

"seven or so quality game development teams?"

In Spain is difficult to find money and support to make good games that can be published out of this country. I only know two or three teams that can do it, and many developers are going to work in USA or UK for not having found a change here. Perhaps someday everything will be different thanks to the success of studios like Pyro...

Hasta otra.


April 14, 2001, 01:40 PM

Let me think a moment ...
Dinamic, Pyro, Enigma, RebelAct, Bit Managers, Pendulo Studios, Gaelco ... and no more.
SEVEN!! WOW!!. I can reach seven!!.

Of course I only know that Pyro and RebelAct has published their games out of Spain. Bit managers works closely with Infogrames and their games was published out of Spain too (like Asterix for SNES, TUROK for GameBoy and a Gaelco Arcade Machine conversion but I don't remeber the name).
Dinamic has an experience with country focused versions of PCFutbol, and long time ago with Risky Woods, the first spanish game for a console, published by Electronic Arts.

The game development scene in Spain is truly bad. There are too much people, this include me, that desires a change. A change of mentallity from those who can produce the games. It's true that is not easy to find money. Pyro and RebelAct have producers from out of Spain like EIDOS. No one in this country seems to be prepared to spend money to produce a game.

Impressive Graphicians + Excellent Programmers + Incredible Musicians + NO MONEY = NO GAME DEVELOPMENT.

Nothing more to say cos I'm getting angry by this class of NO FUTURE like PROGRAMMER in you country.

OK. I've seen your demo now. Really impressive, really fast. But sometimes water triangles dissapears no matter if occlusion culling is on or off. And when I change the resolution the text fonts turn to black/white squares. Things characteristic in a demo. Nice work. Please continue that way.


David Galeano

April 14, 2001, 01:40 PM

Thanks to everyone for your comments.
And for those interested, I’ve just uploaded a new version of the demo; I’ve fixed some problems with the water.



April 14, 2001, 01:47 PM

I run the demo on my PII440/256 RAM/GF2MX 32MB and I reach 100-140 frames in 640x480 resolution. You may do something wrong then :)


David Galeano

April 16, 2001, 01:13 PM

Please, forgot my last mail.

I’ve uploaded some code to save surfaces to a targa file, plus one example of saving the backbuffer.


April 27, 2001, 03:20 AM

How about some explanations on the questions asked about the implementation amigo....
Then again maybe its top secret.... :)

This thread contains 53 messages.
First Previous ( To view more messages, select a page: 0 1 ... out of 1) Next Last
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.