FabAlter Posted December 21, 2017 Share Posted December 21, 2017 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 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 21, 2017 Share Posted December 21, 2017 There should be no difference. Can you repro in the PG? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.