Jump to content

How to solve "too many uniforms" problem??


MasterK
 Share

Recommended Posts

Is this using the a UNMODIFIED  StandardMaterial and 'default' vertex and fragment shaders...  

Because i use a ton of uniforms (basically all the PBR uniforms plus a Universal Material uniforms) for my splatmap and i was concerned about that many number of splats on a large terrain... And it works great on Chrome (My primary dev browser)... but also Safari, Firefox, Opera, Mobile Android, My Xbox One (using Edge) and is work smooth as heck ... so far (even though i have NOT got all the bumping working)... But i do have all the additional 'Infos' and 'Matrix' uniforms for the 4 additional splatsmaps, 12 additional diffuse texture and 12 additional bump textures... That a whole lot more the the uniforms the 'default' shader is using.

So you gonna have to give more info, maybe make a quick video showing your whole problem and maybe we can pin point the problem :)

Also.. What version of Babylon.js are you running... 2.6 preview has had ALOT of general WebGL work... If not already using 2.6 try your scene with 2.6 had see what happens.

UPDATE: Sorry guys i MISS SPOKE about the available textures in IOS... I guess i only test iOS with 1 set of splats and normals. Im working on scaling back functionality for IOS But there is a TEXTURE limit ... and uniform limit... But that uniform limit is pretty high... i don't think your actually using too many uniforms... must be something with the browser implementation of webgl... Sorry i coundnt be more helpful :(

@MasterK Hope you got something from it.

Link to comment
Share on other sites

I think I'm using almost latest bjs version.about 2 month ago from github master.

it shows bone 67. Maybe it because the 3D model's sketlon animation problem?

it seems 10% Chrome will meet this error. And same computer's Firefox works fine. The chrome version is latest too.

i think the display card driver not right? 

Link to comment
Share on other sites

67 is a very unfortunate number.  Many android devices support a theoretical max of 64 bones.  The actual number depends on # lights, etc, so plan on subtracting maybe 8 for other stuff. iOS's max is 32.  I have not looked at your facebook link as a login was required, & I do not allow complete time waster stuff on my business machine.  Guessing, I suggest you delete your finger bones regardless of a change which might be made to software skinning.

As WebGL 2.0 becomes available on iOS / Android (heard Apple is breaking out the turtle necks soon for new iPads), BJS 3.0's use of Vertex Uniform buffers might get around this problem.  I was fishing thru the PR stream today, but could not find when this got added or how.  If your BJS does not say 3.0-alpha it is too old though.

Link to comment
Share on other sites

On 3/6/2017 at 7:39 AM, Deltakosh said:

@JCPalmer is right: 67 bones is a lot but @MasterK was also right: there were a bug in the fallback mechanism :)

But BabylonJS handles 65 bones real nice like... I showed a video recently using animated characters using 65 bones with very long animations (500 plus frames)... so that means there are five hundred key frames who's value is the bones transformation Matrix info for each of the 65 bones... still works great ... all 65 bones from re-skined mixamo rig (using my Maya Art Tools) ... Smooth animations 60 fps even multiple characters (not optimized to share any bones or anything)...  BabylonJS is FREAKING AWESOME :)

 

Link to comment
Share on other sites

9 hours ago, BitOfGold said:

@MackeyK24 Can I find your Splatmap material somewhere? :)
 

As soon as me and @MrVR get some kinda updated documentation ... all will be available on the babylon.js github (including any Extensions i have created to support babylon.js found in the BJS Extensions github)

Note: I just , not minutes ago, wrapped up the latest U3D - BabylonJS Editor Toolkit - Version 1.0.1

and sent to @MrVR so he can start going thru all the new features with me and we basically starting all over documenting features (cause so many changed... Much better implementations of basically EVERYTHING in the toolkit.) It is a fully functional 'BabylonJS Game Development Editor For Unity'

Hopefully we will get this done VERY SOON, I know @Deltakosh will be happy when the docs are done :)

 

Link to comment
Share on other sites

9 hours ago, BitOfGold said:

@MackeyK24 Can I find your Splatmap material somewhere? :)
 

BTW... my new builtin Unity Toolkit Terrain system ... now fully packs a forth texture into the splatmap alpha channel... Seemed like a waste to not use the alpha channel that was just sitting there going to waste... so now can use up to 16 textures and 1 or more bump samplers (max 16) on any one or more splats... Real nice detailed terrains using pre-made Unity Terrain assets from asset store now possible... :)

 

Link to comment
Share on other sites

9 hours ago, BitOfGold said:

@MackeyK24 Can I find your Splatmap material somewhere? :)
 

But if you wanna take a look at the actual shader code i used to do all this (But i don't use a specific SplatmapMaterial like before... I now use my UniversalShaderMaterial in the unity toolkit for ALL babylon JS shaders (that are not PBR or Standard)... Including the built-in terrain system)... but you should be make out what additional (Beside the regular PBR pipeline) material properties i am pumping into shader from the vertex and fragment sections... anyways here is my actual shader code:

UnitySplatmap.shader

Note: Vertex and Fragment sections are contained in the .shader files

Link to comment
Share on other sites

5 minutes ago, MackeyK24 said:

BTW... my new builtin Unity Toolkit Terrain system ... now fully packs a forth texture into the splatmap alpha channel... Seemed like a waste to not use the alpha channel that was just sitting there going to waste... so now can use up to 16 textures and 1 or more bump samplers (max 16) on any one or more splats... Real nice detailed terrains using pre-made Unity Terrain assets from asset store now possible... :)

 

Nice men, I as well have a new Spline tool to create bezier paths and export the points to Babylon. helpfully will be complete it by the toolkit release .

Im gonna start testing all this features right way ..

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...