Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

226
Vistas
A-Frame - rendering to a RenderTarget causes screen flickering, in VR mode only

I wrote a custom shader for Conway's Game of Life, using three.js and A-Frame, which does all processing in the fragment shader. It works perfectly in a web browser on desktop. It also appears to work in the Quest browser, but when entering VR mode, the entire screen begins to flicker between the scene and a black screen.

I suspect that the problem is with the RenderTarget settings, or the way in which I switch between render targets, but I am not sure. The relevant code occurs within an A-Frame component tick function, which periodically switches between two render targets and back to the main scene as follows:

this.el.sceneEl.renderer.setRenderTarget(this.renderTarget0);
this.el.sceneEl.renderer.render(this.rtScene0, this.rtCamera);

this.el.sceneEl.renderer.setRenderTarget(this.renderTarget1);
this.el.sceneEl.renderer.render(this.rtScene1, this.rtCamera);

this.el.sceneEl.renderer.setRenderTarget(null);

If it is relevant, I have also disabled the depth buffer on the RenderTarget objects. The full code is available on GitHub at https://github.com/stemkoski/A-Frame-Examples/blob/master/conway-shader.html and a live version is at https://stemkoski.github.io/A-Frame-Examples/conway-shader.html.

My question is: how can I stop the screen from flickering in VR mode, while using RenderTargets in A-Frame?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you follow Mugen87 comment quoted by Marquizzo ( " The idea is to disable xr, perform the rendering and then enable xr again"). All is working fine in VR. To disable XR and shadow map before the gpgpu computation do:

this.el.sceneEl.renderer.xr.enabled = false;
this.el.sceneEl.renderer.shadowMap.autoUpdate = false;

And reactivate it after with (if in vr):

this.el.sceneEl.renderer.xr.enabled = true;
this.el.sceneEl.renderer.shadowMap.autoUpdate = true;

Working A-Frame source code :

https://glitch.com/edit/#!/experienced-political-share?path=index.html%3A204%3A12

Demo:

https://experienced-political-share.glitch.me/

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda