Sign in to follow this  
kapru

Terrain Engine

Recommended Posts

Here is my latest terrain project.(sorry no idea how to link a picture) press 'o' to change the light source direction. Hold the right mouse button to look around wasd to move http://members.iinet.net.au/~fitz9/engine.zip What do ya think of it so far. And the main 2 questions what is the best way to join up the terrain patches that have different detail levels? Currently ive set it to not render the border tiles. And in my shader how do i set it to render wireframe

Share this post


Link to post
Share on other sites
Quote:
Original post by kapru
Here is my latest terrain project.(sorry no idea how to link a picture)
just like you'd do on a HTML page: upload the picture somewhere, then write an >img src="URL"< in the text (with > and < reversed).

Quote:
What do ya think of it so far.
On my machine, parts of the terrain are black. Also, the gaps are very noticable at the borders. It runs at around 3-5 FPS on my GF7800GTX, so it'll definitely need some optimizations in the future. But at the places it works good, it looks good! [smile]
Oh, and next time, please choose a starting camera position that is not under the terrain but instead one that provides a good look at the scenery :)

Quote:

what is the best way to join up the terrain patches that have different detail levels? Currently ive set it to not render the border tiles.
The article called "Terrain Geomorphing in the Vertex Shader" by Daniel Wagner in ShaderX2 - Tips and Tricks is a must read for you. It gives a solution right to this problem.

Quote:
And in my shader how do i set it to render wireframe
You don't set it in the shader, you have to set the D3DRS_FILLMODE renderstate to D3DFILL_WIREFRAME.

kp

Share this post


Link to post
Share on other sites
I get an error on both my ATI X700 and X300 (Failed to lock Patch Vertex Buffer).

You can set the fill mode in you effects file using

FillMode = WIREFRAME;

I believe (or FILL_WIREFRAME, I'm not sure).

Edit: A quick search of google shows a result that uses the first one, so I'd say thats the right way.

HTH!

Share this post


Link to post
Share on other sites
I get ~60fps regardless of where I am, but the terrain is completely chopped up, and many of the patches I can see are black. Changing the light direction appears to work fine for the terrain patches that render correctly. As mentioned, the starting camera position needs to be set! The detail is very nice though!

Edit: I tried to take a screenshot, however your program seems to be intercepting the printscreen key event...

Anyway, I noticed from this it doesn't recover from a lost device correctly. No errors though, it just doesn't continue rendering the terrain.

Radeon 9600XT.

Share this post


Link to post
Share on other sites
Im hopefully going to get to fixing the cracks soon. Just need to find a good way of doing it. I read the document about doing it in the shader but that just went right over my head so i think ill probably end up creating a look up table of something like that.

Also you'll notice the patch change LOD i think its abit too noticable so im gonna have to also change the LOD from just skipping points to determining ones it can take out with not much change to the gereral shape

Share this post


Link to post
Share on other sites
[quote]Original post by kapru
New version with occulsion culling.
quote]

Just curious, how are you doing it? I would love to do it in mine, but it has been on the back burner. Are you using pvs?
(sorry can't demo it, Im at work and it says failed to create device)

Share this post


Link to post
Share on other sites
first im using frustum culling to get rid of the patches that have no hopeof being rendered.(this will soon be optimised with a quadtree). I then create a render list of all patches that are in the viewport. i then sort these by distance.

i then render each patch to an offscreen buffer and record how may pixels were drawn. i then remove the patches that didnt draw anything from the render list.

Then i render my final copy

Share this post


Link to post
Share on other sites
Quote:
Original post by kapru
first im using frustum culling to get rid of the patches that have no hopeof being rendered.(this will soon be optimised with a quadtree). I then create a render list of all patches that are in the viewport. i then sort these by distance.

i then render each patch to an offscreen buffer and record how may pixels were drawn. i then remove the patches that didnt draw anything from the render list.

Then i render my final copy


I guess this is what I dont get, your rendering twice instead of once, or is the offscreen buffer fast? Do you happen to have a link/code or article on this? I would be much obliged.

[Edited by - Valor Knight on March 18, 2006 1:50:41 AM]

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