The StereoEffect is unable to render the texture from the WebGLRenderTarget

I am looking to blur a panoramic view to create a user-interface in front of the blurred view. To achieve this, I am using a fragment-shader-based implementation to compute the blurred image on the client side.

Everything works perfectly when using the regular renderer. However, when I switch to using THREE.StereoEffect to render the scene, the blurred image does not show up on the screen.

For a demonstration, you can check out the attached snippet (jsfiddle link: https://jsfiddle.net/n988sg96/3/): Toggling the blur button works as expected. But when you toggle the stereo mode and then try to apply the blur, the screen goes black (indicating that the blurred image is not rendering).

The creation of the blurred image is handled by the createBlurredTexture() function, using the same renderer as the scene and two render-targets for the vertical and horizontal blur passes.

I have confirmed that both render-targets contain the correct images by exporting them as images using

renderer.readRenderTargetPixels()
, regardless of whether the stereo mode is active or not.

My questions are:

  • Why is the texture from the RenderTarget not rendering with the StereoEffect?
  • Are there any other similar options to achieve the desired effect?

// JavaScript code snippet will go here
/* CSS code snippet will go here */
<!-- External script imports will go here -->

Answer №1

I was able to find a solution after stumbling upon this helpful post: three.js - THREE.StereoEffect / webVR-boilerplate + THREE.Mirror

All it took was adding a single line to the createBlurredTexture() function. Upon cleanup, it was vital to manually unset the renderTarget by including the following line of code:

renderer.setRenderTarget(null);

This step was crucial because if the renderTarget was not unset, the rendering of the stereo-effect would clear the renderTarget instead of the screen framebuffer when renderer.clear() was called.

I truly appreciate the help from stackoverflow! <3

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

Looking for advice on how to design a custom JavaScript widget?

I am currently working on a web application and I am in the process of developing a feedback form widget that users can easily embed on their websites. The data submitted through this widget will be securely stored within my web application. One important ...

Unleashing the potential of an endless animation by incorporating pauses between each iteration

I am trying to create an infinite animation using animate css but I want to add a delay between each iteration. After exploring various options, I first attempted to achieve this using plain JavaScript. Here is the HTML snippet: <div id="item" class= ...

Combine and emphasize several gridview rows into a single highlighted unit

Imagine you have a gridview that looks like this: FAMILY GROUP COLOR =============================================== | | Poodle | Blue ROW1 | DOG | German Shepherd | Red | | Pitbul ...

Transmit information from an HTML input field (not a form) to a Python CGI script through AJAX

I am currently facing a challenge where I need to send data programmatically without using form fields directly to a python CGI script. The issue lies in not knowing how to extract this data in Python. Normally, with a form, I could use "form = cgi.FieldSt ...

Transition from FadeOut to loading content and displaying it

Is there a way to simply display the content after loading without using fadeIn? $(function() { $('.hovers').click(function(event) { var target = $(this).attr('href'); window.location.hash = target; $.ajax({ url: ...

Why does babel-node encounter a "module not found" error when the ".js" extension is not included?

Why is babel-node not importing without the ".js" extension? I have "type": "module" in my package.json import example from "./src/example.js"; works fine import example from "./src/example"; does not work --es-module-specifier-resolution=node only works ...

Choose carefully when to utilize forkJoin

In a particular scenario, I need an application to generate menus based on specific contexts. Here are the definitions for menuA and menuB: // menuA example from a given source menuA() { return [ { a: 'demo1', b: &apo ...

Transmitting client-side Javascript data to backend server using Express

I am trying to fetch data from my frontend using the DOM and send it to the backend through Express but I'm unsure of how to proceed. I have used a POST method to console.log the data, but now I need help retrieving it in my Express backend. (The cons ...

Struggling to retrieve the data from a RESTful API?

I'm currently learning how to fetch an API in javascript and I'm encountering some difficulties in extracting specific parts of the response body. My goal is to store the setup and punchline of a joke in variables for later use. Here is the code ...

There is currently no feature to integrate postal code objects within React's Stripe elements

I'm currently working on designing a custom form for Stripe. Instead of using the entire card element, I am opting to bring in individual components from Stripe elements for better styling options. My goal is to layout these individual inputs in a gri ...

The updates made to data in Vue.js are not reflecting on the screen

<template> <div class="parent"> <div class="container"> <h1 class="start" @click="start_timer"> {{ timerText }} </h1> </div ...

Utilizing an alpha mask on a threejs mesh to create cast shadows

When attempting to have a single plane with an alpha mask cast shadows, I encountered an issue where the shadow was being cast for the entire plane instead of applying the alpha mask as intended. After some research, I discovered that adding a customDepth ...

A function similar to setCell for modifying form fields in JqGrid

After searching through numerous answers from @Oleg, I couldn't find the solution I was looking for. I am dealing with a grid where I can edit inline in certain fields. Specifically, I am working with autocomplete functionality and when I select an it ...

Understanding the process of configuring Quasar Language in SSR Mode using route parameters

Is there a way to incorporate Quasar Language Packs while utilizing this specific routing method and SSR mode? const routes = [ { path: '/:locale?', beforeEnter: localeNavGuard, children: [ ... ] } ] ...

Displaying only the final item from an array when clicking in an ng-repeat loop

My objective is to display the details of each value from my data in a pop-up window. However, instead of showing three different values, the pop-up only displays the last value from an array three times. This is the HTML code I am using: <div ng-re ...

Tips on retrieving the status code from a jQuery AJAX request

I am trying to figure out how to retrieve the ajax status code in jQuery. Here is the ajax block I am currently working with: $.ajax{ type: "GET", url: "keyword_mapping.html", data:"ajax=yes&sf="+status_flag, success: callback.success ...

The Tauri JS API dialog and notification components are failing to function, resulting in a null return value

Currently, I am getting acquainted with the tauri framework by working on a small desktop application. While testing various tauri JS API modules, most of them have been functioning as expected except for the dialog and notification modules. Whenever I tes ...

Ways to retrieve JSON data using Angular JS

I'm currently working on populating my table with data. The URL returns JSON data, but I'm struggling with how to retrieve it using AngularJS. Here is my services.js: angular.module('OrganisatieApp.services', []) .factory('organi ...

Error: Module not found - The package path "." is not exported from the specified package. As a result, Firebase will not update in your Next.js

I have been developing a Next.js application that retrieves data from a Firebase collection. During the process of connecting to the Firebase database, I have come across the following error: Failed to compile. Module not found This error seems to be ori ...

The initial ajax request successfully connects to the file, but encounters a 404 error upon the second attempt

I am currently encountering an issue with a jQuery post function. The function is designed to run multiple times and then stop, which it has successfully done in the past. However, now the problem arises when the function tries to execute itself again afte ...