Author Topic: Post-Processing  (Read 822 times)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 216
Re: Post-Processing
« Reply #15 on: February 13, 2018, 07:50:43 pm »
Patrice,

It's just now that I got a bit of free time. Downloading and merging...

Works nicely, thanks a bunch! :)

([UPD] I'm currently revising the entire hardware.h; I have two nVidia GPUs working in parallel and I need a mean of two concurrent usages. The new ObjReaderVBO is attached below. Please let me know if its readings for your single nVidia GPU box are still correct.)

Quote
I am working on a stress test model with 17855355 indices...

We are going to have problems with our VRAMs soon. :)

All the verts and indices, as well as shaders and 8K textures and their mipmaps go there. When there isn't enough VRAM room for everything, the GPU starts to transparently swap parts of it into ordinary RAM. This is bound to seriously affect the frame rate.

GeForce Titans 1050+ are in extreme demand these days. Everybody seems to have gone bitcoin mining, and the prices skyrocketed dramatically. :)
« Last Edit: February 14, 2018, 10:00:55 am by Michael Lobko-Lobanovsky »
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, 2 x nVidia GTX 650Ti w/ 2GB VRAM, Windows 7 Ultimate Sp1)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 216
Re: Post-Processing
« Reply #16 on: February 13, 2018, 11:53:29 pm »
I have found some C# code that collects GPU load data for ATi videocards. Surprisingly, ATi drivers are open source but there's no clear guide as to how to collect ATi GPU data. nVidia drivers are closed source but everybody seems to know how to squeeze the last bit of fan RPM and GTX GPU temperature data out of them. :D

Nobody knows what to do with Intel GPUs. They are absolutely opaque black boxes. ;)

Below is a snapshot of ObjReader running on my AMD box with an Athlon 64 X2 dual core CPU and ATi Radeon R7 200 GPU. As you can see, the CPU meter works (high load is due to the AV scanner running concurrently its scheduled task) but the GPU meter is yet dead. Hopefully it goes alive some day too. :)
« Last Edit: February 14, 2018, 12:23:51 am by Michael Lobko-Lobanovsky »
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, 2 x nVidia GTX 650Ti w/ 2GB VRAM, Windows 7 Ultimate Sp1)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 216
Re: Post-Processing
« Reply #17 on: February 14, 2018, 08:00:28 am »
Patrice,

Your "delay" calc in gl_TimerView() is mistakenly 2 ticks off the point, just as your IPS was in gl_DrawScene().

Watch the correct arithmetic and readings in action. Probably for the first time in ObjReader's history.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, 2 x nVidia GTX 650Ti w/ 2GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 403
    • zapsolution
Re: Post-Processing
« Reply #18 on: February 14, 2018, 08:27:26 am »
I am well aware of it, that was done by design, and this is the exact reason why i am using the word IPS rather than FPS:
The historical purpose of it, was to save the CPU. I am doing this also in BassBox, however in BassBox i have the High FPS option (see the attached screen shot, and the High FPS checkbox).

This allow my OpenGL (1.0, 2.0) multimedia applications to be more cooperative with the other running applications.

I had this in mind when i wrote the word new "overclocking" option (when using VBO), in one of my previous post ;)

Added:
You may read this about the DwmGetCompositionTimingInfo, because ObjReader/GDImage are using much DWM beind the hood, especially on Windows 10.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa969503(v=vs.85).aspx
« Last Edit: February 14, 2018, 09:33:00 am by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 216
Re: Post-Processing
« Reply #19 on: February 14, 2018, 09:30:51 am »
Hehe, so your Easter egg has been spotted, isolated, and neutralized! :P

Seriously, I think we shouldn't fiddle with these tweaks. Using a Windows timer in a serious application is in itself a weird enough thing to do but tweaking that timer is a bit too much. If you want a half speed then VSYNC it traditionally to 30 FPS and be done with it. If you want decent 60 FPS then VSYNC it to 60 or adaptively. If you want full thrust and steaming GPUs then disable VSYNCing altogether and fry your omelette on your box' top cover. But all this fiddling with the timer does no real good and leads only to jerky rotations and stalls.

To cut it short, I fixed the arith in all the three places and renamed nIPS to nFPS, and "IPS", to "FPS". Rotation is smooth, and GPU%, bearable. And FPS and Fraps readings, equal. :)
« Last Edit: February 14, 2018, 09:32:42 am by Michael Lobko-Lobanovsky »
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, 2 x nVidia GTX 650Ti w/ 2GB VRAM, Windows 7 Ultimate Sp1)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 216
Re: Post-Processing
« Reply #20 on: February 14, 2018, 10:22:31 am »
Patrice,

Let's stop theorizing for a while and get busy with verification.

My readings are in the screenshot below. What are yours, svp?

(new ObjReaderVBO attached)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, 2 x nVidia GTX 650Ti w/ 2GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 403
    • zapsolution
Re: Post-Processing
« Reply #21 on: February 14, 2018, 10:40:09 am »
Here is mine, using exactly the same window size than your screen shot.

