3

Firstly it is about what I need:

I want to draw nodes and their link edges in a web page (the number of edges is larger than nodes, for example, 10,000 nodes and 100,000 links). The following is a demo:

enter image description here

I use WebGL and after optimizations in other aspects, It can draw in a relatively short time, but there are still some problems:

enter image description here

As you can see, most time is used by Float32Array, but this is the browser's own API.

So what I can do is reducing the number of elements for Float32Array.

Now,the content of elements for Float32Array(The pixi.js I use is from pixi.js and I changed something):

enter image description here

The color data is redundant. (Note: the coordinate data is basically not shared)

I tried to use a color Array and index but I found that uncertain sized arrays are not accepted by the shader.

I also tried to combine several values(rbga)into one value, but it can cause losing accuracy or Cross-border

So I don't know what I can do now.

I wonder if you know how to handle the redundant color data under this situation or if you have other ideas about how to optimize the WebGL, Thank you very much.

聂小涛
  • 503
  • 3
  • 16

0 Answers0