Monday, 20 November 2006
Labels: ray tracer
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.
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!
Subscribe to Post Comments [Atom]
Links to this post:
Subscribe to Posts [Atom]