Putting the fun in functional programming since 2005!
You can still speed up your raytracer.In your render(form) function, replace form.Invalidate() with form.Invalidate(new Rectangle(0, y, form.Width, form.Height))In your form.OnPaint method, instead of drawing the entire bitmap each time, you only have to draw e.ClipRectange.
Hi!Thanks for the feedback. I've incorporated the changes you suggest as well as some optimisations (lazy evaluation of the surface, not shooting shadow rays from the dark side of an object and some other things).I've also added a simple GUI, with bitmap saving and the ability to disable reflections and shadows.The save dialog is still quirky but I'll upload the new version ASAP. It is still <250LOC!Cheers,Jon.
Post a Comment