Jump to content
  • Advertisement
Sign in to follow this  
Abu_Enis

raycasting engine -- how to do floor casting?

This topic is 3343 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

hello, i am working on an ai and decided that raycasting would be a nice way for visualising the environment. so i wrote a classic raycaster like wolfenstein 3d with help of this tutorial (http://www.gamedev.net/reference/articles/article872.asp) but when it comes to floor casting it's awfully slow. too slow. so no i've just been reading a tutorial on this forum (http://www.gamedev.net/reference/articles/article872.asp) about section based raycasting. but it seems the autor never wrote the second part where it comes to floor casting. and also section based casting like there doesn't fit in my project because the ai is able to change the envionment (building thinks digging and stuff like that) that's why classical block based raycasting like in wolfenstein 3d fits better. well, the point is, i just can't find a usefull tut or something about FAST floor casting like it's done in games like doom and duke nukem 3d. thanks

Share this post


Link to post
Share on other sites
Advertisement
Permadi has some information about floors and ceilings that may be useful. It may not give you all of the answers, but may give you a prod in the right direction.

Share this post


Link to post
Share on other sites
hey,
thanks but i'm allready doing it nearly like this.
its just the problem that when the walls are far away
on 800x600 pixels screen resolution the code nearly calculates
480.000 pixels for floor and ceiling.
which results in 40 frames per MINUTE.

Share this post


Link to post
Share on other sites
I guess you have performance problems because of the division by z each pixel.
An age-old tutorial is in the PCGPE. Check out the article on Free Direction Texture Mapping. Basically, you would render the floor by rasterizing horizontal scanlines, where the z stays the same for the whole scan line, so you can precompute the division by z.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!