V
V
Vitaly Stolyarov2017-09-19 22:38:23
Canvas
Vitaly Stolyarov, 2017-09-19 22:38:23

Why does a large Canvas with a WebGL context take up a lot of memory?

Example:

var c = document.createElement('canvas');
  var ctx = c.getContext('webgl');
  c.width = c.height = 4096;

I just got the context and resized the canvas, no more actions were taken, and the GPU memory (with canvas sides 4096) takes almost 400 mb. Why is that? Where is the memory allocated?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Stolyarov, 2017-09-20
@Ni55aN

WebGL has a depth buffer, anti-aliasing, and an alpha channel enabled by default, so it eats up a lot of memory.
Source

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question