Question

I wanna know how you render terrains in directx.
I have heard people saying that they are using RAW files and some said that they are using .x files. What is our way and why is it good?

Was it helpful?

Solution

Many 3D engines use height maps to render terrain, due to their space efficiency (only one raster image is required).

OTHER TIPS

Well MY way of doing it is to compress a HUGE texture (128Kx128K) with my wavelet compression system to get ~150:1 compression. I then chunk load the texture from disk. ie the world is split up into multiple 256x256 chunks (Actually its kind of mipmapped with distance from the camera). I use the camera position to forward load a number of chunks around the camera position.

I then calculate the chunks that are visible and draw them. For this purpose I use the height data directly as a stream fed into my vertex shader. I then have a mesh where vertex positions correspond to the height positions in the height stream. I can then simply pull the y out of the heightmap stream and place it in the y position in my shader.

Its a pretty complex way of rendering terrain but you did ask how "you" do it ;)

PS the bonus of 128,000x128,000 is that I get 128km of terrain at meter accuracy :D

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top