Using copyTextureToTexture in three.js creates unsightly aliasing artifacts

Whenever I attempt to use the copyTextureToTexture function to copy texture1 (which contains a loaded image) to texture2 (a datatexture that was created with the same dimensions and format), I encounter severe aliasing artifacts. It seems like most of the GPU filtering is disabled, although anisotropy appears to work partially. I've been struggling for the past 2-3 days to resolve this issue, but I'm still uncertain whether it's a bug in three.js or if there's something I'm overlooking. Any assistance would be greatly appreciated. Feel free to provide a WEBGL solution as well, as long as it can be used in conjunction with three.js.

The test-code below allows you to toggle between the original texture and the copied texture by clicking on the window, so you can compare the artifacts:

var w = window.innerWidth;
var h = window.innerHeight;
var hx = w / 2;
var hy = h / 2;

var camera, scene, renderer, tog1;
var mouseX = 0,
  mouseY = 0;

// rest of the code goes here...

body {
  color: #000;
  font-family: Monospace;
  font-size: 13px;
  text-align: center;
  background-color: #fff;
  margin: 0px;
  padding: 0px;
  overflow: hidden;
}

#info {
  position: absolute;
  font-weight: bold;
  top: 0px;
  width: 100%;
  padding: 5px;
  z-index: 100;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/96/three.min.js"></script>
<!DOCTYPE html>
<html lang="en">

<head>
  <title>copyTextureToTexture test</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  <style>

  </style>
</head>

<body>
  <div id="info"></div>
</body>

</html>

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

Answer â„–1

When it comes to hardware antialiasing, only the Framebuffer is affected due to a well-known constraint within WebGL. To work around this limitation, one option is to implement antialiasing post-processing techniques or render to higher resolution intermediate buffers before downsampling them to fit the display resolution post-rendering.

( Update: Further investigation may be needed to fully understand the current limitations )

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

What steps can I take to display a "Sign in with Paypal" button on a React App?

Disclaimer: I am relatively new to React and have only been dabbling with it for a day. I came across this tutorial source code that is designed for logging in with Google. https://github.com/The-Tech-Tutor/spring-react-login My goal is to integrate a "L ...

Is there a way to change the text (price) when I select an option?

<div class="single-pro-details"> <!--Customize in the CSS--> <h6>Home / Beats</h6> <h4>Unique Lil Tecca Type Beat - New Love</h4> <h2 id="price">$ ...

What is the best way to add HTML tags both before and after a specified keyword within a string using JavaScript?

Imagine I have a string similar to this, and my goal is to add html tags before and after a specific keyword within the string. let name = "George William"; let keyword = "geo"; Once the html tags have been appended, the desired result should look like ...

The successful completion of the Ajax post method reveals a difference in the sequence in which data is posted and retrieved

Within my code, I have dynamically created textboxes with various ids. In JavaScript, I am able to fetch the values of these textboxes one by one. Everything seems to be working perfectly up until this point. However, when I pass this data using an AJAX ...

Instructions for adding a class when a li is clicked and replacing the previous class on any other li in Vue 2

Even though I successfully used jQuery within a Vue method to achieve this task, I am still searching for a pure Vue solution. My goal is to remove a class from one list item and then add the same class to the clicked list item. Below is the code snippet w ...

Tips for correctly storing an async/await axios response in a variable

I am facing a challenge with the third-party API as it can only handle one query string at a time. To overcome this limitation, I am attempting to split multiple strings into an array, iterate through them, and make async/await axios calls to push each res ...

Troubleshooting: 404 Error When Trying to Send Email with AJAX in Wordpress

In the process of creating a unique theme, I encountered an interesting challenge on my contact page. I wanted to implement an AJAX function that would allow me to send emails directly from the page itself. After conducting some research, I managed to find ...

Sails encountering CORS preflight error due to cross-origin request

I am new to creating hybrid apps and have been following some tutorials. However, I encountered these errors on my browser console: Refused to load the script 'http://192.168.1.142:35729/livereload.js?snipver=1' due to Content Security Policy di ...

What is the best method for extracting specific information from a JSON dataset (API) when using Axios in ReactJS?

Is there a way to retrieve an image from the Instagram graph API that contains specific text in the caption and display it on the homepage? I am having trouble implementing this rule using promises in axios. Any help would be greatly appreciated. import ...

Is it possible to derive the language code without using the Common Locale Data Repository from a rough Unicode text

I am currently developing a dictionary application. One of the features I am working on involves identifying the language of a Unicode character when entered by a user. For example: 字 - would return ['zh', 'ja', 'ko'] ا٠...

Strategies to avoid red squiggle lines in a contenteditable div that has lost focus

While the div is focused, spell checking is enabled which works well. However, once the focus is removed and there are spelling mistakes, the red squiggle lines for spell checking remain visible. After following the advice provided in this query: spellch ...

Learning how to invoke a JavaScript function from a Ruby on Rails layout

In the file app/views/download.js.erb, I have defined a javascript function named timeout(). This function continuously polls a specific location on the server to check if a file is ready for download. I am currently running this function as a background ...

React Native, state values are stagnant

I created an edit screen where I am attempting to update the post value through navigation v4 using getParams and setParams. However, when I modify the old value and click the save button, it does not update and no error is displayed. The old values still ...

Turn off specific default features within Sails.js

Currently, I am working on a backend REST API application using Sails.js framework version 0.10. The main focus of this application will be strictly on REST functionality, with authentication utilizing oAuth bearer tokens. All responses will be formatted i ...

Create node panels using GoJS and apply paint to them to enhance

Hey there! I'm looking to style my node similar to the one on the right using GOjs. Any suggestions on how I can achieve that? The left node is what I currently have, but I really want to paint it like the right node. It seems like some parts are mi ...

Guide to customizing marker colors on APEXCHARTS in a Next.js project

Is there a way to specify the color of each data point individually? For example, something like { x: 'Yellow', y: [2100, 3000], colors: '#808080' }, as the default color is set for all markers under plotOptions > dumbbellColors. I n ...

Managing server errors when utilizing Observables

i am currently developing an Angular 2 application and part of it includes a login feature that utilizes this service. import { Http, Response } from '@angular/http'; import {Injectable} from '@angular/core'; import 'rxjs/add/op ...

Utilizing Selenium and NodeJS to Enhance Calendar Functionality

https://i.sstatic.net/FOtxu.jpg <-- Calendar Image I'm encountering an issue with a calendar that necessitates a double click to select dates. My current JavaScript setup using the NodeJS Selenium-webdriver lacks support for double clicks. Should ...

Error encountered: attempting to build for the iOS Simulator, although linking a dylib compilation specifically for iOS, such as the file 'TitaniumKit.framework/TitaniumKit' for the arm64 architecture

Whenever I attempt to build my appcelerator app for ios, I encounter this error: ld: building for iOS Simulator, but linking in dylib built for iOS, file 'Frameworks/TitaniumKit.framework/TitaniumKit' for architecture arm64 Despite my efforts to ...

What are the names of the child elements within a three.js entity?

I am attempting to retrieve the variable names of all the child objects within a three.js object and then save them in an array. The object contains a property .children, but this returns an array with all the data, not just an array of the objects' ...