Jump to content

FabAlter

Members
  • Posts

    1
  • Joined

  • Last visited

FabAlter's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hello, I have created a custom shader ( BABYLON.ShaderMaterial ) that needs to update an uniform value (time) in the runRenderLoop. I created a camera with : var vrHelper = scene.createDefaultVRExperience(); When I use the non VR camera everything is fine, but when I switch to the VR camera, the rendering freeze. If I comment in the code below the line : my_material.setFloat("time", time); then it renders normally in VR as well. It looks that updating a uniform value of a shader does not work in VR or has to been done differently ? var my_materials = scene.materials; // Render var time = 0; engine.runRenderLoop(function () { for (var i = 0; i < my_materials .length; ++i) { if (my_material != undefined) { my_material.setFloat("time", time); //If this line is commented work both in VR and non VR } } time += engine.getDeltaTime()/1000; scene.render(); } Thanks for the help, Fabien
×
×
  • Create New...