Discrepancy in Metalness Between GLTF Scene and THREE.JS Editor's Environment Available at https://threejs.org/editor/

I have encountered an issue with a gltf file. When I import it into the Three.js editor (), everything appears as expected when adding an environment map.

However, when I import the same gltf file into my project scene, I notice a discrepancy in the result, even though I am using the exact same HDRI image. The metalness seems overly shiny in this case.

Can anyone provide insight on what might be causing this difference? Thank you.

renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1;
renderer.outputEncoding = THREE.sRGBEncoding;

new RGBELoader()
    .load( 'royal_esplanade_1k.hdr', function ( texture ) {

        texture.mapping = THREE.EquirectangularReflectionMapping; 
        scene.environment = texture;

    } );

loader.load(
    './gltf/canette.glb',

    // callback function when resource is loaded
    function ( gltf ) {

        obj = gltf.scene;

        mixer = new THREE.AnimationMixer( gltf.scene );
        action = mixer.clipAction( gltf.animations[ 0 ] );

        // add object to scene
        scene.add( obj );
    }
);

EDIT:

Here is a live demo. Here is the gltf model.

Answer №1

We regret to inform you that the code snippet you are currently using does not align with your current version of three.js. To ensure compatibility, it is recommended to upgrade to at least r131 or preferably the latest version r141. As of now, you are utilizing r129.

If your three.js version is below r131, it is necessary to employ PMREMGenerator for preparing the environment map applied to PBR materials. However, starting from r131, this process is handled by the engine itself, eliminating the need for manual intervention with PMREMGenerator.

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

How should one properly utilize the app and pages directories in a next.js project?

For my current next.js 13 project, I have decided to utilize the /pages directory instead of /app. Nonetheless, I recently included the app directory specifically for its new features related to dynamic sitemap rendering. Do you think this approach is app ...

Step-by-step guide on how to load an Ext JS tab after clicking on it

I have an Ext JS code block that creates 4 tabs with Javascript: var tabs; $(document).ready( function() { fullscreen: true, renderTo: 'tabs1', width:900, activeTab: 0, frame:true, ...

Using AngularJS and JavaScript, set the Submit button to be enabled only when the email input is valid and a value is selected in

I'm trying to create a form that includes an email input field and a drop-down list sourced from a database array. Initially, the submit button is disabled when the form loads. My goal is to figure out how to activate the submit button only when the ...

The complete height of the website is concealed by the mobile toolbar/menu

I encountered a perplexing issue regarding the responsive resizing of a website on mobile devices. The problem arises when the full height extends over the toolbar/menu, unless the user manually hides the toolbar. Is there a way to dynamically resize the ...

Using JavaScript to place a particular tag at a designated position

I have a string that looks like this: var txtstr='<p>Text 1</p><p>&nbsp;</p><p>Text &nbsp;2</p><p>&nbsp;</p><p>Text 3&nbsp;</p>'; I have an <img src=..../> tag and ...

Script tags that are included within the element Vue vm is bound to can result in a template error

Here is the Laravel layout template that I am currently working with: <html lang="en"> <head> <meta name="csrf-token" content="{{ csrf_token() }}"> <link href="{{ URL::asset('css/libs.css') }}" rel="stylesheet"> ...

Exploring the dynamic duo of MongoDB and GridFS

We currently manage a large-scale project that accommodates thousands of users daily. Our database system is MySQL, but we are considering transitioning to MongoDB along with GridFS. Is it feasible to utilize MongoDB and GridFS for projects on this scale? ...

Modifying a variable within the return statement in a React Native component

I am relatively new to React and React-native and I am facing challenges in understanding how to update a variable within the return method. Here is my current code snippet: import React, { Component } from "react"; import { View, StyleSheet, Platform, T ...

Show picture in web browser without the file extension

Is there a way to display an image in the browser without the file extension, similar to how Google and Unsplash do it? For example: Or like this: ...

Node-RED experiences crashes while attempting to make HTTP requests to access a web service

I'm currently facing a challenge in creating a node that can make web service calls. The tools I'm using are: Node-RED version: v0.17.5 Node.js version: v8.4.0 An exception is being thrown, and here's the error message: node-red_1 ...

Filter an array in React based on the value selected in an HTML select

I'm having trouble filtering my array based on a select value and getting the desired result. Essentially, I want to be able to choose an option from a select dropdown and have the data re-render with content related to that option. However, the data ...

Utilizing AngularJS, combining ng-repeat and filter functions that can be triggered directly from the controller

I have a burning question to ask. Here's the HTML code snippet: ng-repeat="item in obj.Items | filter:someFilter" And here's the JS code snippet: $scope.someFilter = function (item) { ... } It all works perfectly fine. However, I am faced wi ...

Unable to perform a POST request and send JSON data using AJAX with jQuery at the

It seems like there may be a server issue causing this problem, and unfortunately, I don't have access to our server to troubleshoot. I was hoping that someone else might have a solution or could help me understand the root cause of the issue. The is ...

Show a collection of elements containing attributes in JSX

I have a React component where I am displaying data from an array called pkgData: <div className="mainApp"> <div className="pkgsList"> {pkgData.map((p) => <h3 key={p.name}>{p.name}</h3> ...

Consecutive AJAX requests triggered by previous response

While there are numerous resources available regarding making synchronous AJAX calls using deferred promises, my specific issue presents a unique challenge. The process I am attempting to facilitate is as follows: Initiate an AJAX call. If the response i ...

Ensure that all MySQL queries within a for loop have completed before executing the rest of a function in NodeJS

I have been attempting to execute a query in order to retrieve data from one table, then utilize that array of data to fetch information from another table before formatting and returning it as JSON. Despite my efforts, I am struggling to understand how t ...

"Encountering issues with autocomplete feature loading empty data when attempting to populate several fields simultaneously

Encountering issues with autocomplete when trying to select a value and fill in multiple fields. Seeing small blank lines on autocomplete and search stops while typing. Suspecting the problem lies within .data("ui-autocomplete")._renderItem or ...

Appending a row to a table will not trigger events in Select2

Despite several attempts, I can't seem to get the select2:select event working on dynamically added rows in a table using select2. The event only works on the original row. Unfortunately, I don't have any additional details about this issue. COD ...

Implementing Axios interceptor is a common practice in Vue.js applications to central

Hello everyone, I'm facing a problem with the interceptor in VueJS. I can't seem to figure out where the issue lies and it's driving me crazy... I've gone through various tutorials and read numerous posts on stackoverflow, but everythi ...

The LoadingManager is showing an incorrect number of items to be loaded

I've encountered an issue with the LoadingManager while attempting to preload my models and textures. manager = new THREE.LoadingManager(); manager.onProgress = function ( item, loaded, total ) { console.log("loaded: " + loaded + " total: " + tot ...