Dynamic Mesh using VBO

Eyeshot 2021 features a native VBO mesh entity called FastMesh.

In some cases, you may want to update the geometry of a Mesh entity very often (even at each frame).

Suppose we have a color Mesh whose vertices positions and colors change at each frame: after each data update, the Entity.RegenMode is set to RegenAndCompile and the ViewportLayout.Entities.Regen() needs to be called.

The Eyeshot Mesh class, that use static graphics data, is not designed to support this kind of "dynamic" entities and can give bad performances.

To improve processing speed:

  1. Set:
    Mesh.LightWeight = true;
    to avoid the computation of the mesh edges at each regeneration. 

  2. Use of a Mesh-derived class that uses Vertex Buffer Object (VBO), the best approach to draw a Mesh entity that changes so frequently, is shown in the attached "DynamicVBO Mesh - Eyeshot 12.zip" project.

Furthermore, it is possible to create a dynamic mesh with texture coordinates that change dynamically, check the VBO_WithTexture() method in the attached project.

Previous versions of this article: Eyeshot 9, Eyeshot 7

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


1 comment
  • Fix for missing colors in Rendered display mode:

    protected override void SetShader(DrawParams data)
       ShaderParameters shaderParams = data.ShaderParams;

       bool prevTexture2D = shaderParams.Texture2D;
       multiColorType prevMultiColor = shaderParams.MulticolorMode;
       bool prevWithNormals = shaderParams.withNormals;

       if (data.ForceGray == false & data.Selected == false)
          shaderParams.Texture2D = false;
          shaderParams.MulticolorMode = multiColorType.On;
          shaderParams.withNormals = true;


       if (data.ForceGray == false & data.Selected == false)
          shaderParams.Texture2D = prevTexture2D;
          shaderParams.MulticolorMode = prevMultiColor;
          shaderParams.withNormals = prevWithNormals;


Please sign in to leave a comment.