Is there a way to get the asset names of the texture maps that make up a material? What I’m currently doing is on the asset ‘load’ event, I try to fetch the texture maps, ie materialAsset.resource.diffuseMap
and despite these materials being “loaded” all that returns is this placeholder texture with the name “placeholder”. Adding a delay using setTimeout
does fix this issue, but setTimeout
is already unreliable and I know load times vary greatly so I’d really prefer not to rely on it.
This is the “placeholder” texture object that returns on materialAsset.resource.diffuseMap
on the material asset ‘load’ event trigger:
_addressU: 0
_addressV: 0
_addressW: 0
_anisotropy: 1
_compareFunc: 1
_compareOnRead: false
_compressed: false
_cubemap: false
_depth: 1
_flipY: true
_format: 7
_glFormat: 6408
_glInternalFormat: 32856
_glPixelType: 5121
_glTarget: 3553
_glTexture: WebGLTexture { }
_gpuSize: 20
_height: 2
_invalid: false
_levels: Array [ Uint8Array(16) ]
_levelsUpdated: Array [ false ]
_lockedLevel: -1
_magFilter: 1
_minFilter: 5
_mipmaps: true
_mipmapsUploaded: true
_needsMipmapsUpload: false
_needsUpload: false
_parameterFlags: 0
_premultiplyAlpha: false
_volume: false
_width: 2
device: Object { _enableAutoInstancing: false, autoInstancingMaxObjects: 16384, attributesInvalidated: false, … }
fixCubemapSeams: false
name: “placeholder”
profilerHint: 0
type: “default”