petemac Posted October 2, 2015 Share Posted October 2, 2015 Hello Does mobile safari have a limit of bones per mesh?When I load a mesh with 30 bones from blender, it loads and displays fine.However when I add one more bone and load the mesh with 31 bones it doesnt display on screen.Ive tried numerous times with different models and no luck.The mesh still displays perfectly in Google Chrome on my laptop.It also displays perfectly in sandbox on my laptop.Is there some sort of limitation on safari mobile? The Iphone6? Babylon? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 2, 2015 Share Posted October 2, 2015 Hello, the limit is not really in the number of bones but in the number of variables allowed for a single shader. Babylon tries its best to compile the simpler shader possible but sometimes the browser is limiting what we can do Two options:- Remove bones- Uses software skinning: mesh.computeBonesUsingShaders = false Quote Link to comment Share on other sites More sharing options...
petemac Posted October 2, 2015 Author Share Posted October 2, 2015 Thank you! Using mesh.computeBonesUsingShaders = false works perfectly! However, I am curious. If I have a mesh with 30 bones, but 31 bones puts me over the limit by 1 bone. Will two seperate mesh with 30 bones put me over the limit for shader uniforms? The only drawback is that this operation can consume a lot of shaders uniforms (a limited resources representing the variables that can be sent from the CPU). On low-end devices this may be a problem as bones can swallow all the uniforms. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted October 2, 2015 Share Posted October 2, 2015 Please indicate the version of the 'A' processor you are using, or the model. It actually would be great to be able to collect limits for as many mobile devices as possible. Also, I am going to guess, but I am pretty sure it is a per mesh limit. Quote Link to comment Share on other sites More sharing options...
petemac Posted October 2, 2015 Author Share Posted October 2, 2015 A8 - iphone6 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 2, 2015 Share Posted October 2, 2015 Will two seperate mesh with 30 bones put me over the limit for shader uniforms?No as the limit is per mesh Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted October 5, 2015 Share Posted October 5, 2015 Would it be possible to make the following changes to: vertexData.ts, and the definitions of methods that call it: export interface IGetSetVerticesData { isVerticesDataPresent(kind: string): boolean; getVerticesData(kind: string, copyWhenShared?: boolean): any[]; getIndices(copyWhenShared?: boolean): number[]; setVerticesData(kind: string, data: any[], updatable?: boolean): void; updateVerticesData(kind: string, data: any[], updateExtends?: boolean, makeItUnique?: boolean): void; setIndices(indices: number[]): void; } export class VertexData { public positions: any[]; public normals: any[]; public uvs: any[]; public uvs2: any[]; public uvs3: any[]; public uvs4: any[]; public uvs5: any[]; public uvs6: any[]; public colors: any[]; public matricesIndices: any[]; public matricesWeights: any[]; public indices: number[]; public set(data: any[], kind: string) { ...Then when update is requested, check if instanceof Array<number>, and only then make a throw away typed array for transmission, otherwise it is already in transmission form. All existing code should work, but this will have the following advantages: Whatever type you give SetVertexData() is what will get saved (by reference). updateVerticesDataDirectly() can be removed or depreciated. I could morph verts as float32Array using SIMD & dirty bones in the same frame, & still go the cpu bone update route.In my Morph 2.0, under dev, I would directly set the VertexData elements directly (they are public) when also doing a bone interpolation in the same beforerender call to avoid double transmission. When morphing only, just call updateVerticesData(), and it should behave as updateVerticesDataDirectly() would. One other note, could not the need to use the cpu bone update be detected using EngineCapabilities? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 5, 2015 Share Posted October 5, 2015 I see no issue with this as this is just related to types (so mainly a TS problem) Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted October 5, 2015 Share Posted October 5, 2015 Will do, not sure when. I see that there is a MAX_VERTEX_UNIFORM_VECTORS capability https://www.browserleaks.com/webgl . Would this work? Could put a method on skeleton like requiresCPUProcessing() if so. Have not completely thought this out, just trying have a way that this could be figured out at runtime, not hardcoding. I am probably not a good choice for this part. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 5, 2015 Share Posted October 5, 2015 The issue is that the skeleton is not aware of other options active on the material (emissive, diffuse? textures, etc..) so this is not possible 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.