Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Three.js- RENDER WARNING: Render count or primcount is 0

Using three.js

On my home PC with Nvidia GNU, I get about 105 of these in my browser console:

/#/home:1 [.CommandBufferContext]RENDER WARNING: Render count or primcount is 0

But on my intel GNU laptop, I do not. Is this a disagreement with the GNU driver? Or is this something I can fix?

var animationId;
var CAMERA_POSITION = 5000;
function runClouds() {
  var speed = 0.8;
  cloudsContainer.style.display = 'block';
  animationId = requestAnimationFrame( runClouds );

  camera.position.y = -75;

  if (camera.position.z <= 0) {
    window.cancelAnimationFrame(animationId);
    camera.position.z = CAMERA_POSITION;
    cloudsContainer.style.display = 'none';
    return true;
  } else if (camera.position.z <= 400) {
    speed = 0.1;
  } else if (camera.position.z <= 900) {
    speed = 0.3;
  } else if (camera.position.z <= 2000) {
    speed = 0.7;
  }

  camera.position.z -= 100 * speed;
  renderer.render( scene, camera );
}
like image 435
dman Avatar asked Jun 20 '16 03:06

dman


1 Answers

This warning is thrown when Three.js is trying to render an object that does not exist yet.

Take, for example, a program here you draw a line.

If you add the line to the scene before you add any points, this warning will appear UNTIL the first point is added and a line can be seen.

If you get this, either something is waiting to be added to the scene, or in your case, since you say you get about 105 every time, I assume that an object is added to the scene then due to asychronicity, is actually made in another function after the fact.

Since it is a warning, there isn't much to be afraid about.

like image 145
Rush2112 Avatar answered Oct 07 '22 17:10

Rush2112