Shadows in Three.js cascading onto clear surfaces with a low-resolution twist

Here's the problem I'm facing:

I want to remove the shadows on the text but changing the shadowMap resolution doesn't seem to have any effect.

This is the code snippet responsible for creating the mesh:

var materialArray_Flying = [
        new THREE.MeshPhongMaterial( { color: 0xff00ff, ambient: 0xff00ff } ), 
        new THREE.MeshPhongMaterial( { color: 0x008888, ambient: 0x008888 } )]; 

var textGeom_Flying = new THREE.TextGeometry( "{Flying}",
        {
        size: 4, height: .25, curveSegments: 3,
        font: "helvetiker", weight: "bold", style: "normal",
        bevelThickness: 0.025, bevelSize: 0.05, bevelEnabled: true,
        material: 0, extrudeMaterial: 1
        });
var textMesh_Flying = new THREE.Mesh(textGeom_Flying, new THREE.MeshFaceMaterial(materialArray_Flying));
scene.add(textMesh_Flying);
textMesh_Flying.castShadow = true;
textMesh_Flying.receiveShadow = true;

The renderer setup looks like this:

var renderer = new THREE.WebGLRenderer({antialias: true});
renderer.shadowMapEnabled = true;
renderer.shadowMapSoft = true;
renderer.shadowMapType = THREE.PCFSoftShadowMap;
renderer.shadowCameraNear = 3;
renderer.shadowCameraFar = camera.far;
renderer.shadowCameraFov = 50;
renderer.setClearColor(0x000000, 1);
renderer.shadowMapWidth = 4096;
renderer.shadowMapHeight = 4096;

I would appreciate any help with resolving this issue.

Answer №1

It appears that the issue you are encountering is a result of the tiny size of the objects within the unit space, causing difficulties for the shadow mapping technique to accurately render these small details. Additionally, with extremely thin geometry, even the smallest shadowCameraNear value may not be sufficient to properly capture the mesh.

There are two potential solutions that come to mind:

1) Disable shadows on the main mesh(es):

textMesh_Flying.receiveShadow = false;

OR 2) Increase the overall size of your scene or thickness of the letters to provide more substantial elements for the shadow algorithms to work with.

Note: You could also experiment with setting shadowCameraNear = 0.001; to see if that improves the situation.

I hope this information proves helpful,

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

Obtaining your CSGO inventory via Steam API using jsonp: A step-by-step guide

Hey there! I'm currently facing an issue while trying to access a player's CSGO inventory using Valve's API. Unfortunately, I keep running into the error message stating that no 'access-control-allow-origin' header is present on th ...

Setting the Page Title in AngularJS 1.4.4: A Quick Guide

I'm faced with the code below <!doctype html> <html lang="en" data-ng-app="AlexsApp"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>{{$scop ...

The attempt to save data failed with a timed out error for Operation `todos.insertOne()` after 10000ms of buffering

const express=require("express"); const { stringify } = require("querystring"); const router= express.Router() const Db=require("../models/Db") router.get("/",(req,res)=>{ res.render("index.hbs"); }) .post("/addData",async(req,res)=>{ const ...

Having trouble retrieving information from .pipe(map()) method

Encountering some issues with Observable handling. I have a function that returns an Observable. public getData(userId) { const data = this.execute({userId: userId}); return {event: "data.get", data: data} } private execute(input: SomeDt ...

What is the process for testing promise functions that contain an internal promise using Jasmine in an Angular environment?

In my service function, here's how it looks: asyncGetStuff: (id) -> stuff = [] @asyncGetItem id .then (item) -> #parse some data stuff.push data return stuff Now I am trying to verify the contents of 'stuff': ...

Adjust image size as the page is resized

My challenge is to resize images that are typically too large for the current window size, ensuring they fit within 85% of the client window. I tried creating a function utilizing onload and onresize events but encountered issues. function adjustImages(){ ...

Creating an application for inputting data by utilizing angular material and javascript

I am looking to create an application using Angular Material Design, AngularJS (in HTML), and JavaScript. The application should take input such as name, place, phone number, and email, and once submitted, it should be stored in a table below. You can fin ...

What is the best way to update the $scope of a directive from another directive's controller in Angular.js?

One of my directives is responsible for loading a list of events from a service: .directive('appointments', [function () { return { restrict: 'CE', scope: { ngTemplate: '=', ...

The process of retrieving request data from axios.get and storing it in the Redux store

Recently delving into Redux, I'm curious about how to retrieve request data from a GET method. Upon mounting the component, you can use axios to send a GET request to '/api/v3/products', passing in parameters like pageNumber and pageSize. ...

Is it not possible to access the profile page using the GET method?

I am currently using Express.js to display user input in the URL after submitting a form and redirecting the user to their profile page with their name in the URL. To achieve this, I utilized req.query and the GET method. var express = require('expre ...

Ensuring the preservation of value type while making a Vue component function with v-model

Issue When using v-model on an HTML <select>, the v-model function assigns the selected value while preserving the data types - if a number is bound to an <option>, the model property will also be assigned as a number, and if an Object is boun ...

Deleting a ZIP file after sending the response in Express: A step-by-step guide

Is there any alternative solution to deleting the zip folder after sending a response in my code? Below is the code for a GET request: exports.Download = async (req, res) => { try { var zp = new admz(); zp.addLocalFolder(`./downl ...

Assign the value in the text box to the PHP session variable

Currently, I am developing a PHP "interactive text game" as a part of my assignment project. My task involves creating a user interface where users input information (such as character names) into text boxes that appear sequentially as they complete the p ...

Ensure that when adjusting the height of a div, the content is always pushed down without affecting the overall layout of the page

My webpage contains a div element positioned in the middle of the content, with its height being adjustable through JavaScript code. I am seeking a way to manage the scrolling behavior when the height of the div changes. Specifically, I want the content t ...

`Is there a way to dynamically update a nested field object in Mongoose without updating the entire object?`

const userProfile = new Schema({ name: { type: String, default: null }, contacts: { mobileNumber: { countryCode: { type: String, default: null }, digits: { type: String, default: null } }, email: { type: String, default: null }, facebook: { ...

Achieving vertical center alignment in React Native: Tips and techniques

Just a quick heads-up: This question pertains to a school project. I'm currently knee-deep in a full-stack project that utilizes React Native for the front-end. I've hit a bit of a snag when it comes to page layout. Here's the snippet of my ...

Testing infinite scrolling with the help of protractor

It seems like the infinite scrolling feature in ng-grid is not exactly infinite, but it's the closest comparison I could come up with for what I am observing. In our application, we are using ng-grid to display data in a table with approximately 170 ...

Searching for a MongoDB document using its unique identifier

Currently, I am working with Node.js and MongoDB where my database is hosted on MongoHQ (now compose.io). I have come to understand that document IDs are converted to hex strings, but I am struggling to retrieve a document using its ID. In my dataset, the ...

Checking for different elements between two arrays in AngularJS can be achieved by iterating through

I am working with two arrays: $scope.blinkingBoxes=[1,3,2] In addition, I have another array named $scope.clickedBoxes where I push several values. Currently, I use the following code to determine if the arrays are identical: if(angular.equals($scope.bli ...

Can you explain the purpose of the bootstrap directory in Laravel?

Ever since I started learning laravel, I've been incorporating bootstrap for styling and Javascript. While exploring my laravel folder, I stumbled upon a bootstrap folder which left me wondering if bootstrap is already integrated in laravel. If it is, ...