troubleshooting color problem with video textures in three.js

There seems to be a slight variation in the colors of my video texture compared to the original video.

I've experimented with different three.js encoding options, but I still notice this discrepancy.

Does anyone have any tips on how to avoid this issue? Thanks

UPDATE

You can find the current version of my code on CodePen: https://codepen.io/michaelgrc/pen/jOGEezY

this.maTexture = new THREE.VideoTexture( el.querySelector('video') );

this.monMaterial = new THREE.MeshBasicMaterial({
    map: this.maTexture
})

I'm aiming to create a stylish transition. When I click on a video, I want it to appear larger and distorted within a canvas, using some post-rendering effects.

Unfortunately, the video doesn't display properly in my three.js render because it's hosted online, as seen in the linked CodePen.

The main problem is that when you initially click on the video element in HTML, the video within the canvas shifts slightly in color, causing a noticeable shift for the user.

Here's a screen recording showing the change in tone when clicking:

Answer №1

Make sure to check the settings for your renderer, such as toneMappingExposure and toneMapping. These properties can greatly affect the overall ambiance and appearance of your project. You can experiment with different values using this helpful example before implementing them into your own project: webgl_tonemapping. Play around with the values until you achieve your desired result:

renderer.physicallyCorrectLights = true
renderer.outputEncoding = THREE.sRGBEncoding
renderer.toneMapping = THREE.ACESFilmicToneMapping
renderer.toneMappingExposure = 1.3
//Just an configuration example

If adjusting the tonemapping doesn't solve the issue, it could also be related to an environment map problem. In that case, you may find a solution in this discussion thread where someone faced a similar texture tone problem: three-js-texture-tone-issue.

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

AngularJS directive doesn't refresh template when scope values are fetched dynamically through ajax requests

Attempting to give this question a precise title as possible, I find myself struggling with an issue in AngularJS. While trying to showcase my problem through a jsfiddle, it turned out to be too reliant on multiple files and not yet accessible online. So p ...

PHP Generate an array with predefined slots

I have a PHP array that is populated with data from a stored procedure: <root> <dataSet> <reimbursementMonth>6</reimbursementMonth> <reimbursementYear>2014</reimbur ...

Limiting the number of times a specific character appears using a regular expression

Currently, I am in search of a regular expression that allows me to set a limit on the number of times a special character can appear. For instance, if I want to restrict the occurrence of * to a maximum of 5 times in the entire text, then the output shou ...

Ways to include extra information in a request when uploading images using Django's CKEditor?

On my website, I am utilizing django-ckeditor to allow users to input rich text content. Each webpage on the site represents a unique document identified by an id. For instance, two different documents will have separate webpages with URLs like - exampl ...

Adding HTML after the last item in an ng-repeat directive in AngularJS

After incorporating the Instagram API to generate a Load More Button for displaying recent media, I am facing an issue where it overlaps with the ng-repeat and fails to append a new line after the last ng-repeat. I would be grateful for any assistance. Th ...

Passing Data from Child Components to Parent Components in Vue.js

Looking for assistance with a component I have: <BasicFilter></BasicFilter> It contains a select element: <select @change="$emit('onSortName', $event)"> <option value="asc"> A..Z</option><opti ...

Does the PHP include function act as an HTTP request?

After coming across an article highlighting the negative impact of using excessive HTTP requests on server speed, I started wondering about the performance implications of PHP includes. Specifically, I'm curious if sending 4 AJAX requests compared to ...

Finding an element that appears after a JavaScript script has run and is visible on the page

<div class="inline-check"> span class="ic-check" style="display: inline;"> I am currently facing a challenge in locating the HTML code snippet provided above. This snippet represents a text box that accepts numbers and displays a green check mark ...

Transferring data from a text area to a table with AngularJS

Creating a C# MVC App with AngularJS My goal is to populate a table with values entered in a text area using Angular. Here is the process: Users input values into a text area like this: A B C When a user clicks a button, a modal window should open and ...

The URL for Ajax is not defined

I am currently working on a function that involves fetching an XML file and making some edits to it. This is new territory for me, so I had to do some research on the best approach to accomplish this task. After some consideration, I decided to use AJAX. H ...

What is the best way to send additional data with getServerSideProps() in Next.js?

Not sure if this is a silly question, but I am currently working with a Django API and attempting to implement pagination on the search page using Next.js. As a newbie to Next.js, I have scoured the web for a solution but haven't found anything helpfu ...

The Angular Google Maps Directive zooms in too much after the "place_changed" event has fired

Currently, I am developing a store locator app for DHL accessible at storefinder.hashfff.com/app/index.html For this project, I decided to utilize the angular-google-maps library for its features. However, in hindsight, working directly with the Google Ma ...

Using GreenSock to animate and manipulate the tween function's parameters

I have two functions that are called on mouse events: function menuBtnOver(e){ var b = e.data; b.setPosition(b.x, b.y+5); } function menuBtnOut(e){ var b = e.data; b.setPosition(b.x, b.y-5); } Additionally, there is another function: setP ...

Reduce the amount of code in conditional statements

Is there a way to streamline the following code- <div className="App"> <Checkbox parameter={parameter1} setParameter={setParameter1}></Checkbox> { parameter1.country && parameter1.category ? < ...

Encountered an error: Unexpected symbol < at the beginning of JSON data (JavaScript and PHP)

I've been struggling with this challenge for days and I hope someone can assist me with it. The issue revolves around passing data from JavaScript to PHP. My aim is to send the lostid from an HTML page to a JavaScript page, then have the JavaScript pa ...

Can you explain the distinction between the GenerateSW and InjectManifest choices within the vue ui pwd configuration?

Currently utilizing @vue/cli for building a vue project. I have initiated vue ui to access the vue UI and am in the process of customizing various available options. https://i.sstatic.net/h77AE.png Within Configuration -> PWA, I have come across the a ...

Angular.js enables seamless synchronization between contenteditable elements and the $scope object by automatically updating the

I'm completely new to Angular.js and have been exploring various tutorials to grasp the concept of two-way binding with contenteditable elements within an ng-repeat. Currently, I am utilizing a shared 'store' between controllers like this: ...

Modify the color of CSS for all elements except those contained within a specific parent using jQuery

I have a color picker that triggers the following jQuery script: //event.color.toHex() = hex color code $('#iframe-screen').contents().find('body a').css('color', event.color.toHex()); This script will change the color of al ...

Tips for allowing specific tags using Google's Caja HTML Sanitizer in a node.js environment

I'm currently utilizing the npm module Caja-HTML-Sanitizer with node.js. Although I am able to sanitize the HTML input using the sanitizer() function, I am unsure of how to implement a whitelist in order to restrict only certain tags (e.g. p br stron ...

How can we verify the validity of URLs based on their length, presence of capital letters, and specific whole words?

I'm currently working on a piece of code that verifies the URL provided by users during sign-up for my application. I want to implement the following restrictions: URL must be at least 3 characters long No capital letters allowed Avoid certain words ...