hahah, watching this video by you made me want to try and create one in the first place!marclurr wrote: ↑Thu Mar 30, 2023 6:10 am I've actually gone down this exact rabbit hole fairly recently, I'd started with a fully software rendered version and while I'd managed to optimise it to a reasonable level I wanted to try and make it even faster. The shader version can render at 4k resolution with virtually no performance impact. This topic documents how I did it, the github is on there too if you want some inspiration. There's probably ways to improve it even more viewtopic.php?f=5&t=93880
Implementation/port of Lode Vandevenne´s Raycaster behaving weirdly
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- NoreoAlles
- Party member
- Posts: 130
- Joined: Mon Jan 03, 2022 5:42 pm
Re: Implementation/port of Lode Vandevenne´s Raycaster behaving weirdly
"Why do they call it oven when you of in the cold food of out hot eat the food?" - Jon Arbuckle
Re: Implementation/port of Lode Vandevenne´s Raycaster behaving weirdly
Ah yes I remember your post, bravo and thank you for your repost, it will be really usefulmarclurr wrote: ↑Thu Mar 30, 2023 6:10 am I've actually gone down this exact rabbit hole fairly recently, I'd started with a fully software rendered version and while I'd managed to optimise it to a reasonable level I wanted to try and make it even faster. The shader version can render at 4k resolution with virtually no performance impact. This topic documents how I did it, the github is on there too if you want some inspiration. There's probably ways to improve it even more viewtopic.php?f=5&t=93880
If anybody is interested in the fully software version I can probably dig it out, but it's likely not much different from the many raycasters already posted on the forum.
Re: Implementation/port of Lode Vandevenne´s Raycaster behaving weirdly
The shader is done and the software rendering has been improved a bit! For the shader I was a little inspired by how Marclurr had done. It's still a bit messy, there are a lot of points to improve and also things to add, I might do a separate topic if I really go further than that.
If you want to be inspired or even copied it's free
I didn't add the ceiling although that's easy to do now that the floor is done, but for the simple reason that I thought it was cool to be able to deifne several diferent floors with negative values in the map array, then I what do i do for the ceiling? So I preferred to do nothing for now, but some slight shader changes will suffice.
You have the straff with Q/E or A/E and you can also switch maps with M. The window is also resizable live. You just have to set the second parameter of the raycaster:init method in main.lua to false to try without hardware acceleration. You can remove and put the textures you want, it simply won't display them if they aren't there.
If you want to be inspired or even copied it's free
I didn't add the ceiling although that's easy to do now that the floor is done, but for the simple reason that I thought it was cool to be able to deifne several diferent floors with negative values in the map array, then I what do i do for the ceiling? So I preferred to do nothing for now, but some slight shader changes will suffice.
You have the straff with Q/E or A/E and you can also switch maps with M. The window is also resizable live. You just have to set the second parameter of the raycaster:init method in main.lua to false to try without hardware acceleration. You can remove and put the textures you want, it simply won't display them if they aren't there.
- Attachments
-
- Raycasting.love
- (35.04 KiB) Downloaded 72 times
Re: Implementation/port of Lode Vandevenne´s Raycaster behaving weirdly
Well done, looking very cool! And glad I was able to point you in the right direction I'm quite jealous of your single draw call implementation, I originally thought of doing the mine the same however I decided against it as I didn't want so many branching statements in a shader, but it looks to have zero impact on performance and is much neater. Running side-by-side on my laptop both yours and mine have more or less the exact same render time of <1ms.
You've actually reignited my interest in the topic, I'm planning to implement batching for the sprite rendering as they currently require one draw call per sprite.
You've actually reignited my interest in the topic, I'm planning to implement batching for the sprite rendering as they currently require one draw call per sprite.
Re: Implementation/port of Lode Vandevenne´s Raycaster behaving weirdly
Glad to hear it, it was one of the things that I told myself that it was absolutely necessary to change (the number of conditions in the shader) but if it works as well so much the better!
I still optimized it and added the ceiling as well as the management of several floor/ceiling textures, I can't stop
I made a small repo on GitHub if you are interested: https://github.com/Bigfoot71/love2d-raycasting
I still optimized it and added the ceiling as well as the management of several floor/ceiling textures, I can't stop
I made a small repo on GitHub if you are interested: https://github.com/Bigfoot71/love2d-raycasting
Who is online
Users browsing this forum: No registered users and 6 guests