Hello,
When you serialize an object that has received a textureVideo, the object is serialized and the textureDiffuse also. But without the video.
IF I reload this object serialized that I save in a file. when reloading, assetManager looks for the video texture by taking the object’s materialID reference and has an image name that does not exist because the videoTexture saved a name and not a “textureName.jpg”.
In short, an error is generated because the diffuseTexture material has missing data sought.
Error: Failed to load resource: the server responded with a status of 404 (Not Found) GET http://127.0.0.1:8080/meshes/Video0 404 (Not Found)
I do not know if what I’m saying is clear. I try to reproduce on a PG, but assetsManager.addMeshTask(“task”, “”, “”, “data:”+serialization); does not work.
Example of the serialized file I have: (I put the interesting parts in bold)
{
“materials”: [{
“tags”: null,
“diffuseTexture”: {
“tags”: null,
“uOffset”: 0,
“vOffset”: 0,
“uScale”: 1,
“vScale”: 1,
“uAng”: 0,
“vAng”: 0,
“wAng”: 0,
“uRotationCenter”: 0.5,
“vRotationCenter”: 0.5,
“wRotationCenter”: 0.5,
“isBlocking”: true,
“_generateMipMaps”: true,
“uniqueId”: 226,
“name”: “Video0”, <= Error here
“hasAlpha”: false,
“getAlphaFromRGB”: false,
“level”: 1,
“coordinatesIndex”: 0,
“coordinatesMode”: 0,
“wrapU”: 1,
“wrapV”: 1,
“wrapR”: 1,
“anisotropicFilteringLevel”: 4,
“isCube”: false,
“is3D”: false,
“gammaSpace”: true,
“invertZ”: false,
“lodLevelInAlpha”: false,
“lodGenerationOffset”: 0,
“lodGenerationScale”: 0,
“linearSpecularLOD”: false,
“isRenderTarget”: false,
“animations”: ,
“invertY”: true,
“samplingMode”: 3
},
“ambient”: [0, 0, 0],
“diffuse”: [1, 1, 1],
“specular”: [1, 1, 1],
“emissive”: [0, 0, 0],
“specularPower”: 64,
“useAlphaFromDiffuseTexture”: false,
“useEmissiveAsIllumination”: false,
“linkEmissiveWithDiffuse”: false,
“useSpecularOverAlpha”: false,
“useReflectionOverAlpha”: false,
“disableLighting”: false,
“useObjectSpaceNormalMap”: false,
“useParallax”: false,
“useParallaxOcclusion”: false,
“parallaxScaleBias”: 0.05,
“roughness”: 0,
“indexOfRefraction”: 0.98,
“invertRefractionY”: true,
“alphaCutOff”: 0.4,
“useLightmapAsShadowmap”: false,
“useReflectionFresnelFromSpecular”: false,
“useGlossinessFromSpecularMapAlpha”: false,
“maxSimultaneousLights”: 4,
“invertNormalMapX”: false,
“invertNormalMapY”: false,
“twoSidedLighting”: false,
“id”: “MaterialForVideo0”,
“uniqueId”: 225,
“name”: “MaterialForVideo0”,
“checkReadyOnEveryCall”: false,
“checkReadyOnlyOnce”: false,
“state”: “”,
“alpha”: 1,
“backFaceCulling”: false,
“sideOrientation”: 1,
“alphaMode”: 2,
“_needDepthPrePass”: false,
“disableDepthWrite”: false,
“forceDepthWrite”: false,
“separateCullingPass”: false,
“fogEnabled”: true,
“pointSize”: 1,
“zOffset”: 0,
“wireframe”: false,
“pointsCloud”: false,
“fillMode”: 0
}],
“geometries”: {
“boxes”: ,
“spheres”: ,
“cylinders”: ,
“toruses”: ,
“grounds”: ,
“planes”: ,
“torusKnots”: ,
“vertexData”: [{
“id”: “20d679e6-11ef-4889-a6c7-79f2bbbff631”,
“updatable”: false,
“positions”: [-0.5, -0.5, 0, 0.5, -0.5, 0, 0.5, 0.5, 0, -0.5, 0.5, 0],
“normals”: [0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1],
“uvs”: [0, 0, 1, 0, 1, 1, 0, 1],
“indices”: [0, 1, 2, 0, 2, 3]
}]
},
“meshes”: [{
“name”: “Video0”,
“id”: “Video0”,
“type”: “Mesh”,
“position”: [-11.987348797801301, 0.5099999997764826, 7.238914597717875],
“rotation”: [0, 0, 3.14],
“scaling”: [1, 1, 1],
“localMatrix”: {
“0”: 1,
“1”: 0,
“2”: 0,
“3”: 0,
“4”: 0,
“5”: 1,
“6”: 0,
“7”: 0,
“8”: 0,
“9”: 0,
“10”: 1,
“11”: 0,
“12”: 0,
“13”: 0,
“14”: 0,
“15”: 1
},
“isEnabled”: true,
“isVisible”: true,
“infiniteDistance”: false,
“pickable”: true,
“receiveShadows”: false,
“billboardMode”: 0,
“visibility”: 1,
“checkCollisions”: false,
“isBlocker”: false,
“isUnIndexed”: false,
“geometryId”: “20d679e6-11ef-4889-a6c7-79f2bbbff631”,
“subMeshes”: [{
“materialIndex”: 0,
“verticesStart”: 0,
“verticesCount”: 4,
“indexStart”: 0,
“indexCount”: 6
}],
“materialId”: “MaterialForVideo0”,
“metadata”: null,
“instances”: ,
“animations”: ,
“ranges”: ,
“layerMask”: 268435455,
“alphaIndex”: 1.7976931348623157e+308,
“hasVertexAlpha”: false,
“overlayAlpha”: 0.5,
“overlayColor”: [1, 0, 0],
“applyFog”: true
}]
}