## Real-time landscape rendering

### Real-time landscape rendering

Hi,

I'd like to optimize my realtime landscape renderer, every time i speed
up the algorithm it looks like shit.

Here's the basic algorithm:

set the camera matrix
for each ray do
* find the coordinates of the ray in voxel space
* with a 3d line algoritm, interpolate along the ray,                   starting at
the origin of the ray
- get the height of the voxel from the                                  height-map (project the
pixel onto the plane                    y=0 to get the coordinates in bitmap )
- if the ray intersects, then set the pixel to                          the corresponding
color, and exit the loop.
end interpolation loop
end for each ray loop

My problem is the 3d line part. I need a quick algorithm which enables
you to start at any point (x1,y1,z1) and interpolate to (x2,y2,z2)...
In all the algorithms I know, you must swap some values, to start with
the smallest.

My algo currently uses 16.16 fixed point, and splits each case into 4
groups:
Dx>0 , Dz>0
Dx>0 , Dz<0
Dx<0 , Dz>0
Dx<0 , Dz<0

and then calculates the step, and just interpolates ( very naive isn't
it). Anyway, this looks crap, since due to lack of precision, you can
distinctly distinguish the different zones in the voxel...

If you got any ideas, please let me know...

Alex

### Real-time landscape rendering

>I'd like to optimize my realtime landscape renderer, every time i speed
>up the algorithm it looks like shit.

Have you ever seen the "Graphics Gems" series of books?  They are full of
things like this.  I don't know if this particular problem is covered, or in
which volume, but reading some of the algorithms can be inspirational, in
general.

Does anybody know where I might be able to get some information on some
landscape renderers that operate in realtime. Please bear in mind it will
have to significantly high resolution and will run most likely on an SGI
Onyx or SparcStation 20. It will also have to be able to intcorperate
IGES files and DXF models. Please repond by mail.

--
+--------------------------------------------------+
| Q: What do you say to the man who has everyhing? |
| A: Hi, friend!                                   |
+--------------------------------------------------+