Three.js - Mesh is limited to receiving a maximum of 3 lights at a time

I'm encountering an issue related to lighting in three.js

Within my scene, I have a mesh called A (using a MeshLambertMaterial) that is receiving light from three sources: one DirectionalLight and two PointLights. However, for some reason, mesh A stops receiving light from one of the PointLights even though they are all set up correctly. Interestingly, other meshes in the scene are still receiving light from the same PointLights.

I've inspected various properties in the renderer and materials but haven't been able to find a solution to this problem.

Why could it be that mesh A isn't receiving light anymore?

Answer №1

Following thorough examination, I have successfully pinpointed the issue.

It has come to my attention that every time a light is added, the material needsUpdate flag must be set to true:

material.needsUpdate = true;

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

Unable to utilize the instance once it has been created. An error is encountered stating "User.find is not a function" when attempting to retrieve documents

Currently, I am utilizing nodejs in conjunction with the expressjs framework and MongoDB. Within mongoose, an instance has been created using var User = new userModel(data). Below is my model located in user.js: const userModel = mongoose.model("User", ...

Ways to Close a Modal in Ionic 5

I have a scenario where I need to open a modal, perform an asynchronous action, and then automatically dismiss the modal once the action is completed. Specifically, I want to use the fetchData function to handle the async task. @Component({ }) export cla ...

Is there a way to simulate a right-click using node.js selenium-webdriver?

Currently, I am utilizing selenium-webdriver for Node.js. I am trying to simulate a right-click using this driver. However, I have searched through the official documentation and cannot find any information on how to do this. Can anyone provide guidance o ...

Remove JSON data in JavaScript

"[ "{\"StudentID\":5042,\"Status\":\"Joshua picked up from school [0] at 12:41PM and reached home [0] at 12:43PM\",\"Date\":\"2013-11-20\"}", "{\"StudentID\":5042,\"Status\":\" ...

Comparing Angular extend to $provide.decorator: A breakdown

I find myself in a state of confusion. Can you please provide some clarity on the distinction between angular.extend() and $provide.decorator? When and why would one use the latter option? Does decorator serve a different purpose compared to extend? Desp ...

Simple integration of JSP, JSON, and AJAX

I need help testing a simple login functionality using AJAX. Here's the code snippet: <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Login Test Page</title> <script src="../js/j ...

Implementing JSON web tokens on the client side using Node.jsHere are the steps to implement

I have been developing a Node.js express application with JWT for authentication to secure access to my admin page. While testing my routes using Postman, everything works smoothly on the server side. However, I am facing a challenge on the client side in ...

Uncovering the secrets: accessing hidden folder files in react-native-fs

I am encountering a problem when trying to access files from a hidden folder /WhatsApp/Media/.Statuses in react-native-fs. Despite granting the READ_EXTERNAL_STORAGE permission on Android, I only receive an empty array when attempting to access it using th ...

modify handler for selecting input item in react JS

I am working on mapping option select data from an API, but I am having trouble changing the value of the select input. I have tried using a handler for change, but the input value remains fixed. Can someone please help me identify what error might be pres ...

What is the process for enabling audio to start downloading immediately after the user clicks a button on the same webpage?

Can you please set up a function so that when users click on the "Download" button, the audio file automatically downloads? Product Details This beat is a melodic, bouncy, and hard track inspired by Lil Mosey. It is priced between $15-$75, with a master ...

Track the number of function calls using closure and function attribute

Recently, I encountered an issue while trying to track how many times a particular JavaScript function got called. The approach of adding an attribute to the function worked perfectly fine for keeping count, but surprisingly, I faced difficulty when attemp ...

How should I proceed if a TypeScript definition file that I am relying on is lacking a specific definition?

I have encountered an issue while using the React type definitions for my project. The focus method is missing on elements in the array returned by the refs property, which prevents me from getting a specific example to work. The compiler error states: pro ...

Discover the process of generating streams from strings in Node.Js

I am currently working with the library ya-csv, which requires either a file or stream input. However, I only have a string available. Is there a way to convert this string into a stream in Node.js? ...

Transfer a value to the ng2 smart table plugin extension

Upon reviewing the document and source code related to pagination implementation in the (advanced-example-server.component.ts), I discovered that the ServerDataSource being used only supported pagination through HTTP GET (_sort, _limit, _page, etc paramete ...

Steps to store radio button selections in local storage

I have a quiz that includes radio buttons, and I need to save the answers on my local storage. However, I am currently stuck and unsure of what else to do. I am learning, so please don't be too hard on me. Thank you! Here is the code I have written s ...

Issue with Material UI components failing to return an HTMLElement reference

When working with certain libraries that require the ref prop to return an HTMLElement, I have noticed that 99% of MUI components do not fulfill this requirement. What am I missing? How can I obtain a reference to the root element of a component? import R ...

Tips for enhancing the speed of drawing circles in mouse movement using JS and CANVAS

My current script allows me to draw a circle during mousemove, but it's not as fast as I'd like. Before drawing the circle, I gather the color pixel during mousemove in order to draw a circle on the canvas with the picked color. I came across ...

Unable to navigate using ui-sref or $state.go in initial directive execution

There seems to be an issue with my ng-repeat on a directive where I'm passing in 3 pieces of information. The directive includes a button that is supposed to pass that information on to another view using params like this: ui-sref='profiles.sho ...

Retry request with an AngularJS interceptor

Currently, I am in the process of developing an Angular application and encountering some challenges while implementing a retry mechanism for the latest request within an HTTP interceptor. The interceptor is primarily used for authentication validation on ...

Dynamic hovering over isotopic elements

I'm looking to create a webpage where images are arranged dynamically like on this website: . I also want each image to have a hover effect displaying specific information about the image. After some research, I came across a JavaScript library calle ...