BabylonJS Vram usage versus Unity

I tried in playground using the inspector but you are right I want to use in in cubemaps

@Escobar This shouldnā€™t be too bad to add, Iā€™ll try to do this today.

1 Like

Iā€™m having alot of difficulty connecting to playgrounds and anything hosted on the babylon server (including preview babylonjs and basis files), took awhile to check it out, but after re-encoding basis with mipmaps it does seem that there is still alot of shimmering going on with distant objects when compared to the png textures. But I canā€™t be the only one seeing this, so i dunno.

Iā€™m pretty sure I am able to see the mip level change but Iā€™ll double check this as well in case iā€™m missing something.

Yep, my mistake, I was loading the mips but told the engine not to look at them :disappointed_relieved: for some reason. This will be in my PR today. Sorry for taking so long to get this working and thanks for catching my bugs.

1 Like

Thank you! Btw there is any chance to store the 6 images on a single .basis texture like its done on dds and other formats?

@Escobar Yep, I think this should be possible using their tool GitHub - BinomialLLC/basis_universal: Basis Universal GPU Texture Codec and the -multifile options although I havnā€™t tried this my self. In Babylon when using their js transcoder I can see that the basis file can contain multiple images and each image can have multiple mip levels. Is that how you generated the file you sent me? For loading cube maps I thought the file would contain 6 images which I would use for the faces.

It was only one face, I tried loading it with
textureSource = new BABYLON.CubeTexture(cameraTextureName, scene, ["_px.basis", ā€œ_py.basisā€, ā€œ_pz.basisā€, ā€œ_nx.basisā€, ā€œ_ny.basisā€, ā€œ_nz.basisā€]);

jpgs are stored in the same folder and worked properly :slight_smile:

image

@Escobar so is everything working now as you expect?

No, unfortunately it works with jpgs but doesnā€™t work with .basic

gotcha, ill see what I can do.

@Escobar it looks like all the loaders in babylon (dds, ktx, env) all work off a single file with multiple images. jpg/png are the exception. Would it be okay if I require your images be packed into a single file? Ill try to make an example on how to do this.

Similar discussion happened for ktx here: KTX texture problem

Thank you for all your hard work @trevordev !

I compiled your changes, but unfortunately, it doesnā€™t seem to work for me, so I will have to wait until @Deltakosh compiles this release preview so I can check those changes out. With the version i compiled the loader is loading forever and if I bypass the loader then this happens.

I tried that

var textureSource = new BABYLON.CubeTexture(ā€œnoga_0000.basisā€, scene);

BJS - [09:17:53]: Texture loader does not support cascades.

Used file (6 faces on a single file) noga_0000.zip (1.5 MB)

Yep create cube in texture loader not done yet, working on this now. Ill make sure your file works after my next PR.

Thank you so much Trevor! Anyway I can adapt myself to any other suggested compression way this time the order was nX pZ pX nZ pY nY acording to something Iā€™ve read on other topic.

From my testing px nx py ny pz nz will work best when mapping to babylonā€™s face index so my change will likely support that.

eg. basisu.exe -file skybox_px.png skybox_nx.png skybox_py.png skybox_ny.png skybox_pz.png skybox_nz.png

This PR should get it to work: loading cube data in basis loader by TrevorDev Ā· Pull Request #6487 Ā· BabylonJS/Babylon.js Ā· GitHub
This playground shows it working once its merged: https://playground.babylonjs.com#NLLVD8#3

Here is px nx py ny pz nz format :slight_smile: noga_0000.zip (1.5 MB)

Just tried it, looks like it works

Nice, is there any way to get notified when that gets deployed into preview?

@Deltakosh might be able to tell you when the next preview will be released