Pierre Glibert

Members
  • Content count

    83
  • Joined

  • Last visited

About Pierre Glibert

  • Rank
    Advanced Member

Contact Methods

  • Website URL
    http://www.letsbrostudio.com/portfolio/
  • Twitter
    letsbrostudio

Profile Information

  • Location
    Belgium
  1. Hi community After an export from 3dsmax to gltf, I saw that my metallic/roughness map is to much compressed in jpeg. That create bad artefact on my render. Secondly, I saw that my color map switch from jpeg to png. I have no transparency, it's not necessary in my case. I prefer to keep a little compression for time loading reason. Is there a way to correct this ? Is it possible to add an option like a checkbox "compress", on the exporter, to not compress or compress images ? Thanks for your help. Pierre.
  2. AssetManager & sceneOptimizer contribution

    Yes but impossible to do if the first part is not possible to apply ... That should be a big change and it break the code. It's a different way to link textures to material for rendering ...
  3. AssetManager & sceneOptimizer contribution

    hello @Deltakosh I will simplify my code because I can't do what I want. I need too much solutions that will break the code. For exemple, the only solution to resize a texture is create all size of texture and update url at this moment. The tool createResizedTexture return a RTT ... So I need to make a loop in scene.materials and use it on all channels to apply it. ( Not really optimized compared to an array of textures) The risk is to optimize the same textures more that once time. To prevent this, I can create a new class to reference all textures to know if it's already optimized... But it's a new class above the texture class. That mean I need an Material observable that return the material and the channel updated if the user add a new textures on the fly. For me, it's not a solution. Perhaps later. Anyway, perhaps this will interest you : https://github.com/pierreglibert/Extensions/blob/master/gradingSceneOptimizer/ts-optimizer/userInfos.ts Thanks for your help during all of this time and happy 11000 posts ! Ps : In the previous post, the '.updateSize()' was an exemple of an new fonction to resize the texture and switch it directly. It was not the current updateSize that change the size of the texture and not the size of the content.
  4. [solved] scene loader wrong error

    ok thanks
  5. [solved] scene loader wrong error

    Hello everyone, It's impossible to know where is the error when we use sceneLoader : http://www.babylonjs-playground.com/#155HJ6#1 Is it possible to fixe it ? Thanks
  6. AssetManager & sceneOptimizer contribution

    hi @Deltakosh I saw that assetManager use "IAssetsProgressEvent" for onProgress function : https://github.com/BabylonJS/Babylon.js/blob/master/src/Tools/babylon.assetsManager.ts#L149 It give us the number of task loaded but it will be cool to have the data loaded in stream like SceneLoaderProgressEvent : https://github.com/BabylonJS/Babylon.js/blob/a86a04b640f8f25bb4a1ed86067ce735a404979b/src/Loading/babylon.sceneLoader.ts#L2 https://github.com/BabylonJS/Babylon.js/blob/master/src/Tools/babylon.assetsManager.ts#L694 If we add onProgress (type : SceneLoaderProgressEvent ) on all task type and replace "IAssetsProgressEvent" on assetManager, it will be possible to do that. we need onAbort function too to cancel task. It's better for user experience. Do you think it's possible to change it ? Thanks in advance PS :https://doc.babylonjs.com/babylon101/particles#gpu-particles Awesoooooome work EDIT : I want to talk about performance with you. At this moment, BABYLON work like this : Material.diffuseTexture = texture // ( type texture ) why not use an index like this with a setter and getter : /** * in MATERIAL class */ private _cacheDiffuseTexture: number; private _scene: Scene; // setter set diffuseTexture(newTexture: Texture){ this._cacheDiffuseTexture = newTexture._cacheIndex; } // getter get diffuseTexture() { if(this._cacheDiffuseTexture) { return this._scene.textures[this._cacheDiffuseTexture]; } return null; } /** * in TEXTURE class */ private _cacheIndex: number; private _scene: Scene; // example of updateSize function updateSize(size: number, dispose? : boolean) { scene.textures[this._cacheIndex] = new BABYLON.Texture(...); this.dispose(); } With this method, we can easily switch texture on the fly. For exemple, if we need to update ALL textures, we just need to do this : for(var i = 0; i < scene.textures.length; i ++) { scene.textures[i] = scene.textures[i].updateSize(512); } I did the exemple with scene.textures but we can apply this on several things in BABYLON. Of course, It's just an idea. Perhaps, it's already done or wrong method In fact, I tell you that because I saw this : https://github.com/BabylonJS/Babylon.js/blob/master/src/Materials/Textures/babylon.internalTexture.ts#L341
  7. AssetManager & sceneOptimizer contribution

    Yes exactly. I work on the new optimizer that will replace the old. The easiest way to explain what I do is to read the doc. I should have told you before All doc is here : https://github.com/pierreglibert/Extensions/tree/master/gradingSceneOptimizer Little old demo : demo.mp4
  8. AssetManager & sceneOptimizer contribution

    Hello @bghgary For example, I need to reload texture with different size. Url : assets/myTexture.256.png assets/myTexture.1024.png assets/myTexture.2048.png With this url, I can capture "assets/texture" and add the size I want to reload We can do what you said : Keep the asset url, load with a Blob and update it when canceled or loaded ... Is it possible and easy to do for you ?
  9. AssetManager & sceneOptimizer contribution

    @efxlab http://www.babylonjs-playground.com/#SBKGT0 If you are some others questions, open a new topic and ping me
  10. AssetManager & sceneOptimizer contribution

    @efxlab What do you try to do ? Can you create a playground ? http://www.babylonjs-playground.com/
  11. AssetManager & sceneOptimizer contribution

    Hi @Deltakosh & @bghgary I have one last question about the URL issue : What's the difference between .babylon and .gltf loader about texture and blob url ? Because, when I load a .babylon, I have the right url of the asset but not with a gltf ... I see that .babylon loader use engine.createTexture() : https://github.com/BabylonJS/Babylon.js/blob/master/src/Engine/babylon.engine.ts#L3133 then tools.loadImage() https://github.com/BabylonJS/Babylon.js/blob/master/src/Tools/babylon.tools.ts#L485 It return an internalTexture. For .gltf loader, you use your own image loader : https://github.com/BabylonJS/Babylon.js/blob/master/loaders/src/glTF/2.0/babylon.glTFLoader.ts#L1329 So, if I understand you don't use engine.createTexture() because "onProgess" not exist on the returned internalTexture... That's why you created your own image loader ? If it's that, like you said, we need to add some observable on internalTexture : onProgess, onAborted, ... I think that it would be good to use same method for all loader ... What do you think ? @efxlab We need the right url to do that ... We will fixe this Have a nice day PS : @Deltakosh The reset function for particle work fine ! thanks
  12. AssetManager & sceneOptimizer contribution

    ok I see ... Can you send me the line where the blob is created ?
  13. AssetManager & sceneOptimizer contribution

    @bghgary did you try this ? var xobj = new XMLHttpRequest(), percentage; xobj.open('GET', yourUrl, true); // progress xobj.onprogress = (e) => { // to get % percentage = Math.round((e.loaded / e.total) * 100); onProgressCallback(e); }; xobj.onreadystatechange = function () { // loaded if (xobj.readyState === 4 && xobj.status === 200) { onLoadedCallback(); } // error else if (xobj.status === 404) { onErrorCallback(); } // onAbort else if (xobj.status === 0) { onAbortCallback(); } }; xobj.send(null); Like the first post of this topic, you will see that we need to add the code above for loading function and assetmanager in Babylon. Did you use loading system of babylon ?
  14. AssetManager & sceneOptimizer contribution

    Yes, I find it here https://github.com/BabylonJS/Babylon.js/blob/master/loaders/src/glTF/2.0/babylon.glTFLoader.ts#L1344 I searched too on "Babylon.js/src/Loading/" but there is no Blob call. In fact, I see this "blob problem" while I tested gltf... So... hello again @bghgary Can you help me ? Why do you use blob ?
  15. AssetManager & sceneOptimizer contribution

    1. #superman 2. Yes of course, but is it babylon that creates the blob ? if yes, we can save the asset url before ... 3. ok.