JCPalmer Posted January 7, 2016 Share Posted January 7, 2016 One way to handle devices of varying capabilities that works for both meshes & materials is to have separate directories, say desktop & mobile. Each directory has everything required. The script determines which & uses it for loading. My question is how do you tell? Quote Link to comment Share on other sites More sharing options...
gryff Posted January 7, 2016 Share Posted January 7, 2016 Hi Jeff, here is a piece of code that I have been experimenting with - not for loading different assets but for deciding on what camera to use.var isMobile = { Android: function() { return navigator.userAgent.match(/Android/i); }, BlackBerry: function() { return navigator.userAgent.match(/BlackBerry/i); }, iOS: function() { return navigator.userAgent.match(/iPhone|iPad|iPod/i); }, Opera: function() { return navigator.userAgent.match(/Opera Mini/i); }, Windows: function() { return navigator.userAgent.match(/IEMobile/i); }, any: function() { return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()); } };Then once I load the scene I have this code to decide a camera:if( isMobile.any() ){ //alert('Mobile'); //Create a TouchCamera } else { //Load a FreeCamera from the babylon file }Not my script - from here cheers, gryff JCPalmer 1 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 8, 2016 Author Share Posted January 8, 2016 Thanks. I knew this had to have been solved somewhere. Think I will primarily be using this for materials. The MakeHuman textures are way too big for mobile, 2048x2048. I tried to work in changing resolution of textures in exporter, but gave up. Fortunately, back in 2000, I did a little hobby project to digitize family photos & 35mm slides. Made a small Java app to search & display them, but also made a command line Java app to go through a directory and make thumb nail files. That thumb nail maker is going to get a dusting off after I get Blender actions done. Quote Link to comment Share on other sites More sharing options...
MasterSplinter Posted January 8, 2016 Share Posted January 8, 2016 Don't forget the outliers! /Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/ JCPalmer 1 Quote Link to comment Share on other sites More sharing options...
RaananW Posted January 11, 2016 Share Posted January 11, 2016 I think detecting "mobile" vs. "desktop" is rather wrong. A lot of reasons, one of them is this - http://www.stucox.com/blog/you-cant-detect-a-touchscreen/ . It is impossible to 100% detect a touchscreen (would be great to find a method that actually does it correctly). The web is going responsive. and I believe this is the best way to go here - check the screen resolution, and you would know what resources should be sent to the target client. Check (for a second or two) the FPS on the user's device, and you will know if it is strong or not. Some iPhones are stronger than some laptops I know The only problem occurs when you try to target the camera - which one should be used? touch camera? follow camera? I tried implementing an auto-camera picker in an old project, and the article above kind'a explained my bad experience. Try detecting mobile, ask the user to approve he is on mobile, and set him up with a touch camera. Quote Link to comment Share on other sites More sharing options...
RaananW Posted January 11, 2016 Share Posted January 11, 2016 Oh, and ask our good friends @ Microsoft what they think of User-Agent Sniffing . Check Edge's user agent just for fun. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 11, 2016 Author Share Posted January 11, 2016 Raanan, I thought Gryff's use for Camera, while fine for him, might be better implemented using Hand. Fast vs wimpy is really what I am after to know to drop the texture size. Screen resolution is not always perfect either. When I pass a 2K texture to a 10" iPad it really affects things. Maybe an evaluation of GPU capabilities is also a way to go. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 11, 2016 Share Posted January 11, 2016 @davrous and I were thhinking about a camera that can be controlled using touch, keyboard and mouse RaananW 1 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.