Over the past few days i have made a few improvements. I have focused a bit more on the performance side of things and implemented (fairly bad) CPU multi threading as it was running single threaded before. This resulted in a 2-3x performance increase even though I went from 1 to 8 threads. I believe this is due to my bad code and the fact I create 8 new Thread objects every frame.
Other than performance optimisations I also expanded the functionality of the renderer. I added Lambertian scattering for more accurate matte surfaces. I gave metal a fuzziness propitiate that allows for more surface options. I also started to implement glass (which is an absolute pain) but it is still broken at the moment (see screenshots) :) I also did some general housekeeping and cleaned up the code making it easier to read.
The code is now visible on github for anyone who is interested.
This is my shot at making a (somewhat optimised) Path Tracer in Java. I have previously made one in scratch and am trying to make a better foundation to work off of so I can add more advanced features. I had already started making the ray traversal code but forgot to log it; my current time is a little on the low side. I primarily work of the online books ‘Ray Tracing In One Weekend’ as they contain most of the info I need. At the moment only spheres are supported and only can be matte or a light. Even now I have been able to make some cool renders of random spheres. I will soon add more surfaces (mirror, glass, etc), anti aliasing, and multi thread support for better performance. If I can I will add support for polygons and thus 3d models. I hope this is as cool to you as it is to me. Thanks for reading. :)
This project is my way to get familiar with Godot as it is my first time using the engine. I spent most of my time (after getting familiar with the engine) working with the shader script and tile maps (I made animated grass bc why not). Me and a friend have plans to recreate a game that I made is scratch a while ago and I am using this project to experiment with different assets and concepts of the game. I put a fair bit of effort into the magic shader for cast spells. It takes in a 3d noise map to display the coloured magic fog and also distorts the anything behind it. You can’t see it in the pictures but the magic is animated as the noise shifts along the Z axis making it swirl. So far I am enjoying Godot and hope to implement this into the full game when we make it. :) Here is the original game: https://scratch.mit.edu/projects/1204494990/