Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Voxel terrain rendering

This topic is 5486 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I read both flipcode.com articles about this and I feel still way too unclear about that topic. I only understood that I''ve to somehow cast an ray in 2D from my eye position into the terrain and check for the highest pixel of my heightmap hit by my ray. I''d need an very simple explanation/tutorial about this, maybe you could help me out a little bit?

Share this post

Link to post
Share on other sites

Go to the Tutorials section, take a look at his Voxel engine source, available in VB and C.

Share this post

Link to post
Share on other sites
Can I proposed a simple algorithm ?

The perspective projection formula are:

Xs = (focale*X)/Z;
Ys = (focale*Y)/Z;
(Xs;Ys) is a screen point
(X;Y;Z) is the ascociated space point
focale is a constant (180 for exemple)

Do a loop on the Z between a little value to a big one (not necessarily linear progression)
Do a loop on the Xs. With that (Z and XS) you can find X.

Now you have the height map coordinate: heightmap(X;Z).
This map give you the Y and you can find Ys. Trace a vertical line between Ys and MaxYs: that give a good effect. You can now easily do a depth buffer that allow you to clip the hiden zones.
This buffer have only MaxXs length. I let you to find how you can do that


[edited by - Chuck3d on November 14, 2003 3:35:38 PM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!