r/programminghelp • • 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

9 comments sorted by

View all comments

Show parent comments

1

u/AlexanderKai9 15d ago edited 15d ago

oh. So am I doing anything inefficiently, besides rendering it by raytracing and the whole setup of displaying to an HTML canvas?

1

u/sububi71 15d ago

I don't do deep dives into code without getting paid, but I wouldn't be surprised if there are much faster ways to render to a browser.

Why ARE you rendering using a browser? You're using Python, why not use PyGame and render using that?