Sign in to follow this  
sakky

Show me you engine

Recommended Posts

This is probably a repeat, but oh well. But I want some inspiration! I’ve come to this ugly programmers block and I’ve been very frustrated. Show me you terrain engine please :) I want to see your work. Besides, it’s not until I see some one else do something cool is when I want to try it.

Share this post


Link to post
Share on other sites
Thanks for the compliments :)

I've been working on the underlying engine for about a year, while its theoretically platform indpendent (no platform specific dependencies all done through abstract base classes), I have only implemented a Direct3D 8 renderer, the beginnings of an OpenGL renderer, and a crappy unfinished software renderer for fun, that is a very interesting project I must say :). I have done multiple implementations of the other 3 main systems (audio has OpenAL and DirectSound, input has DirectInput, Windows API input, and SDL, networking has an SDL and a winsock2 implementation). The reason I made more than one of each was mainly for learning the libraries involved, and it doesn't take very long.

A little side note about the software renderer, that is the main reason I went with abstracting all the APIs. I wanted a testbed to play with software rendering, without having to create a new project, instead having a good looking scene ready for me to try and render. Once I had abstracted the rendering, might as well abstract everything else ;)

I did/redid the editor GUI several times while developing the main engine, once with plain win32 (that one quickly ran into a brick wall heh), tried again with ATL/WTL, got a little further but still didn't like it. Things were hacked together, little graphical glitches here and there, etc. Finally that version you see there is an MDI MFC app, took about a month to complete it, but it didn't require any graphics, math, etc. coding at all, it is just a shell to my engine. Every window has full docking support.

I also have another editor for my engine, since the level is yet another abstract class, and I have a quadtree and octree implementation. The one you see there is designed for the quadtree implementation, the octree version is the standard four view deal, however it doesn't look nearly as good as that one as its still done with ATL/WTL and I don't know how to do as much cool stuff like docking with WTL.

I could go on forever about the project in general (I can see that I already did ;)), if you have specific questions I'm happy to answer, I can also post more screenshots.

Share this post


Link to post
Share on other sites
When you put up a site feel free to PM me. Unless you have one now. Anyway yes I'd love to see more screens. Right now I have an engine. Like yourself I abstracted my rendering device. However, the only API I've added support for is DirectX. My engine has minor editor capabilities built in- so that when you're in windowed mode you can click on various options and edit props in realtime. Was trying to get some info before I start the editor. I really like the looks of your editor so I will probably use MFC also. I am going to tell you the truth- when i first saw your editor I thought it was a professional IDE with graphical capabilities. After a few moments I realized it was indeed a custom tool. Nice stuff.

Share this post


Link to post
Share on other sites
I had a few questions. On a terrain engine, would you to any tricks on the terrain texturing such as rotating the textures a bit or odd blends here and there? Just to give things a little better look.

What is the most common effective way to load & render a height map. Are the LOD algorithms worth it? Because I have heard so much trash about them because the pop up and down on the terrain, making thinks look horrible. Still images look nice, but what about moving around and animation?

I would like to build a terrain engine, but I can seem to figure out how to rend it properly. They always run super slow for me. I need speed, accuracy, and looks. Just like every one else does.

Share this post


Link to post
Share on other sites
http://aj.dustify.net/terrain.bmp

http://aj.dustify.net/terrain.JPG

(Note: The same image, jpg is a smaller file thus less quality.)

The occlusion culling doesn't work at the moment because i've broken it but it flies at higher fps when it does work.

These new ati drivers make it run slower too, need to revert back to older ones.

(Edit: Bitmap is online soon, JPG works now though)

Share this post


Link to post
Share on other sites
Quote:
Original post by sakky
I had a few questions. On a terrain engine, would you to any tricks on the terrain texturing such as rotating the textures a bit or odd blends here and there? Just to give things a little better look.

You can rotate, scale, and translate the textures in my editor but I have to say that the only one that I really use ever is scaling. rotation and translation don't really change how it looks.
Quote:
What is the most common effective way to load & render a height map. Are the LOD algorithms worth it? Because I have heard so much trash about them because the pop up and down on the terrain, making thinks look horrible. Still images look nice, but what about moving around and animation?

