Warning: Rendering issue detected after importing THREE.js OBJ model with [.CommandBufferContext]. The render count or primcount is currently at 0

My Google Chrome browser is flooded with countless errors:

[.CommandBufferContext]RENDER WARNING: Render count or primcount is 0.

These errors occur when using OBJ and MTL files exported from Blender, specifically with the OBJMTLLoader.js as the loader after upgrading to version R73.

Has anyone else encountered this issue?

Answer №1

If you encounter an error where the low-level render call is drawing zero vertices/faces, it could be due to having one or more meshes with polygons that have no faces or vertices. This error accumulates on each draw call.

The issue may lie in your model itself or during the export/import process. If it's related to the model, here is a general approach to identify problematic areas. It is not recommended to use OBJMTLLoader with ThreeJS and Blender since ThreeJS comes with a Blender plugin for exporting that is more reliable.

checkMesh = function(mesh, child_index) {
  if (
    mesh.geometry.faces.length > 0 && 
    mesh.geometry.vertices.length > 0
  ) {
    // perform operations on the valid mesh

    for (var i = 0; i < mesh.children.length; i++)
      if (!checkMesh(mesh.children[i], i))
        i--; // move back as child was removed

    return true;
  } else {
    if (mesh.parent != null)
      mesh.parent.children.splice(child_index, 1);

    console.log(mesh.name + " has zero faces and/or vertices so it is removed.");
    mesh = null;

    return false;
  }
}

Answer №2

Without being able to see your code, it's tough to pinpoint the issue, but I would recommend giving JSON export and import a try. In the three.js source, navigate to utils/exporters/blender and install the JSON exporter (refer to readme.md for instructions). After that, export your model to JSON while carefully selecting exporting options such as geometry type, UVs, and textures. Then, you can bring in your model using the following code snippet:

var loader = new THREE.JSONLoader();
loader.load("model.json", function(geometry, material) {
    var m = new THREE.MultiMaterial(material);
    var o = new THREE.Mesh(geometry, m);
    scene.add(o);
});

I haven't done a direct comparison with OBJ/MTL, but based on my experience, JSON loading is significantly faster than Collada.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

I am facing an issue with the DOM object in my ejs template when used under the script tag. How can I resolve this problem?

<%-include ("partials/header.ejs") %> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <header> <!--NAVIGATION BAR--> <img class="calender-pic" src="images/calendar.png ...

Undefined output in Typescript recursion function

When working with the recursion function in TypeScript/JavaScript, I have encountered a tricky situation involving the 'this' context. Even though I attempted to use arrow functions to avoid context changes, I found that it still did not work as ...

Changing the i18n locale in the URL and navigating through nested routes

Seeking assistance to navigate through the complexities of Vue Router configurations! I've dedicated several days to integrating various resources, but have yet to achieve successful internalization implementation with URL routes in my unique setup. ...

Is adding ng-click in a template counterproductive to the concept of MV* architecture?

When working with AngularJS, you may come across instances where the ng-click handler is directly connected to an HTML element like <a> or <button>. Take for example the snippet below (borrowed from an Angular homepage sample), where the click ...

Customize your popover content with Bootstrap settings

I've been on a quest to dynamically update the content of a Bootstrap popover using JavaScript, but unfortunately, the methods I've tried so far haven't worked out as expected : <!--object with the popover--> <input id="popoverlist ...

Display an Array from a PHP File in HTML Using jQuery

Here is an example of my PHP script used to retrieve and display JSON data: $get_chat = "SELECT * FROM chat WHERE u_id1='$u_id' && u_id2=2 ORDER BY data DESC"; $run_chat = $conn->query($get_chat); if ($run_chat->num_rows > 0) { ...

When executing a function, the previous React state continues to linger

Why is the updateUser() function only updating the last user instead of all users despite using useCallback and including users as a dependency? The expected output after clicking the update button should be: {"id":1,"name":"John& ...

"JQPlot line chart fails to extend all the way to the edge of the

My jqPlot line plot looks great, but it's not extending all the way to the edge of the containing div, which is crucial for my application. I've tried adjusting all the options related to margins and padding, but there's still a noticeable g ...

Connecting to deeply nested attributes within an object using specified criteria

I apologize if the title of my query is not very descriptive, I couldn't come up with a better one. Please feel free to suggest improvements. I am currently working on developing a reusable "property grid" in Angular. My goal is to create a grid wher ...

Switch out the image source and add attributions until the AJAX call is complete

<div id="fbAdsIconDiv" class="social_icon"> <img src="~/Content/images/fbAdsAddOn_1.png" onclick="toggleImage(this)" id="fbAdsAddOn" data-toggle="tooltip" title="click to enable" class="confirmBox f ...

the primary way JavaScript defines its "this" binding

As I delve into a book, it mentions that this within a function can be established in four different ways: default, implicit, explicit binding, and through the use of the new syntax. Regardless of the method, this is determined at the time of the function ...

Ways to enhance composability by utilizing React higher-order functions

Referring to the section titled "Convention: Maximizing Composability" in the React tutorial (link: https://reactjs.org/docs/higher-order-components.html#convention-maximizing-composability): // connect is a function that returns another function const enh ...

What are the best ways to establish communication between two components in React?

Recently delving into the world of React, I've hit a roadblock trying to establish communication between two components for data exchange. Take for instance, my attempt at creating a calculator with component buttons carrying values and an input field ...

When accessing the defaultValue property of a select element, it will result in

Here is a typical HTML dropdown menu: <select name="email" id="email"> <option value="2" selected="selected">Before redirecting to PayPal</option> <option value="1">After payment is successful</option> <opti ...

A method for calculating the product of two selected numbers and then adding them together

I am currently working on a form that includes two select options; one for logo design and another for letterhead design. Users should be able to choose the quantity of each design, or both if they wish. For example, a user could select 2 logo designs and ...

Updating the value of an Angular select on change is not being reflected

If the select element is changed, the value should be set to something different from what was selected. There's a feature in place that only allows 4 item types to be selected at a time; if more than 4 are chosen, the value reverts back to its origin ...

Vue-Routes is experiencing issues due to a template within one of the routes referencing the same ID

I encountered an issue while developing a Vue application with Vue-routes. One of the routes contains a function designed to modify the background colors of two divs based on the values entered in the respective input fields. However, I am facing two probl ...

Is there a way to eliminate get variables and filename from a URL using JavaScript or jQuery?

I've been researching this issue, but unfortunately, I haven't been able to find a definitive solution for my specific needs. Let's say I have a URL like... How can I extract this URL and remove the "index.php?search=my+search" part so that ...

Establish a connection to an SSH server using Node.js code, specifying the SSH key and server hostname for

Having VPN access allows me to SSH into the server using the following command in the terminal: ssh qa-trinath01.my-qa This command works perfectly fine when executed from the terminal. However, when attempting to connect via Node.js, I encounter issues ...

Instancing - The Magic of Transparent 3D Shapes

I've been experimenting with creating instances of tree meshes in react-three-fiber and threejs, here is my progress so far: https://codesandbox.io/s/silly-sunset-74wmt?file=/src/App.js When viewed from one angle, the trees appear transparent, showin ...