ProEssentials v10 WinForms .NET 8 demonstration of GPU compute-shader 3D surface rendering — real material-surface and terrain height-map data visualized across three synchronized charts. This is the WinForms sibling of the WPF GigaPrime3D demo; the ProEssentials chart configuration is identical between the two — only the host shell differs. It doubles as a small proof that WinForms is not a dead platform: it matches its WPF sibling pixel-for-pixel in look, feel, and performance, on a framework Microsoft still ships every year (.NET 10 LTS, supported into 2028).
This project is the same chart, line for line, as the
WPF GigaPrime3D demo
— identical look, feel, and GPU performance — which is exactly the point: in 2026,
choosing WinForms costs you nothing in capability. WinForms ships on an annual
cadence with every .NET release, and .NET 10 is a Long-Term Support release
(November 2025) supported into November 2028 — a multi-year runway, not a
dead end. Genuinely shipped (not preview) WinForms work in .NET 10 includes
fully integrated dark mode (one Application.SetColorMode call switches
Classic / System / Dark), a clipboard implementation shared with WPF plus
designer editors ported from .NET Framework, a new screen-capture protection API
for sensitive on-screen data, and the async forms APIs out of preview. And for a
charting engine that couples Direct3D directly to the window's hDC — as
ProEssentials does — WinForms is at least as fast as WPF, often a touch faster,
because it renders the native surface directly instead of through WPF's
airspace/compositing layer. The reflexive "use WPF if you care about performance"
gets it backwards here.
| Chart | Type | Purpose |
|---|---|---|
| Chart3DSurface | Pe3do — 3D Surface |
Main GPU-rendered 3D surface with lighting, rotation, zoom (fills center) |
| Chart2DContour | Pesgo — 2D Contour |
Linked top-down contour (bottom-left) — zoom here zooms the 3D chart |
| Chart2DLine | Pesgo — 2D Cross Section |
Live cross-section at the X-plane position (right column) |
GPU Compute Shader Surface Construction — PeData.ComputeShader = true builds
the 3D scene on the GPU (v10), ~10× faster than v9 CPU-side construction.
Zero Memory Copy — PeData.X/Y/Z.UseDataAtLocation(...) shares one set of app
buffers between the Pe3do surface and the Pesgo contour (no data transfer).
Linked Chart Zoom — zooming/panning the 2D contour updates ManualScaleControlX/Z
on the 3D surface so both views stay synchronized.
Pixel Shader Culling — PeGrid.Configure.DxPsManualCullXZ = true culls
off-range geometry on the GPU during zoomed views.
The chart-logic blocks (Initialize3D / Initialize2DContour / Initialize2D /
RefreshUi / MoveXPlane, the 256-entry jet palette, and all the Pe* calls)
are copied verbatim from the WPF demo. Only the host shell was rewritten:
MainWindow.xaml3-columnGrid→ code-built WinForms layout: 3D surfaceDock=Fillin the center with the rotation/zoom/explode sliders overlaying its top-left; a 275px sidebarDock=Left; a 220px line-chart columnDock=Rightwith the X-plane slider; the 2D contour floats 360×360 in the bottom-left.App.xaml(.cs)→Program.cs;MainWindow.xaml.cs→MainForm.cs(no.Designer.cs/.resx, so the WinForms designer is never invoked).- WPF Slider
RoutedPropertyChangedEventArgs<double>→EventArgs+slider.Value; CheckBoxChecked/Uncheckedpair → oneCheckedChanged; ComboBoxSelectionChanged→SelectedIndexChanged;Window.Closing→FormClosing. System.Windows.Media.Color→System.Drawing.Color;Cursor.LastMouseMoveSystem.Windows.Point→System.Drawing.Point; GCHandle pins freed inDispose(bool); the WPFDispatcher.InvokeAsynczoom defer →BeginInvoke.- Stock
TrackBar/CheckBox→ owner-drawnFlatSlider/FlatCheckBoxso the dark sidebar matches the WPF look.
➡️ WPF version: wpf-chart-3d-surface-proessentials
.bhm— Binary Height Map: 32-byte header (int32 width, int32 height, float minZ, float maxZ) followed by a flat array of 4-byte floats..png— decoded as raw pixel data for height values.
The HeightMap class handles both, computing physical dimensions in millimeters
from pixel dimensions and resolution. Sample data ships with the project so it
runs out of the box.
3D Surface — left-drag rotate · Shift+left-drag translate · wheel zoom · middle-drag light · right-click menu (Cursor Tracking, Undo Zoom). Sidebar: height-map selector, Legend / Bottom Contour / X-Plane / Cursor-Tracking checks, Reduce Data, Help, and Move / Light sliders. Overlay: Vertical/Horizontal rotation, Magnification, Explode-Z. 2D Contour — left-drag zoom (also zooms the 3D surface) · right-click Undo Zoom. X-Plane slider moves the cross-section plane and updates the 2D line chart live.
- Visual Studio 2022
- .NET 8 SDK (Windows)
- Internet connection for NuGet restore
- x64, dedicated GPU recommended for the large data files
- Open
GigaPrime3D.slnin Visual Studio 2022 - Build → Rebuild Solution (restores the NuGet package automatically)
- Press F5
- Select a height map from the dropdown to load surface data
Designer note: No
.Designer.csby design — the UI is built in code inMainForm.cs, avoiding the native-control designer issues entirely.
References ProEssentials.Chart.Net80.x64.Winforms
from nuget.org. Package restore happens automatically on build.
Example code is MIT licensed. ProEssentials requires a commercial license for continued use.
