Page 1 of 1

TTriSurface hardware accelaration

Posted: Thu Aug 03, 2023 9:22 am
by 16594665
Hello,

I'm trying to represent a real-time curving substrate in 3D.
My goal is to offload most of the heavy-lifting onto a GPU.
To do so, I have put together a TTriSurface in a TChart within a demo project you'll find attached.
The rendering speed of my demo application is improvable (maximum 20 FPS on my machine).

How can I ensure effective hardware acceleration ?

Below are some items that stood out to me :
- In VCLTee, the OpenGL module achieves my requirements, but it isn't supported in FMXTee.
- Enabling global Skia4Delphi usage, TChart canvases seem to default to GLCanvas (supposedly an OpenGL canvas). Nevertheless, it doesn't seem to use the GPU out of the box.
- The base TChart canvas (D2DCanvas) doesn't seem to offload 3D rendering onto the GPU.

Below is my configuration:
Software:
- Embarcadero Delphi 11.3 version 28.0.48361.3236.
- TeeChart FMX Pro with source : Build 2023.38.230607.
- Skia4Delphi version 5.0.0.

Hardware :
- Intel Iris Xe graphics GPU (vPro i7 laptop CPU)
- Nvidia T550 Laptop GPU


Thanks in advance for your help.

Have a nice day.

Regards,

Gabriel A. TAOUSSI

Re: TTriSurface hardware accelaration

Posted: Mon Aug 07, 2023 8:06 am
by 16594665
Greetings,

To demonstrate the performance I'm looking for, please find attached a project based on VCLTee I have assembled :
AcceptableTriSurface.zip
TriSurface with satisfying rendering speed and GPU usage
(7.5 KiB) Downloaded 1059 times

I believe FMXTee's Chart3D holds the answer to my question. It does seem to support hardware acceleration out of the box.
Unfortunately, within a Chart3D, trisurfaces don't render at all on my machine.
In the attachments, you'll find another project to illustrate this, here is its output on my machine :
TriSurfaceInChart3D.zip
Trisurface in Chart3D project attempt
(7.18 KiB) Downloaded 1044 times
Shy TriSurface.png
TriSurface won't render
Shy TriSurface.png (55.88 KiB) Viewed 32837 times

Any idea what I might be missing ?

Have a great day.

Regards,

Gabriel A. TAOUSSI

Re: TTriSurface hardware accelaration

Posted: Fri Aug 25, 2023 6:47 am
by yeray
Hello Gabriel,

Sorry for the delayed reply here.

This is just to confirm only these environments use the GPU:
- VCL + OpenGL
- FMX + TChart3D

We are still experimenting with Skia canvas.
Gabriel, A. TAOUSSI wrote:
Mon Aug 07, 2023 8:06 am
Unfortunately, within a Chart3D, trisurfaces don't render at all on my machine.
We'll take a look at that.

Re: TTriSurface hardware accelaration

Posted: Thu Oct 05, 2023 9:19 am
by 16594665
Hello Yeray,

Thank you for the reply. I have been busy on other fronts as well.

Have you been able to reproduce the TTriSurface absence of rendering within FMX Chart3D ?


In the meantime, I had to move forward with my back-end development, among others. To do this, I wrapped a VCLTee Chart3D in a DLL for temporary use with my FMX application.

As demonstrated with the attached project below, it turns out VCLTee's TTriSurface only performs well with no new sample values filled :
NotSoAcceptableTriSurface.zip
When TTriSurface values are modified, the rendering performance decreases cripplingly.
(95.34 KiB) Downloaded 688 times

This prevented me from directly feeding my non-regular grid data. Instead, I had to interpolate my data to a regular grid and use a TSurface, removing TTriSurfaces altogether:

Sample result - Trim.gif
Costly temporary workaround: lacks the top-tier looks of a TTriSurface.
Sample result - Trim.gif (316.58 KiB) Viewed 15643 times

With my back-end validated, I have to admit the front-end is turning into a liability. This is because:
- I am using a VCL DLL
- The resulting 3D is far from crisp
- The cost of interpolating into a regular grid is unreasonable.

Do you think real-time TTriSurface plotting is doable with FMX TeeChart ?

Thanks for your help.

Have a great day.

Regards,

Gabriel A. TAOUSSI

Re: TTriSurface hardware accelaration

Posted: Mon Oct 30, 2023 2:41 pm
by 16594665
Hello Yeray,
Yeray wrote:
Fri Aug 25, 2023 6:47 am
Gabriel, A. TAOUSSI wrote:
Mon Aug 07, 2023 8:06 am
Unfortunately, within a Chart3D, trisurfaces don't render at all on my machine.
We'll take a look at that.
Have you had time to look into this ?

Is there a real-time plotting implementation example with FMX TTriSurface usage ?

Best regards,

Gabriel, A. TAOUSSI

Re: TTriSurface hardware accelaration

Posted: Tue Oct 31, 2023 10:12 am
by yeray
Hello,

We appreciate your patience and your willingness to work with us on this.
After investigating it, it pains us to admit that we haven't yet identified a clear-cut solution here.

Re: TTriSurface hardware accelaration

Posted: Thu Nov 02, 2023 9:42 am
by 16594665
Hello Yeray,

It's the least I can do for our developper community.
Thank you for your availability and your transparency.

To help prioritize and reproduce this issue, would you mind me filing a bug report ?

Best regards,

Gabriel, A. TAOUSSI

Re: TTriSurface hardware accelaration

Posted: Thu Nov 02, 2023 9:53 am
by yeray
Hello,
Gabriel, A. TAOUSSI wrote:
Thu Nov 02, 2023 9:42 am
would you mind me filing a bug report ?
Of course, feel free to do so at bugzilla.

Re: TTriSurface hardware accelaration

Posted: Fri Nov 03, 2023 7:31 am
by David

Re: TTriSurface hardware accelaration

Posted: Fri Nov 03, 2023 2:50 pm
by 16594665
Hi David,

Thank you for your initiative and for your time.

As it touched two different subjects, this thread is a little convoluted.
The bug is about FMX TTriSurfaces not rendering within a chart3D. The relevant project is TriSurfaceInChart3D.zip :
TriSurfaceInChart3D.zip
(7.18 KiB) Downloaded 532 times

Here’s a description and test plan for bug 2644 :
Description :
Within an FMX Chart3D, TTriSurface objects don't render.

Software configuration :
- Embarcadero Delphi 11.3 version 28.0.48361.3236.
- TeeChart FMX Pro with source : Build 2023.38.230607.
- Skia4Delphi version 5.0.0.

Hardware configuration :
- Intel Iris Xe graphics GPU (vPro i7 laptop CPU)
- Nvidia T550 Laptop GPUD

Test plan :
1 - Unzip, build and launch the project in 64-bit release mode.
2 - Click the upper left side "3D editor" button.
3 - Within the newly opened window, select the Series group in the left side treeview.
4 - Make sure Series1 is listed while TTriSurface doesn’t render in the Chart3D.

Can you please update bug 2644 ?
Please note that the TeeChart software version has been specified.
Please also note that this is not an enhancement, rather an anomaly resolution.

Thank you again for your help.

Regards,

Gabriel A. TAOUSSI

Re: TTriSurface hardware accelaration

Posted: Sat Nov 04, 2023 9:57 am
by yeray
Hello Gabriel,

I've just added your comments and project to the ticket.
Thanks for the update.

Re: TTriSurface hardware accelaration

Posted: Mon Nov 06, 2023 9:34 am
by 16594665
Hello Yeray,

Thank you for your patience.

Let me know if I can help with possible tests.

Have a great day.

Regards,

Gabriel, A. TAOUSSI