Page 2 of 2

Re: Experiments In Ray Tracing 2 (materials, shaders)

Posted: Tue Mar 08, 2016 10:23 pm
by bbanelli
Hades wrote:@bbanelli
I've tried to calculate how much FPS you should get on several ways, and every time 75 FPS for me translate to 48-50 for you. When I do the same for PureLust I get 21 FPS, so he is even slightly above expectations. I'm at a loss. I assume your computer is doing fine in benchmarks like cinebench?
I'm not much into 3D, but am admirer of the magic you and people on this forum produce in 3D.

Thus, I can only presume these results should be fine?

http://imgur.com/1Oa8Sj6

Re: Experiments In Ray Tracing 2 (materials, shaders)

Posted: Tue Mar 08, 2016 10:40 pm
by Hades
@bbanelli

I'm really sorry for the confusion I've caused, I had mixed up your CPU before. Your CPU does actually have only about 50% the speed of a 6700K, so your results are actually right where they should be.
Looks like next time I need to make things even faster. :?

Re: Experiments In Ray Tracing 2 (materials, shaders)

Posted: Thu Mar 10, 2016 8:19 pm
by davido
I just get a blank white screen showing FPS: 120 -135.
Tested on i7 5960; windows 10-64; PureBasic 5.42LTS

Re: Experiments In Ray Tracing 2 (materials, shaders)

Posted: Fri Mar 11, 2016 12:35 am
by Hades
Many thanks for those reports. Sadly I'm rather puzzled about that.

@davido

You could try to change #RenderWidth/Height to something 2^n, maybe 512x512, or 512x256. If that works, than it would be a problem with OpenGL on Win10 (Microsoft still packing ancient OpenGL versions to push DirectX)

@Alexi

That one I get even less. You could try to comment out Intersect_Spheres(), and remove the '1' from Intersect_Spheres1(), but I really have no idea why that should cause a problem on your CPU, but the rest makes even less sense to me. :(

If I can't even get simple stuff like that to work reliably, I'm in real trouble. :evil:

Re: Experiments In Ray Tracing 2 (materials, shaders)

Posted: Fri Mar 11, 2016 8:37 am
by davido
@Hades,
Thank you for your solution to my problem.
You are correct. Works with 512x512, however, the FPS is down at about 37 with all 8 cores running at 100% :shock: . Presumably this is due to the ancient OpenGL version Microsoft are using.

Sorry, I almost forgot to say how great it looks. Impressive. :D

Re: Experiments In Ray Tracing 2 (materials, shaders)

Posted: Fri Mar 11, 2016 8:54 am
by Hades
Many thanks for reporting back, and for your nice words, too. :D

The speed however is pretty crappy, for a system like yours. :(
Again, only explanation I have is Microsofts OpenGL version. Installing a newer one might be a good idea for for other situations, too. Give it a try, maybe?

Have a nice day!

Edit: Or are you running the PB version of Intersect_Spheres(), that would explain the speed, too.

Re: Experiments In Ray Tracing 2 (materials, shaders)

Posted: Fri Mar 11, 2016 9:46 pm
by Hades
Many thanks @Alexi, that gave me the right idea. I've fixed a pretty big problem, lets hope it was the only one. :oops:

Re: Experiments In Ray Tracing 2 (materials, shaders)

Posted: Fri Mar 11, 2016 9:51 pm
by Andre
Very impressive! :mrgreen:

What is curious here, running a PC with 4720HQ processor / 16 GB RAM and Win8.1:
After firstly starting from the PB IDE (v5.42) the program runs at around 35-40 FPS.
The created executable is starting with around 48 FPS, but already after less than a second it slows down to 12 FPS. After a while it increases step by step up to 35 FPS, but it never reaches the starting speed (and the speed running it from PB IDE) again!?

Re: Experiments In Ray Tracing 2 (materials, shaders)

Posted: Fri Mar 11, 2016 10:15 pm
by Hades
@Andre

Looks like I need to work on it a little more. :(

My synchronization between Frames is a little too creative, and the fps counter suffers from that.
Also I need to deal with data alignment. While that's not a problem here, performance on older CPUs might suffer a bit.

Let's see if that helps with that 'curious' behavior. Might take a bit...

Edit: new version posted

It's really hard to fix problems that don't exist on your own machine. I can only hope it's better now, and that I haven't broken anything else for others. :|

Re: Experiments In Ray Tracing 2 (materials, shaders)

Posted: Fri Mar 11, 2016 11:36 pm
by davido
@Hades,

Tried your code on another machine: Windows 10 64bit, i5-4670 with PureBasic 5.31.
It ran ok with an average FPS of 43.
This would seem to indicate that Windows 10 is not the culprit.
So I checked the 5960 machine and discovered that there was an issue with a the GTX970 graphics card driver.
I updated the software and all was ok with an average FPS of 125.

As the graphics seemed to work I did not consider the driver as a problem.
I apologise; I should have been more thorough. :oops:

Re: Experiments In Ray Tracing 2 (materials, shaders)

Posted: Sat Mar 12, 2016 12:29 am
by Hades
Don't worry, it's perfectly fine. I really want to hear about the problems people are having, so I can improve my code.

But 125 FPS? That's more than I expected. That's a really sweet machine you've got there. :D

Re: Experiments In Ray Tracing 2 (materials, shaders)

Posted: Sat Mar 12, 2016 12:51 pm
by macros
I just tested your code on Linux and it wouldn't run.
PureBasic just told me
"The debugged executable quit unexpectedly."

With my own projects I only got this message if I killed the program with the OS tools.

My System:
i7-3610QM 2.30Ghz, Kubuntu 15.10, KDE 5.5.4. Purebasic 5.41
I also tried running the compiled executable on my dGPU (AMD 7970m) and tried setting the render width/height to 512.
Running the program from the console it complains about an IMA

Re: Experiments In Ray Tracing 2 (materials, shaders)

Posted: Sat Mar 12, 2016 1:33 pm
by Hades
Hi, and thanks for the detailed test and report.
But I am afraid I have no experience with Linux, and for now, I'm out of ideas where to look for the cause of the problem.
If anyone could point me in the right direction, I'd be a very happy dude.