shrimpwagon

Members
  • Content Count

    7
  • Joined

  • Last visited

About shrimpwagon

  • Rank
    Newbie

Profile Information

  • Gender
    Male
  • Location
    Charleston, SC
  • Interests
    Babylonjs of course!

Contact Methods

  • Twitter
    shrimpwagon

Recent Profile Visitors

687 profile views
  1. Oh. Haha! I get your avatar now deltakosh. It's Kosh Naranek from Babylon 5. Hence Babylon. I always thought of Babylon from ancient times.
  2. After using the newest versions. When I put all that inside of scene.executeWhenReady it doesn't fire at all ever. I think the scene optimizer has its own scene ready method.
  3. Great. Making progress. I'm using babylon.2.0-alpha.js and the scene optimizer seems to be working ... sort of. My console.log is firing in Chrome on my Linux. But when I'm on my Galaxy 3 I'm still having weird issues. I'm getting the engine.getFps() and just updating a span tag to show it. For about 8 secs it shows 60 fps which can't be right because it is slow as molasses. When I don't set the trackerDuration (default 2000) it reads, "Reached target FPS." So it IS firing. And I guess is true because it's showing 60 fps, but again, it's super slow. Then after about 3 or 4 more seconds tanks to 6 fps. If I set trackerDuration to 10000, I never see a message at all. It's doesn't say it's reached or not reached. It starts out showing 60 fps, which isn't true, then drops to 7 fps and the scene never downgrades nor does it alert me that either of the callbacks fired for the target fps.
  4. I'm pretty sure it's not a version problem. I literally JUST downloaded both Babylonjs v1.14 and whatever is in the Tools folder for scene optimizer.
  5. Ok, pinpointed a few things. Looks like the above code needs to be before scene.executeWhenReady. When I did this it was trying to fire however I was still getting an undefined function error. In babylon.sceneOptimizer.js line 316. The scene variable does not have the getEngine function as I did a console.log on it. // Scene optimizer toolvar SceneOptimizer = (function () { function SceneOptimizer() { } SceneOptimizer._CheckCurrentState = function (scene, options, currentPriorityLevel, onSuccess, onFailure) { // TODO: add an epsilon if (scene.getEngine().getFps() >= options.targetFrameRate) { // throws error here because the scene var doesn't have a getEngine function if (onSuccess) { onSuccess(); } return; }So I just changed it to use BABYLON.Tools // Scene optimizer toolvar SceneOptimizer = (function () { function SceneOptimizer() { } SceneOptimizer._CheckCurrentState = function (scene, options, currentPriorityLevel, onSuccess, onFailure) { // TODO: add an epsilon if (BABYLON.Tools.GetFps() >= options.targetFrameRate) { if (onSuccess) { onSuccess(); } return; }But still very slow on my Galaxy S3 in chrome. Getting only 7 FPS. I've tried High, Medium and Low degradation. Is my phone just that old and slow?I only have 1 camera, 1 light source and 4 planes. One plane has a texture. On my Galaxy S3 on Firefox I'm getting somewhere between 20 and 30 FPS. Better. But the arc camera is all jacked up. Most the time only half the camera shows up and when I pinch or unpinch the scene flys away. It like over zooms really quickly.
  6. Hmmm.... I definitely waiting the 2 seconds. Changed the code but I still don't see anything in the console.log. // Optimize scene renderingvar scene_optimizer_options = BABYLON.SceneOptimizerOptions.HighDegradationAllowed();scene_optimizer_options.trackerDuration = 2000;BABYLON.SceneOptimizer.OptimizeAsync(scene, scene_optimizer_options, function() { console.log('FPS target reached'); }, function() { console.log('FPS target NOT reached'); });
  7. Need some serious guidance with SceneOptimizer. I promise I have thoroughly read through the wiki page https://github.com/BabylonJS/Babylon.js/wiki/How-to-use-SceneOptimizer-tool I believe I have included the scene optimizer javascript correctly. Not sure if I am implementing the code correctly. Basically, I'm trying to downgrade rendering on slower devices (eg Samsung Galaxy S4). Using this code below, I never see anything coming through on the console.log when testing on my Linux Debian laptop in Chrome 38. Javascript include: <script src="/libs/babylon/babylon.1.14.js"></script><script src="/libs/babylon/babylon.sceneOptimizer.js"></script>Code: var _canvas = document.getElementById("renderCanvas");var _engine = new BABYLON.Engine(_canvas, true);BABYLON.SceneLoader.Load("", "babylon/room.babylon", _engine, function (scene) { // Wait for textures and shaders to be ready scene.executeWhenReady(function () { // Optimize scene rendering BABYLON.SceneOptimizer.OptimizeAsync(scene, BABYLON.SceneOptimizerOptions.HighDegradationAllowed(), function() { console.log('FPS target reached'); }, function() { console.log('FPS target NOT reached'); } ); // ...I've tried changing out High to Low and Medium but I'm never seeing the log. Leading me to believe I'm not implementing right. Also not sure, even if I get a log from it that it is degrading. I'm unable to find any other examples from a Google search. Can someone provide a very very simple working example where it will just auto degrade whenever the frame-rate starts dropping below 30? Thank you so much. And thank you for such a brilliant library. I'll share my project when it's done.