Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

3D Realtime Surface — ComputeShader + CircularBuffer — WinForms

ProEssentials v10 WinForms .NET 8 — the fastest possible realtime 3D surface update: 720,000 vertices rebuilt every 15 ms using GPU compute shaders and a zero-copy circular-buffer append strategy. A single Pe3do 3D chart, Direct2D.

ProEssentials 3D Realtime Surface WinForms

➡️ gigasoft.com/examples/413


Found ProEssentials through this repo? Use code GITHUB15_OCT31 at checkout for 15% off your first license.

Thanks for sharing — every share and star helps another engineer find this repo.


Performance

Metric Value
Surface dimensions 800 subsets × 900 points
Vertices rebuilt per update 720,000
Timer interval 15 ms
Polygon construction GPU ComputeShader
Data append cost O(1) — CircularBuffer

How It Works

ComputeShader — GPU polygon construction

Without ComputeShader, the CPU computes vertex positions for all 720,000 polygons every 15 ms — sequential work on a single core. With ComputeShader enabled, the GPU does this work instead, with potentially thousands of cores operating in parallel. Comment out the five lines below to compare:

Pe3do1.PeData.ComputeShader   = true;
Pe3do1.PeData.StagingBufferX  = true;
Pe3do1.PeData.StagingBufferY  = true;
Pe3do1.PeData.StagingBufferZ  = true;
Pe3do1.PeData.CircularBuffers = true;

CircularBuffer — O(1) zero-copy append

Without CircularBuffers, every AppendData() call shifts all existing data in memory to make room for the new column — O(n) work. With CircularBuffers enabled, AppendData() advances an internal ring pointer and writes the new data at the current position; no existing data is moved, so the cost is always O(1).


WinForms vs WPF

This is the WinForms sibling of the WPF 3D Realtime Surface demo. The ProEssentials chart configuration — the Pe3do1.Pe* property block, the ComputeShader/CircularBuffer setup, and the per-tick AppendData() logic — is identical between the two. Only the host shell differs: a WinForms Form with the chart docked Fill and a System.Windows.Forms.Timer (15 ms) replacing the WPF Window + DispatcherTimer.

➡️ WPF version: wpf-3d-surface-realtime-computeshader-proessentials


Data file — terrain2.bin

This demo reads a 9 MB binary elevation file, terrain2.bin. Because of its size it is not committed to the repository. Place terrain2.bin in the project root before building; the .csproj copies it next to the executable (CopyToOutputDirectory), and the app resolves it at run time via AppContext.BaseDirectory. If the file is missing the app shows an error dialog and exits.


Prerequisites

  • Visual Studio 2022
  • .NET 8 SDK (Windows)
  • Internet connection for NuGet restore
  • x64
  • A GPU that supports compute shaders (for the ComputeShader path)

How to Run

  1. Clone this repository
  2. Place terrain2.bin in the project root (see Data file above)
  3. Open RealtimeSurface3D.sln in Visual Studio 2022
  4. Build → Rebuild Solution (restores the NuGet package automatically)
  5. Press F5

Designer note: This project has no .Designer.cs file by design — the UI is built in code in MainForm.cs. There is nothing for the WinForms designer to open, which avoids the native-control designer issues entirely.


NuGet Package

References ProEssentials.Chart.Net80.x64.Winforms from nuget.org. Package restore happens automatically on build.


License

Example code is MIT licensed. ProEssentials requires a commercial license for continued use.

About

Winforms .NET 8 fast realtime 3D surface chart — 720K vertices rebuilt every 20ms. Replace with competitor to compare. GPU ComputeShader builds polygon mesh using 2000+ cores. CircularBuffer enables O(1) zero-copy append with no data shifting. Pe3do Direct3D. ProEssentials v10 C#.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages