VictorF Posted November 27, 2018 Share Posted November 27, 2018 I need to make custom operations before or after the render and it works nicely on Chrome and Firefox (tested in windows), also works nice on Android but you cannot move the camera in iPhone here are the mandatory examples Non-working https://www.babylonjs-playground.com/#7FJNSA Working (just commented out the registerBeroreRender) https://www.babylonjs-playground.com/#7FJNSA#1 Any tip on this? Thank you in advance. Btw: most of my code is based on an example that a user posted in the forum but I cannot longer find the post to make a proper attribution sorry! Quote Link to comment Share on other sites More sharing options...
trevordev Posted November 27, 2018 Share Posted November 27, 2018 @VictorF Could you try using scene.onBeforeRenderObservable.add(your function) and scene.onAfterRenderObservable.add(your function) instead and see if that works? Quote Link to comment Share on other sites More sharing options...
VictorF Posted November 27, 2018 Author Share Posted November 27, 2018 42 minutes ago, trevordev said: @VictorF Could you try using scene.onBeforeRenderObservable.add(your function) and scene.onAfterRenderObservable.add(your function) instead and see if that works? Weird it works on https://www.babylonjs-playground.com/#7FJNSA#3 but not in my own example anyway something is weird there since registerBeroreRender is not working even in the simplier case. Quote Link to comment Share on other sites More sharing options...
trevordev Posted November 27, 2018 Share Posted November 27, 2018 Does registerBeroreRender work as expected in a basic scene https://playground.babylonjs.com/#EHKNF7 ? It might be that somewhere it is getting overwritten. What is the difference between your own example and that playground? Quote Link to comment Share on other sites More sharing options...
VictorF Posted November 28, 2018 Author Share Posted November 28, 2018 This is totally weird... this one works https://www.babylonjs-playground.com/#7FJNSA#3 and this other doesn't work http://www.motivacg.com/temporal/victor/LayamaStupidTestV3/rawplayground/ But the second one is just the first one downloaded and copied to my server thats all, also it works ok in PC and Android devices but cannot be used in iPhone devices Quote Link to comment Share on other sites More sharing options...
max123 Posted November 28, 2018 Share Posted November 28, 2018 Try adding this to your code: canvas.setAttribute("touch-action", "none"); Quote Link to comment Share on other sites More sharing options...
VictorF Posted November 28, 2018 Author Share Posted November 28, 2018 6 hours ago, max123 said: Try adding this to your code: canvas.setAttribute("touch-action", "none"); it worked I cannot imagine why this works but <canvas id="renderCanvas" touch-action = "none"></canvas> does not. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted November 28, 2018 Share Posted November 28, 2018 Weird Indeed... Did you precise it through CSS ? If I remember well more modern browsers use css for this one and we usually put both in Babylon, just in case. 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.