I found two weeks ago a good GLSL realtime ray tracing example on this site http://kioku.sys-k.net/4kgfxmon/howto/howto04.htm.
I modified it slightly to get it working in the BGE.
The raytracer calculate phong shading, shadows and reflection in realtime.
The shader overwrite the viewport and don’t visualize Blender objects. Everyting object is gernated in the GPU.
This looks really good. It would be amazing to implement it into blender. Just press a button…realtime reflections…yay. It seems to run really fast as well. There must be some limitations though.
This is neat. Works on my MPB in windows, I haven’t tried OSX yet.
Quacky: It is just a glsl fragment shader applied as a 2D filter, so no mesh or material data. Still pretty cool, though.
Nvoid82: run blender from terminal (/Applications/blender.app/Contents/MacOS/blender), then preview the game and look at the terminal. Should be some information as to why it won’t compile. Probably just type cast issues. I could debug it in OSX later, if I remember.
@ Nvoid82. I am sorry about that. I know there are some problems on OSX. But I don’t have an Mac and so can’t test it.
@ martin.hedin. No not really with this shader. The objects are generated with mathematical equation. I is possible to write a code that automatically generate a shader from objects that are based on boolean operations (Blender boolean modifier).
Something like this on the screenshots is possible with boolean operations.
(1920x1080 photon tracing ~10 fps. The program is not from me)
But it is also possible to raytrace triangle geometry. I have a CUDA Ray Tracer that can raytrace triangle geometry (obj files) in realtime. But it is a little bit too slow for the moment (~16 fps) and I think my CUDA knowledge in is not good enough to speed up much more.
ERROR: 0:217: Incompatible types (int and float) in assignment (and no available implicit conversion)
ERROR: 0:224: Incompatible types (int and float) in assignment (and no available implicit conversion)
ERROR: 0:264: Incompatible types in initialization (and no available implicit conversion)
ERROR: 0:267: Use of undeclared identifier ‘seed’
ERROR: 0:267: Use of undeclared identifier ‘seed’
ERROR: 0:268: Use of undeclared identifier ‘seed’
Very neat! This runs perfectly smoothly (about 700-900 fps with vsync off, depending on what is on screen at the moment) on my GeForce 560 (hardly a top-of-the-line card these days). There is a slight flickery edge around the faces of the yellow cube, but it’s not very noticeable and there aren’t any other artifacts that I could see.
Yes I know, there are many realtime raytracer sources out there. As I referenced in my first post, I only modified it slightly to get it working in the BGE. Look at the first post, there you can find a link from where I got the code.
Im Using An Acer ASPIRE 5738Z With Intel Pentium 2GB RAM 22 GHz…
And It Runs In 11 FPS Wow this script is amazing,it stil run fast even without graphic card