-
Notifications
You must be signed in to change notification settings - Fork 16
Floorcasting
Floorcasting is the name of the technique to draw floors in the Raycasting projection by some texture. If you don't want to render a texture in the floor, the Floorcasting is not needed because you just need to draw color lines from the end of the wall to the end of the projection. So, lets check how to create the Floorcasting.
There are some techniques (vertical strip render, horizontal strip render, etc...) that can be used to render the Floorcasting, but for this tutorial I will use the easiest one that I found (vertical strip render). It is not the best technique since the processing used is not so optimized.
To make the Floorcasting, we will start to iterate from the next pixel after the wall to the last pixel of the projection. For each pixel, we will calculate the distance of this pixel, and get the coordinates using this distance to discover the tile in the map. With the tile we can find the texture that will be used for this pixel. These steps are:
For each pixel under the wall until the end of the projection:
- Calculate the distance of this pixel
- Calculate the coordinates by the distance
- Find the tile in the map by the coordinates
- Get the texture of this tile
- Find the color in this texture by the coordinates
- Draw the pixel
It will be made for each column in the rendering processor (For each x coordinate)
Copyright © 2018 Vinícius Reif Biavatti
- Home
- RayTrancing
- Examples
- Basic Tutorial
- Intermediary Tutorial
- Advanced Tutorial