Surely the idea isn’t new and has been discussed before. I learned about raytrace lighting after looking up how Cycles works, and it wasn’t long before I asked myself “what if path tracing could be used in games too, not only rendering”. BGE is already considered a poor engine by many (untrue IMO), and this would be a great opportunity to make it stand out as one of the first complete game engines with raytrace lighting. Blender already has Cycles, so the GE could use a few of its components.
Now I’m experienced enough with both Blender and game development (outside of Blender) to know this is not as easy as it might sound. Sure, one could make Cycles render the viewport while BGE is running, but what about performance? Anyone expects a good engine to not drop below 60 FPS, but render engines are designed to cope with seconds / minutes / hours per frame! Using the Rendered viewport and moving the camera around gives a good idea of how Cycles would act in realtime… and no doubt it takes at least a second before anything becomes clear through all that grain.
However, raytracing in realtime is not an impossible dream either. I looked it up and found a surprising number of attempts, using OpenCL or even just GLSL. Some of them actually look pretty mind blowing! They also seem to run at excellent performance, and some have little to no grain due to ray approximation (Cycles does). Here are the best examples I found on Youtube:
To get this working in BGE, there’s no doubt GPU rendering needs to be ready and working. Also that a much simpler version of what Cycles does needs to be created. If there’s any hope to get 60 FPS in a scene of normal complexity, we likely can’t have more than a few ray bounces, limited glossy / reflection / refraction shaders, and other optimizations would likely be needed too. Still, it’s been proved possible… and maybe it’s possible for BGE too.
What do you think about the idea? How possible do you think it is to add raytrace lighting in BGE? Has anyone tried it yet, does anybody plan to? Any ideas on what systems and technologies could be used?