Over the last few days, i began working on the basis of the chunk rendering, the way that i make the chunks render is by looping through each block in the chunk and checking the blocks at the side of the current block. I have each block store their texture , id value and render type. When looping, i check whether the block at the current side has a transparent render type, if it is transparent, it will render the face. This system is quite efficient because the chunks are pretty small and therefore allows them to loop fast. One challenge i came across was for blocks at the edge of a chunk, because they are on the end, i need to search for the adjacent chunk so that i can check its render type.
I also implemented a system for updating the render system when a block is changed, so if a block on the edge of a chunk is destroyed, it will have to send a message to the adjacent chunk and tell it to re render its faces because otherwise there will be a hole where the chunk " thinks " there is still a block.
Here is a preview of my rendering
On a side note, i am not breaching Copyright of the textures , i am not going to be using the textures in the final version, i am just using them as placeholder textures until i can get some nice looking textures of my own.
Thanks for reading and keep checking the blog for more progress!
No comments:
Post a Comment