madox
New Member
Posts: 22
|
Post by madox on May 31, 2020 1:37:06 GMT
A while a ago I posted about my attempt to implement the ray trace challenge in a webgl shader. I recently picked it up again and added a physics engine just to try to punish my computer some more. It has a few flaws still but the first test is pretty promising! You can also try it yourself at madox.ca/WebGL/RayGL (click on "Physics Scene")
|
|
fremag
Junior Member

Posts: 73
|
Post by fremag on May 31, 2020 8:15:31 GMT
Amazing !
|
|
fremag
Junior Member

Posts: 73
|
Post by fremag on Jun 3, 2020 7:47:06 GMT
Hi,
This is really amazing.
I tried to program my GPU with CUDA (some very basic things) and I was pretty sure that a GPU could not be very efficient to do ray tracing because in the main algorithms, there are a lot of "if/else" statements and kernel functions don't like branches.
Obviously I'm wrong and I will have to go deeper into GPU programming.
|
|
madox
New Member
Posts: 22
|
Post by madox on Jun 5, 2020 1:38:59 GMT
Ya there were a few places that resulted in deep nested branches that I had to put a limit on, like patterns of patterns of patterns etc. And the perlin pattern was a total no go. But the GPU can totally do it. I was suprised also. I never did CUPA though. Is that like cross compiling?
|
|
fremag
Junior Member

Posts: 73
|
Post by fremag on Jun 5, 2020 9:19:33 GMT
CUDA is the NVidia platorm / API to program their GPU. I tried it with native C++ (the hard way) but there is a very nice C# project (http://www.ilgpu.net/) that will transform some .Net "bytecode" into GPU program.
I made some tests to compute triangle intersections: send the triangles data to the GPU memory and program a kernel function to compute all intersections for a given ray. The GPU can compute a lot of things in parallel so I expected a good speedup for scenes with a lot of triangles.
But it was a failure because the time spent to send and retrieve data between CPU / GPU is not 0 and the final rendering time was higher than without the GPU !
|
|
johnk
New Member
Posts: 3
|
Post by johnk on Mar 14, 2023 4:10:45 GMT
Real-time AND online!! Wow! Can you please share how you did this?
|
|