Xanmia Posted April 10, 2014 Share Posted April 10, 2014 This maybe a bit out of scope for this group but... I recently got a prototype of my physics game up and running on a few iOS devices.First off it works better then I expected, which is great!While older devices(iphone 4, 4th gen ipod touch) run a bit slower due to the physics engine, which I expected but it works and looks fine. Slightly newer devices (ipad2, ipad mini, yet to test on iphone 5) run faster but have a terrible clipping/disappearing effect on meshes.The mesh will blink multiple times even when stationary and framerate is around 50-60. Has anyone else run into this? I am coming to the conclusion its probably something within the Ejecta code. Thanks! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 10, 2014 Share Posted April 10, 2014 Could you share your code somewhere? a jsfiddle perhaps? Quote Link to comment Share on other sites More sharing options...
Xanmia Posted April 11, 2014 Author Share Posted April 11, 2014 Here you go: http://jsfiddle.net/Xanmia/yx3UV/17/ I have scaled it back a lot and the iOS touch events are still there.Tested with emissive textures too, still does it. Thanks! Quote Link to comment Share on other sites More sharing options...
demonixis Posted April 11, 2014 Share Posted April 11, 2014 Hi, I'm working with Ejecta and Babylonjs too and I've a similar problem. I noticed that using a far value > 10 and a near value > 50000 give me better results. BTW using just one texture per material is better for performances. I made some tests with babylon and three.js and we've better performances with Three.js and no clipping error. How have you fixed the shader loading issue ? I've written a wrapper that override BABYLON.Effect.prototype._loadVertexShader and BABYLON.Effect.prototype._loadFragmentShader to pass a string that contains the shader. I don't know why but Ejecta can't load some shader files :/ Quote Link to comment Share on other sites More sharing options...
Xanmia Posted April 11, 2014 Author Share Posted April 11, 2014 Thanks Demonixis. Excellent post on your site, thanks for the info! I removed almost everything I had in my scene because of the clipping...Although, I had a water shader in my scene and I did see your github jist for shaders and was going to give it a test if I clear up the clipping. My next step was going to move it over to Three.js but I enjoy Babylonjs a lot and wanted to give it a chance.Have you tried getting Physijs running along side Threejs on an ipad? I was attempting to run some tests but struggled with setting the worker. Quote Link to comment Share on other sites More sharing options...
demonixis Posted April 11, 2014 Share Posted April 11, 2014 I just have made some tests with Three.js on ipad, all my efforts are focused on Babylonjs because our app use it Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 11, 2014 Share Posted April 11, 2014 The new version of babylon.js can load shader form DOM element BTW, the clipping issue is maybe related to camera: you can reduce cam.maxZ or increment cam.minZ to get rid of it @demonixis: Could you tell me more about perfs issues? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 11, 2014 Share Posted April 11, 2014 I would love to see the code you used where three.js is faster. This could give us a lot of ideas to improve babylon.js Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 11, 2014 Share Posted April 11, 2014 I have no Apple device to test also. Could you share a video of the clipping issue? Quote Link to comment Share on other sites More sharing options...
Xanmia Posted April 11, 2014 Author Share Posted April 11, 2014 cam.minZ fixes the issue. I had previously dropped the maxZ as far as possible and it still was doing it...Still want a video Deltakosh? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 11, 2014 Share Posted April 11, 2014 If the issue is fixed no Xanmia 1 Quote Link to comment Share on other sites More sharing options...
demonixis Posted April 12, 2014 Share Posted April 12, 2014 @Deltakosh I don't have an ipad at home but I'll make a video with graphics issues monday Ejecta hasn't DOM it's an implementation of the HTML Canvas and Audio tags, nothing else (it's not a webview). Quote Link to comment Share on other sites More sharing options...
demonixis Posted April 14, 2014 Share Posted April 14, 2014 @Deltakosh I made three videos that show all graphics issues with Babylon and Ejecta. As you can see we've big problems with doors and floor (the floor problem is maybe an internal error). Ejecta and Babylon are young, I don't know if it's a problem with Ejecta or Babylon. What do you think about it ? A simple scene with a ground, cubes and a skybox works well with three.js and Babylon (we just have to set minZ > 10 and maxZ > 50000). Xanmia 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted April 14, 2014 Share Posted April 14, 2014 The video are very long has load and when it is load, the playback image is color tomato. I sees nothing. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 14, 2014 Share Posted April 14, 2014 What I see is a depth buffer precision issue try with minZ = 1 and maxZ = 500 Quote Link to comment Share on other sites More sharing options...
Xanmia Posted April 23, 2014 Author Share Posted April 23, 2014 I was able to get a game working on all iOS devices with Ejecta and published on the app store.While not graphically impressive, it's still a BabylonJS game running on iOS and in the store!I pulled a lot out due to the performance on iOS devices with the physics engine, which I expected...I would like to do some work without the physics engine. For those of you with an iOS device, you can download it free here: https://t.co/cZVSmlN7sfLet me know what your best score is some time! Highest for me is 33. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 24, 2014 Share Posted April 24, 2014 Wooauu this is huge!!! Thank you Xanmia! 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.