Discontinuous Galerkin elements and other novel cell-types/function-spaces

Correct, GLES 3.0 does not support them. Although, they can be emulated via 2D textures. All texelFetcheBuffers will be replaced by a texelFetch. The indexing code looks crazy but it works.

Ex: this will be edited at runtime by vtkOpenGLShaderCache


int main() {
  //  ...
  int cellId = texelFetchBuffer(cellIdsBuffer, gl_VertexID);
  //  ...
}

into

ivec2 Get2DIndexFrom1DIndex(int idx, ivec2 texSize)
{
  int w = texSize.x;
  int i = idx % w;
  int j = (idx - i) / texSize.x;
  return ivec2(i, j);
}
#define texelFetchBuffer(a,b) texelFetch(a, Get2DIndexFrom1DIndex(b, textureSize(a, 0)), 0)

int main() {
  int cellId = texelFetchBuffer(cellIdsBuffer, gl_VertexID);
}
1 Like