Depends on what you are doing. For an RTS or FPS, no. A flight sim, probably :). Here is what epic games (UT2003, UT2004) has to say about it (Warren Marshall's posts): here
Quote:
I would like to build a terrain engine, but I can seem to figure out how to rend it properly. They always run super slow for me. I need speed, accuracy, and looks. Just like every one else does.

Need more details here, other than that the general optimization stuff, like as many tris per DrawPrimitive call as possible, minimize texture/stage changes, etc.

edit: Two more screenshots:


edit2: vajuras, check out this docking control bar class for MFC, it is really great, that is what I used (the CF version). Before I found that I was messing around with splitters and CFormView and all that other garbage, it is much easier and better to work with that control bar class.

Share this post


Link to post
Share on other sites
Self developed, it is heavily integrated with my class/variable registration system that I use for a ton of stuff including that object editor. I found a pretty good one that does the same thing if you are looking though: here.

Share this post


Link to post
Share on other sites
This is the only screen I have - been working on other stuff recently (ie, 2D) [wink] Nice job, Kibble!




Mushu - trying to help those he doesn't know, with things he doesn't know.
Why won't he just go away? An question the universe may never have an answer to...

Share this post


Link to post
Share on other sites
Quote:
Original post by PsyVision
Mushu, how did you do the grass?

3 line lists stored in 9 vertex buffers of 10000 lines each.

The buffers are laid out like this:

0 1 2
3 4 5
6 7 8

so that I can cull them so that only 60,000 "blades" are rendered at once. The texture coordinates of the grass is randomized, so that they will all look a little different. Their height is also randomized.

Blade positions are actually over an evenly spaced grid to avoid "clumping", but each of the values are slightly offset to get rid of the "grid" appearance.

I spent a whole lot of time tweaking the materal of the grass so that it would give the lighting effect that it does, and I'm especially pleased with that.

I intended to add wind effects, but was running out of CPU power (24 fps on a 800mHz)

The other thing I meant to add but never got around to was using some kind of volumetric texturing for the grass instead of line primitives, but never got around to it. In all actuality, that probably would have sped things up a little, and allowed me to put in wind effects.


Mushu - trying to help those he doesn't know, with things he doesn't know.
Why won't he just go away? An question the universe may never have an answer to...

Share this post


Link to post
Share on other sites
Here are mine... in progression...
http://www.spritekin.com/warscale/screen0.jpg
http://www.spritekin.com/warscale/screen1.jpg
http://www.spritekin.com/warscale/screen2.jpg
http://www.spritekin.com/warscale/screen3.jpg
http://www.spritekin.com/warscale/screen4.jpg
http://www.spritekin.com/warscale/screen5.jpg
http://www.spritekin.com/warscale/screen6.jpg
http://www.spritekin.com/warscale/screen7.jpg

Luck!
Guimo

Share this post


Link to post
Share on other sites
Some choices I’ve came up with for names for a Terrain engine. Or any 3D engine for that matter.

Names:
Ivan
Gavin
Juniper
Dragon-FX
Super Fly
Dog Bone
Can-O-3Ds
Lysol
Showtime
Sharpie
Siege
Artichoke
June-Bug

There silly, I know. But lately, my 3Ds have been turning into 3-Don’ts!

Share this post


Link to post
Share on other sites
Quote:
Original post by Guimo
Here are mine... in progression...
http://www.spritekin.com/warscale/screen0.jpg
http://www.spritekin.com/warscale/screen1.jpg
http://www.spritekin.com/warscale/screen2.jpg
http://www.spritekin.com/warscale/screen3.jpg
http://www.spritekin.com/warscale/screen4.jpg
http://www.spritekin.com/warscale/screen5.jpg
http://www.spritekin.com/warscale/screen6.jpg
http://www.spritekin.com/warscale/screen7.jpg

Luck!
Guimo


Is it too hard to use the < A HREF="" > < /A > tags?

Screen 1
Screen 2
Screen 3
Screen 4
Screen 5
Screen 6
Screen 7
Screen 8

Looks nice.

Share this post


Link to post
Share on other sites
Quote:
Original post by jmutch
Is it too hard to use the < A HREF="" > < /A > tags?

[lol]... you know you can use &lt; and &gt; so that you can simply write <A HREF=""> </A>? [razz]


Mushu - trying to help those he doesn't know, with things he doesn't know.
Why won't he just go away? An question the universe may never have an answer to...

Share this post


Link to post
Share on other sites
I really don’t know that much about LOD algorithms, but I have questions to ask that tutorials and FAQs don’t cover.

Do I honestly need a tree data structure for the LOD algorithm? What if I just use an algorithm that splits a triangle into two separate ones?

Couldn’t I just use a linked list for a display list for each triangle I perform the algorithm on? Couldn’t I just do this: Each time a triangle is split I add those triangles to the display list and remove the one that was split?

I believe that the use of view distance will help out, won’t it? I can remove lots of polygons from the view if they are out of range, correct? I would have to use fog or something to cover up the nasty edges left behind though.

I want the terrain to look at smooth as possible close up. I also want many, many triangles to perform effects on. Such as reflection, water, snow, dirt, etc...

If the camera is looking at the ground where the water meats the earth, I want the edges to be smooth and blended nicely. I also want a decent amount of detail that will require the use of additional polygons.

How do I avoid popping, or can’t I?

Share this post


Link to post
Share on other sites
Okay Kibble, help me please! What is a good way to create terrain with a height map? I have the image stored in a RAW and I load it with one file read command fread( pMapData, 1, Width * Height, Fp ) like that.

Do I store the terrain in a large vertex buffer or what? I’ve just looped through the terrain before and rendered four vertices at a time with DrawPrimitiveUP. But this is very, very slow and I need a better way to do this.

Can I see your source code?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this