Experiments In Ray Tracing 2 (materials, shaders)

Everything related to 3D programming
User avatar
bbanelli
Enthusiast
Enthusiast
Posts: 544
Joined: Tue May 28, 2013 10:51 pm
Location: Europe
Contact:

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

Post 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
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/
User avatar
Hades
Enthusiast
Enthusiast
Posts: 188
Joined: Tue May 17, 2005 8:39 pm

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

Post 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. :?
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

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

Post by davido »

I just get a blank white screen showing FPS: 120 -135.
Tested on i7 5960; windows 10-64; PureBasic 5.42LTS
DE AA EB
User avatar
Hades
Enthusiast
Enthusiast
Posts: 188
Joined: Tue May 17, 2005 8:39 pm

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

Post 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:
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

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

Post 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
DE AA EB
User avatar
Hades
Enthusiast
Enthusiast
Posts: 188
Joined: Tue May 17, 2005 8:39 pm

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

Post 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.
User avatar
Hades
Enthusiast
Enthusiast
Posts: 188
Joined: Tue May 17, 2005 8:39 pm

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

Post 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:
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2148
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

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

Post 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!?
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Hades
Enthusiast
Enthusiast
Posts: 188
Joined: Tue May 17, 2005 8:39 pm

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

Post 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. :|
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

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

Post 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:
DE AA EB
User avatar
Hades
Enthusiast
Enthusiast
Posts: 188
Joined: Tue May 17, 2005 8:39 pm

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

Post 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
User avatar
macros
User
User
Posts: 92
Joined: Wed Mar 15, 2006 1:47 pm
Location: Munich

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

Post 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
User avatar
Hades
Enthusiast
Enthusiast
Posts: 188
Joined: Tue May 17, 2005 8:39 pm

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

Post 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.
Post Reply