Jump to content

Can you have more than one manifest file?


JCPalmer
 Share

Recommended Posts

The Multi-platform Compressed Textures, or Intelligent Texture Selector (cannot decide on a name) is currently not available when you use a manifest along with a .babylon file.  And for good reason,  If you do not know if a given file will end up being mytexture-dxt.ktx, mytexture-astc.ktx, mytexture-pvrtc.ktx, mytexture-etc1.ktx, or mytexture-etc2.ktx, how can you list it in a manifest?  unless you make 5 variations of the manifest.

I personally do not use manifests, but thinking I might be able the 2 to work together if very early you execute something like:

var available = ['-astc.ktx', '-dxt.ktx', '-pvrtc.ktx', '-etc2-.ktx', '-etc1.ktx'];
var formatUsed = engine.setTextureFormatToUse(available);

Once you have the format to use for this hardware / browser, you would then know which manifest version to use.  Bringing me back to the original question.

Link to comment
Share on other sites

The documentation  on manifest files does not specify that you need to enumerate each texture file, just whether you want them to be saved or not.  So looks like I will be ripping that restriction out.  Not much of a manifest (though it means I probably do not have a problem).  I was imagining a Java like manifest built-into a .JAR / .APK file.

Link to comment
Share on other sites

Yes, on iOS the client would pull mytexture-pvrtc.ktx, or mytexture-astc.ktx  if Apple exposes it.  (They do astc for Metal).  On Windows,  mytexture-dxt.ktx  would get pulled.  

Since the manifest does not itemize, it will never know / care.  Thinking about it a Java .JAR or Android .APK (just a renamed JAR) only itemizes so that it can be digitally signed with some files signed with one certificate & others a different cert.

Link to comment
Share on other sites

Screw a manifest, so what you want is different texture packs to load depending on the webgl context availabe?

 

mmkay when you initialize your scene you need to establish what client you got which is like window.f@@@iforgot or navigator.stillforgot and just if the client, from there when you build your scene have a secondary function that's just for your creation of your prefabs and materials and just have a switch in that function for the different clients.  Downside is there is extra script, plus side is once you have done it 20 times I'm sure your gonna figure out a nifty recursive loop to handle it for you.

 

im kinda doing the same thing in legends of bjs, here I'll hot spot my phone to my rig and pm you a section of it, please do not share with anyone else but it will show you how to assign the mats like I'm talking about, all you would need to do is toss in the client switch.

Link to comment
Share on other sites

Thanks, but I already implemented this in engine by detecting which WebGL extensions are present.  Unfortunately, I thought manifest itemized so I turned it off.  Have already taken that out on my version.

You just run a script I wrote (not published yet) that goes thru a directory and writes out 5 variants of every .JPG or .PNG in batch, calling PVRTexTool.

In your scene, just call engine.setTextureFormatToUse() as shown above.

Link to comment
Share on other sites

That's pretty cool, and prolly saves on head by not calling every possible instance of the textures and reserving them then? Cause I assume it they get lost and cleared out after your PVR tool parses them correct?

 

I am very interested in this.

Link to comment
Share on other sites

The PVR tool, creates files in other formats.  These compressed texture formats are quite cpu intensive to CREATE.  I am working with the mansion demo with 100 .jpg & .png.  On highest quality setting, the script ran for over 3 hours & floored all my i5 cores.  So they are permanent files on your web server.  Disk space is not really an issue today.  After examining the extension present & comparing with you say you have on your server, the image files are replaced with variant files.

The textures themselves save a lot of memory on the device, get better Soc cache utilization, etc.

Link to comment
Share on other sites

@davrous, I have tiny original test scene, source: https://github.com/Palmer-JC/Palmer-JC.github.io/tree/master/scenes/compressedTextures

Unfortunately, I did not generate it from a .babylon file .  I have just fixed the compressed textures are upside down problem (another topic which I will be responding to next) using the full scale Mansion demo scene.  It is going to be up on my github "blog" by tomorrow (need to regenerate 105 image files in 5 formats).  If a manifest is just a few lines, I was going to toss one here and see what happens.  You may need to run it yourself, because I do not know how to test for success / failure.

Link to comment
Share on other sites

@JCPalmer how do you plan to integrate this logic while loading a .babylon file? It's currently not integrated in our loader logic neither in the file format. 

Currently the manifest asking to use the IDB layer is only available for loading .babylon files. 

My guess is you would need to modify our file format: http://doc.babylonjs.com/generals/File_Format_Map_(.babylon)#textures and be inspired by something like the cubeTexture: https://github.com/BabylonJS/Babylon.js/blob/master/src/Materials/Textures/babylon.cubeTexture.ts

On my side, as long as you ended up calling either Tools.LoadFile or Tools.LoadImage, you'll go through the IDB layer. 

In your case, your logic is testing the texture supported and will always load the same file. So, the LoadFile method will simply inject that into the DB. Am I missing something?

Link to comment
Share on other sites

@davrous, I was only asking for .babylon files.  What you may be missing is that I perceived that a manifest itemized all the files being downloaded, from my experience elsewhere.  Since I am switching out the name of the texture file in the .babylon at the last minute,  my first PR of this restricted using this feature when also using a manifest.  Yes, On a given device & browser, the version of the texture will always be the same.

I have since ripped out that checking for the clean up PR, I will be doing.  This topic was started to see how to get around "the problem".  Answer: there is no problem.

Link to comment
Share on other sites

Anyone know why this scene does not appear to be using the manifest?  I try it from FireFox, where you can set in options to prompt for permission & manage offline files.  I did not get a prompt, & it does not show as stored offline.  Does load pretty fast 2nd time, but suspect it is just normal browser cache.

Source.  Many files, scroll to Manoir.

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...