Crash on Firefox, slow on Internet Explorer and devices (demo provided) - javascript

I researched a lot about this problem and I'm going crazy trying to understand why my example is causing a crash on Firefox, and runs VERY SLOWLY con Internet Explorer and mobile devices.
I'm rendering a big (4K) image on a sphere geometry, trying to create a kind of a pano viewer. In the real application, we can go from one place to the next one, clicking on the invisible shapes that are created inside the sphere.
In the real app, we have a big (4K) video rendering so we have some stuff in a certain area that moves in a loop. However, for this demo I commented those lines (addVideoTexture and renderVideo), so I understand this is not the issue here.
Pay attention to our raycaster, I suspect it is causing big performance problems, but I don't know any other way of detecting when our mouse is going over an "action hotspot" (look above) or a "indicator hotspot" (invisible areas that would allow to go to other places when clicking).
raycaster.setFromCamera(mouse, camera);
hits = raycaster.intersectObjects(indicatorHotspotPlane, false);
The problem is that this demo is causing a crash on Firefox, and going very very slow on plenty of devices and Internet Explorer.
Thanks a lot...
Ricardo
Here is an example where you can test it:
https://jsfiddle.net/ggL3uemh/13/
The ThreeJS version is r89
The browsers where it causes problems are Firefox and Internet Explorer, and I see some iOS devices going slow too.

Related

What is the difference between using usual website and the same website pinned to home screen?

I'm developing html5/js game using Cocos Creator and all looks fine and works great when I run it in Safari browser on my iPhone 5s or iPhone 6s.
The problem is, when I pin my game website to home screen, I gain quick access to it and nice fullscreen mode, but all the animations becoming slower. It is just a prototype of a game, so there are no difficult or long animations, but my game website still working much slower from "pinned mode". Another one problem: looks like pinned mode has it's own "cache". I've updated game sources on a server and my changes are visible in usual Safari mode and from Chrome browser, but pinned mode still showing old version of a game. I cleared all caches I know about, I even unpinned and pinned it few times - nothing changed.
Please, help.
It is a known issue and it is not fixed yet:
https://forums.developer.apple.com/thread/31599

Three.js textures not rendering on mobile and weird brightness issue

So I made a project using Three.js and everything works how I want it to on desktop browsers, tested using chrome, and firefox. When I try to open the project on any mobile browser, safari, chrome, or IE, some objects are not rendered these objects have normal maps and textures which appear fine on desktop but are not rendered at all on mobile. In addition objects appear to be overly bright on mobile and sometimes flicker going from behind one another to in front of one another.
One user suggested adding this.image = image; to the three.js file at line 18420 but this did not solve the issue. Here is a link to the project here http://pixelpusher.ninja/Ocean%20World/OceanWorld.html. You can inspect the page to view the source code. Has anyone ran into problems like this on mobile before? Any help is appreciated. Thanks!

iPad canvas very bad to zero performance

The javascript library I have created just translates a single picture and zooms it. Touch events and mouse events are used depending on what device.
I ran this javascript code on Firefox (7.0.1), iPhone 3GS (iOS 5.0) and iPhone 4 (iOS 5.0) all with smooth performance, no problem at all.
Then I ran it on iPad 1 (iOS 5.0) with slow performance though zooming and translating the picture works.
Last test was on iPad 2 (iOS 4.3.3) and here I experienced the same slow performance while zooming as iPad 1 but the translating didnt work at all.
I have no clue what this is about, since iPhone is supposed to be alot weaker than an iPad. I would appreciate any help or comments to get me on the right track.
http://pastebin.com/wZ7e77yq
UPDATE
I just ran it on an iPad 2 (iOS 5.0) and it works flawlessly. I also tried iPhone 3GS (iOS 4.2.1) and it didnt work, same as iOS 4.3.3. This means that my application needs iOS 5.0 to run... is it really true you couldnt translate objects before iOS 5.0?
UPDATE2
I just ran it on three different iPad 1s (iOS 5.0) and it doesnt work very good. What is the big difference in between an iPhone 4 and an iPad 1? Specs are almost identical. Also the translate didnt work because the function event.pageY/X doesnt work prior to iOS 5. This was fixed by using event.touches.pageX/Y instead.
Well I was developing a small game for testing canvas performance without any special game framework so I kept it simple because I was writing it by myself. The program did nothing special, just moving a sprite around the screen with different joystick types, such as keyboard and mouse for desktop click, and touch events for iOS. I discovered the following:
Using taps direct on the canvas results in poor performance compared to touch events.
Touch events worked well with different canvas sizes up to 1024x768.
I didn't try picture zooming, but that should have be fine as well.
event.pageX, event.pageY worked without problems on iPad (iOS5).
I hope that helps.
Seems like perhaps iOS CANVAS support was the issue. iOS5 has full GPU hardware-accelerated CANVAS support, while previous versions supported CANVAS albeit very poorly.
Surprised that it does not work well on iPad 1 even with iOS 5, though. Can you try closing all currently-running apps, close all other browser tabs, and run the test again?

Safari on iPhone and iPad crashes while zooming (double-tap and pinch)

I have a problem with a Wordpress-run website: http://www.igorlipinski.com - Safari freezes and eventually crashes on iOS devices while using the zoom option, either double tap or pinch to zoom option. It looks and works very well on desktop browsers. I can't quite locate the problem... any thoughts? Thanks in advance!
UPDATE: I disabled javascript on my iPhone and the site worked beautifully, so at least I know where to look now! I would appreciate if anyone had a direct solution for this particular site, but I will work on it in the meantime.
I have faced similar kind of issue. Found issue with canvas drawing.
Basically there is one issue with canvas drawing. when we draw or erase something using canvas's methods like drawRect(), lineTo(), moveTo(), etc... it will create extra layer (like pixels on canvas) which causes memory leakage issue in safari browser for ipads/mobiles.
I am still looking for solution/alternative for memory leakage while using canvas.
Hope this will help you find any clue related to your project.

Does Android browser lock DOM on touchStart?

I'm trying to build a menu with 5 blocks that the user can spin around.
You can see a demo here: http://m.iijax.com/menu.php
Works fine on iPhone, (if a little sluggish sometimes, but that is beside the point :p ) if i draw my finger more then 90 pixels (which i set as a limit) in either direction the menu spins.
On Android (2.1, a Samsung Galaxy S) however the menu does nothing until i release my finger from the screen, I've tried adding an alert on the 2 functions that changes a bunch of classes around to spin the menu either to the right or left and they do get triggered as I draw my finger.
So my best guess is either the browser locks access to the DOM until touchEnd, or it blatantly cheats and simply shows me some kind of screenshot of the page awaiting touchEnd.
Can anyone confirm either of these theories? I've spent about an hour searching here and on google and found nothing, but maybe I haven't found the rightsearch terms.
I've tried lots of swipe and slider examples I've found however and haven't found anything that animates in real time as i draw my finger.
Would also be interesting to know if this menu works on newer Android versions.

Categories

Resources