[SOLVED] Loading a cubemap that is needed for a material that is loaded

I’m loading different materials before a scene is shown up. That works well.
Now I want to find out if a cubemap tied to one of these materials also needs to be loaded.

When an asset with the type ‘material’ is succesfully loaded I try to get the cubemap Id or the cubemap itself tied to this material. Then I want to check if the cubemap needs to be loaded.

When I console.dir the material I could see the cubemap id in _data
When I console.dir the resource of the material it shows _cubeMap: null

I did not find a way so far to read the id or get my hands on the cubemap to check if its loaded or not?

Any help?, thx in advance

Hi @jro ,

Any chance you can share a test project that pinpoints where and how you’re checking?


Hi @slimbuck

Thank you for your reply.
Found the answer. This is how I could get to the cubemap Id that is used for an asset material:
console.log('Material: ' + assets[i].name);
console.log('cubemap Id: ' + assets[i].data.cubeMap);