70000445 Support of webGL in web library

Article 70000445
Type Wish
Product WebJS
Version 7003
Date Added 5/15/2015
Fixed (5/22/2015)
Submitted by VectorDraw Team


Support of webGL in web library


In version 7004.1.0, WebGL was utilized by the vdraw web library in order to offer faster render.
In order to use it call the EnableWebGL() function within the vdrawObject of the library.

EnableWebGL(bool enable)

The function takes the following parameters
  • enable: If true enables WebGL, if false disables it.

When using WebGL it is essential to use the API as effectively as possible. Towards this philosophy the web library draws the internal objects in blocks. The size of this block can be defined by the SetBlockSize() function. The default value is 100. The higher the value, the faster they will be rendered. Keep in mind that after a certain value, speed improvement is insignificant. Also certain devices may fail after a certain block size.

SetBlockSize(int blockSize)

The function takes the following parameters
  • blockSize: The number of triangles to be rendered with each draw.

Due to the nature of WebGL there are certain restrictions.
  • Supported objects: vdPolyface, vd3DFace vdCurves with Thickness. All other object types are ignored.
  • No selection functionality (e.g Osnaps) during the WebGL render.
  • No image materials are supported yet.
  • No Wire mode is supported.
In general you should keep in mind that this mode is designed for fast display of 3D models, without the editing capabilities of the web library.

Send comments on this topic.