Hersir Posted June 21, 2017 Share Posted June 21, 2017 Hi, Someone have tried to use LegacyPbrMaterial with webpack? I copied file babylon.legacyPbrMaterial.min.js and made import in project (import "babylonjs/babylon.legacyPbrMaterial") but after that I get error Uncaught ReferenceError: __extends is not defined at babylon.legacyPbrMaterial.js:1 at BABYLON (babylon.legacyPbrMaterial.js:1) at Object.exports.byteLength (babylon.legacyPbrMaterial.js:2) at __webpack_require__ (bootstrap 3ce2b0a…:19) I have same erro if i try ti use inpsector. I am missing some config for webpack or typescript? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 21, 2017 Share Posted June 21, 2017 Ping @Sebavan Quote Link to comment Share on other sites More sharing options...
Sebavan Posted June 22, 2017 Share Posted June 22, 2017 never tried with WebPack. Could you not use the new one ? (agree it is bleeding edge but should be fully stable next month. Quote Link to comment Share on other sites More sharing options...
Hersir Posted June 22, 2017 Author Share Posted June 22, 2017 @Sebavan yes I had some issues with new one , I create PBR in babylon file like this { customType: "BABYLON.PBRMaterial", name: "Material name", id: "material id", reflectionTexture: { customType: "BABYLON.HDRCubeTexture", name: "environment.hdr", isBABYLONPreprocessed: true, hasAlpha: 0, level: 1, coordinatesMode: 3, }, microSurface: 0.9, reflectivityColor: [0.8, 0.8, 0.8], albedoColor: [0.02, 0.02, 0.02], environmentIntensity: 0.5 } But it was complaining that this is legacy one and I need to import it. After checking code I found that if (parsedMaterial.customType === "BABYLON.PBRMaterial" && !parsedMaterial.overloadedAlbedo) {} overloadedAlbedo should be added to material to not use legacy one, but I didn't found how to add it in babylon file. Quote Link to comment Share on other sites More sharing options...
Hersir Posted June 22, 2017 Author Share Posted June 22, 2017 Shouldn't it be if (parsedMaterial.customType === "BABYLON.PBRMaterial" && parsedMaterial.overloadedAlbedo) {} instead of if (parsedMaterial.customType === "BABYLON.PBRMaterial" && !parsedMaterial.overloadedAlbedo) {} ? Quote Link to comment Share on other sites More sharing options...
Sebavan Posted June 22, 2017 Share Posted June 22, 2017 sounds like it :-) i ll fix it quickly... or could you create a PR Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 22, 2017 Share Posted June 22, 2017 I did it Hersir 1 Quote Link to comment Share on other sites More sharing options...
Sebavan Posted June 22, 2017 Share Posted June 22, 2017 @Deltakosh i love when that happens and i am in the bus :-) GameMonetize 1 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.