Initial palette loading

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Arction_LasseP

Posts: 12
Joined: Mon May 30, 2016 9:29 am

Initial palette loading

Post by Streght » Mon Jul 25, 2016 2:31 pm

Hello there,

I'm using LightningChart to create 3D surfaces and I have a performance issue with the colormap loading.

I saw on this post ( that the precompiled shader count was 10 and that after they have to be computed "on the fly".

My problem is that I'm using colormap that ranges from 64 to 1024 steps (color are imported with a picture), needless to say that the computation time is just way too long for an application (about 10 minutes for 64 steps).

Is there anyway to accelerate this process by improving the precompiled shader count, or any way to store the compiled shaders to do it only once (I don't even know if it's possible).

Kind regards !

PS :

I'm using this method to create a palette :

Code: Select all

/// <summary>
/// Create a colormap on a 3D surface with the step values provided.
/// </summary>
/// <param name="p_cPaletteValues"> The array with the colormap steps as RGB. </param>
/// <param name="p_fMinColormap"> The minimum value of the colormap. </param>
/// <param name="p_fMaxColormap"> The maximum value of the colormap. </param>
private ValueRangePalette CreatePalette(Color[] p_cPaletteValues, float p_fMinColormap, float p_fMaxColormap)
    ValueRangePalette vrpPalette = new ValueRangePalette(m_lcuChart3D.View3D.PointLineSeries3D[0]);
    // Need to clean the default colormap with Red / Blue / Green / White colors.
    // No gradient between the colormap steps.
    vrpPalette.Type = PaletteType.Uniform;
    // Set the min value for the colormap.
    vrpPalette.MinValue = p_fMinColormap;

    int iPaletteValuesLength = p_cPaletteValues.GetLength(0);
    for (int i = 0; i < iPaletteValuesLength; i++)
        // Add the values of p_aiPaletteValues to the colormap steps.
        vrpPalette.Steps.Add(new PaletteStep(vrpPalette,
            ((i + 1) * p_fMaxColormap + (iPaletteValuesLength - (i + 1)) * p_fMinColormap) / iPaletteValuesLength));
    return vrpPalette;

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

Re: Initial palette loading

Post by ArctionPasi » Mon Jul 25, 2016 4:58 pm


precompiled shader count is 19 steps in onwards.

To increase the step count, you will need LC source code. Higher precompiled step count means slightly longer delay in initialization of also low step count applications, but greatly improves initialization time with high counts.
LightningChart Support Team, PT