Raitch Posted February 23, 2017 Share Posted February 23, 2017 So basically I have this weird issue that happens on some computers where the Canvas2D after a couple of seconds gets zoomed into the bottom let corner, revealing about 20% of the total Canvas2D screen, a texture gets stuck in the water and so on. Only clue I get is potentially `GL_INVALID_VALUE : glViewport: height < 0` from `Engine.setDirectViewport()`, but it occurs so much it may hide the real bug (can you remove WebGL error cap somewhere)? If anyone wants to test and see if they can recreate this weird issue, you can try my beta version here: http://www.airconsole.com/simulator/#http://cotc.castlin.se/ (you play with your phone) It mostly occurs on some Window computers and on Firefox. Does anyone recognize this bug? It doesn't occur consistently during run time so it could be error overflow or something I guess. I'm not sure how to find WebGL related errors, googling these doesn't make me much smarter. Thanks! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 24, 2017 Share Posted February 24, 2017 Ping @Nockawa Quote Link to comment Share on other sites More sharing options...
Raitch Posted February 24, 2017 Author Share Posted February 24, 2017 The culprint could be `BABYLON.SceneOptimizer.OptimizeAsync(scene);` will try to confirm. Quote Link to comment Share on other sites More sharing options...
Nockawa Posted February 24, 2017 Share Posted February 24, 2017 I've never had such issue, but I've never used OptimizeAsync of SceneOptimizer, please keep me posted if it's the issue. It's most likely that I don't reset some states as expected. I've tried your URL but I don't see Canvas2D content, can you tell me what is drawn with it? Quote Link to comment Share on other sites More sharing options...
Raitch Posted February 24, 2017 Author Share Posted February 24, 2017 I'm getting quite convinced that `BABYLON.SceneOptimizer.OptimizeAsync(scene);` scaled down the Canvas2D for optimization which changed the resolution and created weird behavior. Haven't managed to recreate it again. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 24, 2017 Share Posted February 24, 2017 OptimizeAsync will scale down the main HTML canvas which could be the issue? You can test it by calling engine.setHardwareScalingLevel(2); Quote Link to comment Share on other sites More sharing options...
Nockawa Posted February 25, 2017 Share Posted February 25, 2017 I don't support Device Pixel Ratio (DPR) and I don't think I support a change of setHardwareScalingLevel other than the default value 1. I'll take a closer look asap if I can at least support the hardwareScalingLevel and let you know. Quote Link to comment Share on other sites More sharing options...
Nockawa Posted February 27, 2017 Share Posted February 27, 2017 Well, this is weird... I can reproduce the issue with this PG http://babylonjs-playground.com/#2AVSFH#213 But when I run the exact same code on the exact same browser locally it doesn't bug! I don't think I have a more recent version of BJS sources locally, I can see clearly that the hardware scaling make the HTML Canvas flick, but the render stays the same, with the same pixel size... @Deltakosh do you have an idea? Quote Link to comment Share on other sites More sharing options...
Nockawa Posted February 28, 2017 Share Posted February 28, 2017 hello @Raitch I believe the issues is solved, I've published a new version of the preview files of Canvas2D and the PG is updated, now the hardwareScalingLevel can be changed at anytime and I'll adapt the render of the Canvas. please, make the test, confirm and mark the topic as solved. thanks! Quote Link to comment Share on other sites More sharing options...
Raitch Posted March 5, 2017 Author Share Posted March 5, 2017 Cool. I'm not currently on the latest version of Babylon so I will try to confirm it at a later state. Thanks for the feedback! 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.