Enhance the quality of the bump mapping technique in three.js

I am facing a challenge with a model that has a flat surface where I am trying to apply a bump map texture to add some text. The code snippet I am using for this task is as follows:

loadedMesh.material.bumpMap = new THREE.Texture(canvas);
loadedMesh.material.bumpScale = 1;
loadedMesh.material.bumpMap.wrapS = loadedMesh.material.bumpMap.wrapT = THREE.ClampToEdgeWrapping;
loadedMesh.material.bumpMap.minFilter = THREE.LinearFilter;
loadedMesh.material.bumpMap.needsUpdate = true;
loadedMesh.material.needsUpdate = true;

The scene includes the model and four directional lights with shadows enabled. While the bump map effect works, I am disappointed by the low quality of the output. Despite using a bump map size of 2048x2048, the expected high-quality result is not achieved. Here are some example images:

https://i.sstatic.net/lf8wj.png

https://i.sstatic.net/nDkHB.png

https://i.sstatic.net/fCdHB.png

As seen in the images, the texture appears pixelated, and even increasing the size does not significantly enhance the quality. Moreover, the quality seems to vary when the angle of incidence from the directional lights changes (e.g., through rotation of the model).

Given that the bump map is only a black and white image, would adding anti-aliasing improve the overall quality? I have read suggestions about increasing the number of faces of the model to enhance the bump map detail (not displacement map); is this approach recommended?

Answer №1

Consider utilizing a texture map instead of a bump map.

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

Manipulate and structure personalized date string using Moment.js

Trying to retrieve the month and year from a customized date string Wed Dec 24 00:00:00 -0800 2014 with Moment.js. Came across this previous solution: How to parse given date string using moment.js? however, the accepted answer is causing an error. Expec ...

Facing Problem with Angular PUT Request - "Missing required request body"

I'm encountering a problem with my Angular application when attempting to send a PUT request to the server. The error message I receive reads "Required request body is missing." Below is a snippet of the code that is relevant: Within the Child Compo ...

Instructions on how to navigate back one page to determine which page initiated the action

I am looking for a solution to implement a back button that takes me back one page while caching it. Currently, I am using the following code: <a id="go-back" href="javascript:history.go(-1)" type="button" class="btn btn-danger">Back</a> Howe ...

Retrieving the selected value from a Bootstrap dropdown using JavaScript when there are multiple dropdowns present

I have created multiple rows in javascript that are being rendered to the DOM from a Firestore collection. Each row contains a Bootstrap dropdown with the same select options (".a" elements). The id attribute of each row div is dynamically set based on the ...

Diverse behaviors exhibited by an array of promises

I've developed a function that generates an array of promises: async addDefect(payload) { this.newDefect.setNote(payload.note); this.newDefect.setPriority(payload.priority); const name = await this.storage.get(StorageKeys.NAME); ...

Graph Navigator - Time Series

Can anyone assist me with displaying dates on xAxes using Chart.js? I attempted to do it with 2 dates, but unfortunately nothing is being displayed. It seems like there may be an issue with the labels or date format that I used. <canvas id="graph"> ...

Use Javascript to conceal a div element if there are no links present

I am working on a website using ModX CMS and I am attempting to hide or remove a div element when it does not contain any anchor tags. How can I achieve this? I have already attempted the following code without success: jQuery(function($) { if ($(".pages ...

Retrieve information from an Express server using SweetAlert

Hi, I have created a web server using Node.js and Express. When I send a request to ip/test, it returns the text 'test' using res.send('test'). I am trying to fetch this text using sweetalert but I always encounter errors :( Here is t ...

What is the process for comprehending an event that is not triggered by the task queue within the event loop specifications?

According to the guidelines: Various events are triggered through tasks apart from just the task queue. I am curious to understand what exactly is meant by "various" and the specific types of tasks being referred to here? ...

Issues with Angular-UI-router resolve functionality not functioning as expected

I have encountered a problem in my Angular-ui-router where the use of resolve is causing my site to send out multiple get requests per second without loading the view. My stack consists of the full MEAN-stack. The views are generated using inline template ...

Understanding ReactJs component syntax: Exploring the nuances and distinctions

Currently diving into the world of Reactjs and working on creating a basic component. I'm puzzled about why this particular syntax for a component: import React, { Component } from 'react'; export default class AboutPage extends Component { ...

What are the steps for integrating an external API into a React project?

Apologies for any potential repetition, as this question may be commonly asked. I am currently working with React, Express, CORS, node, and postgres databases. My objective is to utilize the following API to retrieve real-time prices for metals: https://me ...

Disable the edit button in Magento and allow editing only when clicking on the textfield

Here is the code snippet we are using for updating prices. It automatically updates the price text field with the following code: Phtml <input class="ama1" type = "text" id = "price_<?php echo $products->getId(); ?>" onkeydown="validateNumber ...

JavaScript bug with URL encoding in Internet Explorer 11

I am encountering an issue with Internet Explorer 11 (IE 11) when attempting to call a JavaScript URL function. The problem lies with the URL parameter value, which is in Unicode format but the result displays as ????? instead of Unicode characters. Belo ...

Sending the complete form action URL without any interruption

Is there a way to send this entire string all at once? It seems to work when I use a URL shortener like bit.ly, but it breaks when I leave it as is. Any suggestions? <script> function go(){ window.frames[0].document.body.innerHTML='<f ...

Failure to achieve success with jQuery Ajax

success in my AJAX call is not triggering at all, leaving me puzzled as to why. None of the alerts specified in the AJAX file are appearing. The form: <form onsubmit="check_reg();return false;" method="post" name="reg_form" id="reg"> <label ...

Exploring the functionality of className using materialUI

Attempting to test whether my component has a specific class is proving challenging. This difficulty stems from the fact that the class is generated using MaterialUI. For instance, I am looking for a class named spinningIconCenter, but in reality, it appea ...

Combine the promises from multiple Promise.all calls by chaining them together using the array returned from

I've embarked on creating my very own blogging platform using node. The code I currently have in place performs the following tasks: It scans through various folders to read `.md` files, where each folder corresponds to a top-level category. The dat ...

Ensure that the input field only accepts numerical values

Can anyone help me with an issue I'm facing in my plunker? I have an input text field that I want to accept only numbers. Despite trying normal AngularJS form validation, the event is not firing up. Has anyone encountered a similar problem or can prov ...

Getting field values from Firestore in a React application

Within my firestore document, I have three fields that store boolean values critical for subsequent processing. To access these boolean values in my program, I need to figure out how to read the fields of a document. This process should be straightforward, ...