Creating a dazzling illuminated Icoshadron using Three.js

I set out to bring the brilliance of a brightly glowing Icoshadron Geometry to life in Three.js.

No matter what code I tried, I couldn't achieve the desired glow effect. So, I took the approach of placing the Icoshadron Geometry into a Group with a MeshStandardMaterial featuring opacity of 0.5, and then added 27 lights to it using a for loop. Here's the code snippet I used-

import { AdditiveBlending, FrontSide, MeshStandardMaterial } from "three";
import { ShaderMaterial } from "three";
import { Group } from "three";

...

container.append(renderer.domElement);

The end result was visually pleasing, but unfortunately, it ran at an abysmal speed. As I wanted to rotate the Icoshadron, I attempted to animate the Group, which barely reached a frame rate of 1fps. It's clear that the excessive lights are causing the slowdown, so my dilemma now is how do I achieve the desired glowing effect (similar to infinity stones, but brighter and larger) without compromising performance?

Answer №1

Give it a try with a bloom effect similar to the one showcased in the official example linked here: https://threejs.org/examples/webgl_postprocessing_unreal_bloom

The concept involves utilizing post processing through the EffectComposer. The series of passes (effect stack) should include instances of RenderPass, UnrealBloomPass, and OutputPass.

  • RenderPass captures or stores the scene in a render target.
  • UnrealBloomPass adds the bloom or glow effect.
  • OutputPass handles tone mapping and color space conversion.

This method will perform more efficiently than relying on a large number of lights (which may not achieve a realistic glow effect).

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

Guide on navigating to a different page following a successful Google Sign In within React18

I'm facing an issue with redirection after signing in with Google on my React 18 project. Despite successfully logging in, the page does not redirect as expected. Below is a snippet of my Login.jsx file where the Google login functionality is implemen ...

I'm puzzled, can anyone provide clarification on the concept of xml?

Recently, Sheshank S. provided me with a solution to my question, but I failed to grasp its meaning. Can someone please explain it to me? Despite looking through various tutorials on websites and videos, none of them have been able to clarify what this cod ...

Setting values and options in Material UI AutoComplete and then assigning the selected value to an object when onChange event occurs - how can it be

I am working on a project where I have a brand object with the field cat_id. When the page loads, categories are loaded into an autocomplete select. My goal now is to set the value of category id as the value for a category option in the autocomplete, an ...

Real-time data texture updates in Three.js using JavaScript

Today has been a challenging day as I try to solve what should be a simple problem. I'm working on building an audio visualizer and my goal is to store the audio data array in a texture that updates every frame. Despite following three.js documentatio ...

Regular Expression in JavaScript to match a specific array increment while disregarding any strings and separating each increment

My input fields have name attributes structured as follows: carousels['components'][0][0][title] carousels['components'][0][1][title] carousels['components'][0][2][title] carousels['components'][1][0][title] carous ...

Unable to install react-dom/test-utils using npm

I recently included two libraries in my package.json "devDependencies": { ... "react-dom/test-utils": "*", "react-test-renderer/shallow": "*" }, These were recommended by the React documentation to align with version 16 of the React ecosy ...

The accumulation of input using setInterval is not effective

I need some help with my code. Please take a look at this link here. I want the input to count up from zero and hide when I click the "change" button. But when I show the input again, I want its value to reset back to zero. Can anyone guide me on how to ...

Error encountered with select2 when using a remote JSONP dataset

When attempting to query the Geonames data using select2, everything seems to work fine with formatting the results. However, an error occurs once the results are populated, which I suspect is preventing the formatSelection function from running properly. ...

Count of jSon objects

After receiving a string st from a web service, I convert it into an object. How can I determine the number of arrays inside this object? In this particular case, there are 2 arrays. var st = "{[{"Name": "fake", "Address": "add"]},[{"Name": "fake", "Addre ...

Having trouble with my PHP/AJAX code - the Ajax request to PHP isn't functioning correctly, causing the rows not

I am currently working on a PHP chat application and running into some issues with utilizing AJAX to fetch data from a MySQL database and display it within a designated div. Below are the snippets of my code: HTML <div id="chatbox"> <div cla ...

When attempting to use Ajax, the operation fails; however, if I directly access the URL,

When using firebug, I attempted to make the following AJAX call: var rootUrl = 'http://172.24.105.22:8080/geoserver/Chennai_Sub/ows'; var defaultParameters = { service: 'WFS', version: '1.0.0', request: 'Get ...

Having trouble retrieving the chosen option from the radio button list

I am struggling with a radiobutton list <asp:RadioButtonList CssClass="radioLable" ID="rbListPointsCat" runat="server" RepeatDirection="Horizontal" AutoPostBack="true" OnSelectedIndexChanged="rbListPointsCat_SelectedIndexChanged" ...

Could not add metric widgets in Ambari

Having trouble adding metrics widgets for a component I created in Ambari. Any help would be appreciated... Running Ambari version 2.5.2 and encountered the following errors: On opening the component page: app.js:66933 Uncaught TypeError: Cannot read p ...

customizing highcharts title within a popup window

Is there a way to dynamically set the title of a Highcharts chart from an element? Check out my code snippet below: $(function () { var chart; $('#second-chart').highcharts({ chart: { type: 'bar' }, subtitle: { ...

Flowering and radiance effects

While putting the final touches on my particle system (found here), I was hoping to incorporate some captivating visual effects. However, my search for tutorials on creating bloom and glow effects for particles came up empty. I am aiming to achieve a sim ...

How to fetch all elements with a particular classname in React

I am looking to retrieve all elements with the classname selected from this particular component function ChooseElements() { const listItems = elementObjects.map((object) => <ListItem key={object.id.toString()} value={object.Element} /> ...

Reorganizing Objects in an Array Using NodeJS

Having the following dataset - an array of objects consisting of sender IDs and messages [ { "sender": "1000000000", "message": message 1" }, { "sender": "1000000000&quo ...

Having trouble accessing static files in my express application

After encountering issues using the fonts folder files in one of my controller files, I attempted to reference them from within the public folder. Despite referencing code from StackOverflow and adding it to my app.js file, I was unable to make it work suc ...

Is the data missing in the initial request?

After creating a function that returns an object with mapped values, I encountered an issue. The second map is undefined the first time it runs, causing my vue.js component to display data from the first map but not the cutOff value. Strangely, when I re ...

Please guide me on using jQuery to identify and color a specific word within a text

Within the .content section, I am analyzing multiple HTML paragraphs of text. If any paragraph includes the word "Hello" in any case variation, I will only highlight that specific word in blue. Similarly, if a paragraph contains the word "Goodbye," it wi ...