Members - Reputation: 122
Posted 07 January 2000 - 06:06 PM
I''ve never played Zelda64, only seen a few screenshots, and I don''t think it''s that cool. For landscape rendering, I prefer using a heightmap and then apply quadtrees to smaller blocks of these heightmap. I used a quadtree size of 16x16 and got the best performance out of it.
/ / \ \
/ / \ \ / / \ \ / / \ \ / / \ \
So, you use a struct like this for the Quadtree :
typedef struct CQuadtree
CQuadtree *child1, *child2, *child3, *child4;
Then the first parent node has the edge coordinates
1) (0/0) & (16/16)
Then you get 4 childs out of this parent node which have the following coordinates :
1.1) (0/0) & (8,8)
1.2) (8/0) & (16,0)
1.3) (0/8) & (8/16)
1.4) (8/8) & (16/16)
You simply split the tree again and again until you have the smallest tile size of the landscape (which would be 1). Now you have these blocks and check the distance between the camera and the block and choose how detailed it should be. If it''s far away, then you render only the polygons in the first parent node, if it''s closer to the camera then you move some child nodes up and render those.
For the sky, I use a hemisphere and the render multiple cloud layers over it so that i looks somehow realistic. You can also render lens-flare layers over the hemisphere to get a sun and use a directional light where the sun is one the hemisphere.
You can also generate the cloud layers dynamically. This is often done using Perlin Noise (Fractal Plasma). Hugo Elias wrote a nice article on PN which you can find on http://freespace.virgin.net/hugo.elias/models/m_perlin.htm .
Did I forget something ? I hope not. If I did, post it here.
Graphix Coding @