Skip to content
v3-rc2: Surface plot of f(x,y), with colormap in shader

Computes the plot of a function $z=f(x,y)$ of two parameters.
Draw the surface, grid wireframe, and cloud of points, each
separately toggleable from UI.

Heatmap of the function is not available for now.

The compute kernel (be it on CPU or GPU) rescales $z$ values to
be in the [0.0, 1.0] range (assuming given range; some of values
fall outside it, to show how colormap handles such values).

The function to draw is hardcoded in plot2d_common.hpp as `func(x,y)`,
and cannot be changed at runtime.  The min-max rescaling is implemented
by `rescaledValue()`.  The colormap code is embedded in the fragment
shader, as `colormap()` function in the 'glsl/plot2d.vert' shader.

Simple grayscale colormap (`vec4(x, x, x, 1.0)`) is used, with overflow
marking (blue, or vec4(0,0,1,1), for values smaller than expected
minimum value, and red, or vec4(1,0,0,1) for values above expected
maximum).