Raymarching using signed distance fields, currently supporting circles & axis-aligned rectangles. Drag the circle around to see it in action. (I think there was a save issue that saved the wrong version so it looks a little messed up rn for some reason Im too lazy to fix)
Q: huh? A: Raymarching is a technique where a "ray" moves out from a pount until it collides with something. By using math, you can find the distance of a position to the nearest shape, allowing you to know the largest safe distance to move. Q: Why? A: This method has theoretical speed benefits over traditional raymarching techniques commonly seen in scratch, as well as not theoretically being limited by distance. It also has better accuracy, as it does not run into certain issues ordinary raymarching has. However, I suspect it may struggle with more objects and may need further optimization in the future. Q: can this be used for 3d games? A: Theoretically, yes. I plan to implement that at some point.