There is obviously a big difference...  :-[
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 216
Re: Post-Processing
« Reply #22 on: February 14, 2018, 11:25:18 am »
No wonder, your GPU is faster than mine.

We were talking about DWM: I'm observing absolutely no stress on the DWM subsystem in my screenshot.

Here are my readings on my Windows 10 box (it has my old pair of 8600 GTE geForces installed, hence significantly lower FPS but again no stress on DWM).

BTW Fraps works under my W10 like a charm; I don't understand why it isn't working for you.

My AMD/ATi readings will come a little later because ObjReader's ATi Radeon initialization code isn't ready yet.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, 2 x nVidia GTX 650Ti w/ 2GB VRAM, Windows 7 Ultimate Sp1)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 216
Re: Post-Processing
« Reply #23 on: February 14, 2018, 11:58:27 am »
And here's my AMD/ATi screenshot though ObjReader's Radeon code still isn't working. The GPU usage can be seen in the desktop gadget.

Again, DWM % is very low as is CPU. Frankly, I don't fully understand why we're talking about DWM at all.

As for me, the new ObjReader is performing pretty decently and especially so on your own laptop. So what should we worry about? ::)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, 2 x nVidia GTX 650Ti w/ 2GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 403
    • zapsolution
Re: Post-Processing
« Reply #24 on: February 14, 2018, 12:50:53 pm »
Quote
BTW Fraps works under my W10 like a charm; I don't understand why it isn't working for you.
I could not find a link for W10, i have an old one, but it failed miserably on my computer.

Quote
As for me, the new ObjReader is performing pretty decently and especially so on your own laptop. So what should we worry about?
This version is light years ahead of any other players around, and it disserves a new major # (version 3.00).

Your work on VBO is just perfect for my ASUS laptop, you have got my five stars, no contest.
I am looking forward to see the source code ;)
 
Added
About DWM frequency, this one returns 75 by me, on my ASUS laptop.
Code: [Select]
void DwmFrequency() {
    DWM_TIMING_INFO dti;
    ClearMemory(&dti, sizeof(dti));
    dti.cbSize = sizeof(dti);
    if (DwmGetCompositionTimingInfo(NULL, &dti) == S_OK) {
        LARGE_INTEGER Frequency;
        if (QueryPerformanceFrequency(&Frequency)) {
            float hz = (float) (Frequency.QuadPart / dti.qpcRefreshPeriod);
zTrace(STRF(hz));
        }
    }
}
« Last Edit: February 14, 2018, 01:19:11 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 216
Re: Post-Processing
« Reply #25 on: February 14, 2018, 01:47:33 pm »
Patrice,

My suggestion is as follows.

I'm hoping to get the Radeon usage code working today. When done, I'll send you the sources and we can release this build as ObjReader v2.5 Stable. We will be keeping it available for users even when working towards ObjReaderFBO w/ post-processing and other capabilities and we will be using it as a reference for our own progress.

When ObjReaderFBO is ready as v3.0, we will still be offering v2.5 for users with simpler hardware and undemanding needs of viewing .OBJ models in a decent viewer. At the same rime, my own goal is to keep on introducing more and more editorial features like lighting, cameras, simple animations, pre-/post-processing effects, etc. Possibly adding an own binary file format to keep these candies in the model file itself as .MAX, .LWS, .C4D files do, and also to make file sizes significantly smaller and faster to load etc. etc. etc........

I will also send you my Fraps installer. It's free to use and it works in 64 bits like a charm. It's still a 32-bit binary itself but it installs a 64-bit detour on the 64-bit OpenGL and/or DirectX drivers to be able to work with both bitnesses simultaneously.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, 2 x nVidia GTX 650Ti w/ 2GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 403
    • zapsolution
Re: Post-Processing
« Reply #26 on: February 14, 2018, 02:06:23 pm »
i feel like an happy camper looking at the shooting stars during a dark summer night  :) ;) :D ;D
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 403
    • zapsolution
Re: Post-Processing
« Reply #27 on: February 17, 2018, 06:53:18 am »
In the VBO version replace the ips.png (both source code, and skin folder) with the new attached fps.png

Also, because you have switched to overcloking mode, replace
if (gP.rGiroStep == 0.0f) { gP.rGiroStep = 0.25f; }
with
if (gP.rGiroStep == 0.0f) { gP.rGiroStep = 0.125f; }
 8)
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 216
Re: Post-Processing
« Reply #28 on: February 17, 2018, 10:44:45 am »
Quote
... replace the ips.png ...

Cool! Done.

Quote
... replace if (gP.rGiroStep == 0.0f) ... 8)

I won't. First study my fixes, then replace if needed.  :P

My VBO mods are attached below:

1. isSphereInFrustum() temporarily disabled not to irritate you for the time being
2. Multiple nVidia geForce usages supported
3. Single ATi Radeon usage supported
4. Intel GPU usage not supported yet

Please merge your most recent mods, if any, with my base code, re-compile, and let me know if it works fine for you.

P.S. Would love to see one or the other of those (or similar) icons somewhere to indicate the current GPU.
« Last Edit: February 17, 2018, 10:55:19 am by Michael Lobko-Lobanovsky »
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, 2 x nVidia GTX 650Ti w/ 2GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 403
    • zapsolution
Re: Post-Processing
« Reply #29 on: February 17, 2018, 01:28:10 pm »
Quote
I won't. First study my fixes, then replace if needed.
Are you aware that you can adjust the speed with the "+" or "-" key
the FPS being twice the IPS, gP.rGiroStep must be half its previous value, to keep the smooth small step i have used by design.
If you find it too slow just, press the "+" key.
We could also add of a new preference setting to save the user choice ;)
Patrice
(Always working with the latest Windows version available...)