Controls !!! wasd -> move around r -> rebuild boxes 1 -> switch to Regular ray marching mode 2 -> switch to Angular ray sharing mode 3 -> performance test (green = Angular ray sharing mode)
This is my own new solution to optimized ray marching. It switches up the game from pre-calculating distances to sharing distance calculations on the fly. It should have exact parity with regular ray marching only that it samples the SDF function much less than a normal approach. This technique should be easily portable into 3D ray marching as well. This technique works by saving the last SDF sample and when stepping any next ray first checking if that ray is in the bounds of that first SDF sample radius. If it is then we can safely assume that there is no blocking geometry in the way of the ray until it leaves the radius and so it can safely skip without checking the SDF.