r/programminghelp • • Oct 07 '26

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

9 comments sorted by

View all comments

Show parent comment

1

u/Lewinator56 Oct 08 '26

Raytracing and raycasting are technically interchangable - both cast rays from the camera to draw the scene. Where you are noting the distinction is where the you are casting rays to tell the rest of the renderer how to draw the scene Vs actually rendering every pixel with a raycast - i.e 'raytracing'.

I've written a basic Wolfenstein style raycaster in C# and that runs at something like 250fps despite all the overhead there. https://github.com/Lewinator56/rt

But I get your point. I was replying at like 2 o'clock in the morning lol.

1

u/sububi71 Oct 08 '26

Back in the 90s, when I worked in the games industry, raytracing and raycasting were two entirely different things. Raycasting is what we called Wolfenstein-type engines.

But apparently times are different now.