WebGL - Is gl.useProgram () an expensive call?

I am wondering if it is worth using this API method to load a shader program or not calling? I am considering making this call for an object in my 3D scene.

gl.useProgram(shaderProgram);

thank

+4
source share
1 answer
  • this says it's better to use glUseProgramthan for glAttachShader+glLinkProgram
  • this says shader change is always difficult, but the glUseProgramleast difficult
  • this says it is usually effective
  • it says that moderate and careful use will not become a bottleneck
  • .

, : . - , - , - .

useProgram . -, , linkProgram compileShader.

, .

+7

Source: https://habr.com/ru/post/1542751/


All Articles