Re:Show HN: 3D Raycasting Engine in JavaScript
by mrspeaker on Tuesday March 31, 2020 @03:29PM
(#22741483)
Wow, that looks cool. Portals are a great idea and seem like the would be (relatively) easy to implement in a raycaster!
The simplicity of them makes them fun to experiment with: I used one in a Ludum Dare game (https://www.mrspeaker.net/dev/ld27/) and made the field-of-view and movement speed a "mechanic".
Re:Show HN: 3D Raycasting Engine in JavaScript
by GonzaloQuero on Wednesday April 01, 2020 @06:20AM
(#22747261)
I just finished your game, and it was really, really good! I love trippy, timey-wimey experiences!
Re:Show HN: 3D Raycasting Engine in JavaScript
by mysterydip on Tuesday March 31, 2020 @06:28PM
(#22743418)
There are ways to fake an amount of up and down looking without too much work, rise of the triad used an approach. the larger the angle the more apparent the fakery, but it works well for "small freedom". I love raycasting engines and yours is a nice addition!
https://permadi.com/1996/05/ray-casting-tutorial-16/#LOOKING...
Re:Show HN: 3D Raycasting Engine in JavaScript
by sharkbot on Tuesday March 31, 2020 @10:49PM
(#22745114)
I appreciated your earlier comment that talked about how you used signed distance functions to make the virtual joystick slightly expand. I used that as inspiration for some terrain generation in a very basic game I’m making to learn the ECS design pattern. So far, it’s working really well!
Thanks again!
Re:Show HN: 3D Raycasting Engine in JavaScript
by ahuth on Tuesday March 31, 2020 @03:34PM
(#22741545)
This is awesome. Nice job!
Re:Show HN: 3D Raycasting Engine in JavaScript
by gh123man on Tuesday March 31, 2020 @05:40PM
(#22742929)
Thanks! It means a lot!
Since a few people have expressed interested, I decided to open source the early prototype code that has a simple implementation of portal casting. https://github.com/gh123man/Raycaster
I went deep down the rabbit hole with raycaster engines over the last 2 years. While this particular rendering technique has lots of limitations (like a fixed camera - unable to look up and down) it also has some interesting properties. Such as the ability to create windows, mirrors, and portals very easily by re-directing the way the rays fly.
I actually put together an entire game around this to test the limits of what I could achieve with raycasting. If anyone is curious you can see a video of it on my blog: https://blog.sb1.io/gateescape/
What I think would be a great project is moving the casting and drawing part over to a compute shader. My engine is multi threaded and chunks the screen so each thread can do some section of the work. Unfortunately I want the engine to be cross platform, but Apple has made that rather difficult with the requirement of Metal going forward. If anyone has seen this style of raycasting implemented on a GPU I would be very interested!