I think a big issue is that you only have one sample per pixel, which isn’t really isn’t all that great because you are only accounting for a very small number of actual light rays. I remember watching a video on someone making their own raytracer on Unity, and at exactly 17:55, the images shown look quite similar to what you see in your own raytracer.
So, for your case, you need to call the Tracer.Trace
function multiple times and average out the color returned.
I also think a majority of your pixels are dark because the light source is quite small, thus the majority of the relatively few rays you are casting miss it entirely, so making the light source bigger should make the scene more visible.
I think that you could also gain quite a bit of time save if you used one of those new EditableImage
s instead of hundreds of UI Frame
s.