Blank display of SurfaceMeshSeries3D

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Arction_LasseP

Krunal.iFour
Posts: 4
Joined: Tue Aug 02, 2016 7:41 am

Blank display of SurfaceMeshSeries3D

Post by Krunal.iFour » Tue Aug 02, 2016 8:05 am

Hi, I have implemented following code with version 7.0.2.4001, and its working fine.

Code: Select all

public partial class Form1 : Form
    {
        private LightningChartUltimate _mChart3D = null;
        private SurfaceMeshSeries3D _mSurfaceMeshSeries3D = null;

        public Form1()
        {
            InitializeComponent();
            CreateChart();
        }

        private void CreateChart()
        {
            _mChart3D = new LightningChartUltimate();
            _mChart3D.BeginUpdate();
            _mChart3D.Parent = panel1;
            _mChart3D.Dock = DockStyle.Fill;
            _mChart3D.ActiveView = ActiveView.View3D;

            _mChart3D.View3D.Camera.RotationY = 60;
            _mChart3D.View3D.Camera.ViewDistance = 200;
            _mChart3D.View3D.ClipContents = true;
            _mChart3D.View3D.WallOnBack.Visible = false;
            _mChart3D.View3D.WallOnLeft.Visible = false;
            _mChart3D.View3D.WallOnRight.Visible = false;
            _mChart3D.View3D.WallOnTop.Visible = false;
            _mChart3D.View3D.WallOnFront.Visible = false;
            _mChart3D.View3D.WallOnBottom.Visible = true;

            _mSurfaceMeshSeries3D = new SurfaceMeshSeries3D(_mChart3D.View3D, Axis3DBinding.Primary, Axis3DBinding.Primary, Axis3DBinding.Primary)
            {
                ContourLineType = ContourLineType3D.None,
                ContourLineWidth = 0,
                TraceMouseCell = false,
                MouseInteraction = false,
                MouseHighlight = MouseOverHighlight.None,
                ColorSaturation = 100,
                SuppressLighting = true,
                Fill = SurfaceFillStyle.PalettedByY,
                WireframeType = SurfaceWireframeType.None
            };

            _mChart3D.View3D.SurfaceGridSeries3D.Clear();
            _mChart3D.View3D.SurfaceMeshSeries3D.Add(_mSurfaceMeshSeries3D);

            var iColumnCount = 150;       // Working if value is <= 143
            var iRowCount = 33323;

            var minXIndex = 0;
            var maxXIndex = iColumnCount;
            var minYIndex = -205;
            var maxYIndex = 2000;
            var minZIndex = 0;
            var maxZIndex = iRowCount;

            _mSurfaceMeshSeries3D.Data = null;
            _mSurfaceMeshSeries3D.SizeX = iColumnCount;
            _mSurfaceMeshSeries3D.SizeZ = iRowCount;

            float yValue = 10;
            var flag = true;

            for (int iCol = 0; iCol < iColumnCount; iCol++)
            {
                for (int iRow = 0; iRow < iRowCount; iRow++)
                {
                    if (_mSurfaceMeshSeries3D.Data != null)
                    {
                        if (yValue > 2000) flag = true;
                        else if (yValue < -205) flag = false;
                        if (flag) yValue = (float) (yValue - 0.01);
                        else yValue = (float)(yValue + 0.01);

                        _mSurfaceMeshSeries3D.Data[iCol, iRow].Y = yValue;
                        _mSurfaceMeshSeries3D.Data[iCol, iRow].X = iCol;
                        _mSurfaceMeshSeries3D.Data[iCol, iRow].Z = iRow;
                    }
                }
            }

            _mChart3D.View3D.XAxisPrimary3D.SetRange(minXIndex, maxXIndex);
            _mChart3D.View3D.YAxisPrimary3D.SetRange(minYIndex, maxYIndex);
            _mChart3D.View3D.ZAxisPrimary3D.SetRange(minZIndex, maxZIndex);

            var palette = new ValueRangePalette(_mSurfaceMeshSeries3D);
            palette.Steps.Clear();
            palette.MinValue = 0;
            palette.Type = PaletteType.Gradient;
            palette.Steps.Add(new PaletteStep(palette, Color.Blue, 10));
            palette.Steps.Add(new PaletteStep(palette, Color.Green, 500));
            palette.Steps.Add(new PaletteStep(palette, Color.Yellow, 1000));
            palette.Steps.Add(new PaletteStep(palette, Color.Red, 1500));
            //and set to mesh
            _mSurfaceMeshSeries3D.ContourPalette = palette;

            _mChart3D.EndUpdate();

        }
    }
Now I have updated LightningChart Ultimate version to 7.1.1 and its stops working.
When I set iColumnCount (defined in sample code) variable to <= 143 then it will displayed 3d chart but If I set iColumnCount variable to > 143 then blank chart displayed with new version(7.1.1)

I need to set iColumnCount more then 200.What changes can be done with current code for fixed this issue?

Thanks

User avatar
ArctionPasi
Posts: 1366
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland

Re: Blank display of SurfaceMeshSeries3D

Post by ArctionPasi » Tue Aug 02, 2016 9:04 am

Hello.

In 7.1 we added Value-based coloring in surface series. It means we had to add Value field in SurfacePoint structure. It leads to slightly bigger memory consumption. Please compile & run your app in 64-bit mode and let us know if solves the problem.
LightningChart Support Team, PT

Krunal.iFour
Posts: 4
Joined: Tue Aug 02, 2016 7:41 am

Re: Blank display of SurfaceMeshSeries3D

Post by Krunal.iFour » Tue Aug 02, 2016 9:25 am

Value field added in SurfacePoint structure and done changes as you suggest, but same problem occur(No SurfaceMeshSeries3D chart created).

User avatar
ArctionPasi
Posts: 1366
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland

Re: Blank display of SurfaceMeshSeries3D

Post by ArctionPasi » Tue Aug 02, 2016 12:36 pm

using 2000x143 surface mesh will take about 800 MB of memory on GPU.

What is the GPU type you are running with?

Please use GPU-Z utility and observe the GPU memory consumption. How high does it go?

If you subscribe to chart.ChartError event handler, does it report anything?
LightningChart Support Team, PT

Krunal.iFour
Posts: 4
Joined: Tue Aug 02, 2016 7:41 am

Re: Blank display of SurfaceMeshSeries3D

Post by Krunal.iFour » Wed Aug 03, 2016 5:27 am

I have added sample project for creating SurfaceMeshSeries3D series and GPU info Image.

GPU memory consumption initially starting with 650MB and goes to around 1100MB high

With current project
If I set iColumnCount <=143, Display SurfaceMeshSeries3D with no error
If I set iColumnCount >143 and <169 then blank chart surface display
If I set iColumnCount >=169 then chart.ChartError report "Memory allocation failed" error of "MemoryAllocationError" ErrorType
Attachments
SurfaceMeshSeriesExample.zip
(181.03 KiB) Downloaded 443 times

Krunal.iFour
Posts: 4
Joined: Tue Aug 02, 2016 7:41 am

Re: Blank display of SurfaceMeshSeries3D

Post by Krunal.iFour » Mon Aug 08, 2016 6:59 am

Please add reply of this after investigating the issue.

Thank you.