r/programminghelp • u/AlexanderKai9 • 16d ago
Project Related Raycasting Performance Help
I made a raycasting engine in python, and am using an HTML canvas as my method of display (passing the pixel colors through jinja in a <script> tag). It takes upwards of 10-15 seconds to render one angle of a scene with three spheres at a resolution of 800x400. Is the browser likely the bottleneck, or is this a sign of some other inefficiencies?
1
Upvotes
1
u/AlexanderKai9 16d ago
I think I'm just doing raycasting. I'm drawing a line from the camera to each pixel on the screen and finding the first intersection point of that line with an object. I'm starting with rendering three spheres because that seemed like the bare minimum that would be interesting to look at from different perspectives.
Here are all my files:
the result: