Using Compute Shaders in Unity to Create a Basic Raycaster

Hello Internet,

Over the weekend I managed to create a raycasting engine in unity using the new tilemap feature and compute shaders. At the start of my application I convert the tile map into a compute buffer and send it off to a shader that renders the scene into a texture using raycasting. All the collision is handled using a tilemap collider, meaning this could be used to create levels for a Wolfenstein3D type game very quickly. I’m very happy with the results and plan to add support for sprites and doors soon. I’m new to blogging, so I’ll do my best to keep this up to date with my progress.

For now enjoy a video of the raycaster in it’s current state.

Once I’m finished I’ll try to write an in-depth tutorial on how all this was achieved.

See you then!
Alex Gilbert

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *