User texture for decalMap

I was triyng to set some texture for decalMap. This test PG - https://playground.babylonjs.com/#9I8A85#10 - shows no errors but no decalMap as well :frowning:
Also, if you uncomment the line 47 (disposing the texture rendered to the decalMap), the mesh will become completely invisible (still having its material).

cc @Evgeni_Popov

1 Like

This PR will fix the problem:

Note that cloning a texture does not copy the content of the source (internal) texture to the new (internal) texture. So, it’s expected that you don’t see the decal when you use the cloned texture in the new MeshUVSpaceRenderer.

1 Like

Is there a way to use a user texture with decalMap?
Here I tried to use not cloned, but the new created texture, but with no success - https://playground.babylonjs.com/#9I8A85#17

If you supply your own texture, it must be a render target texture, as the system will render the mesh to which you wish to apply a decal. You’ll also need to call renderTexture to apply the decal.

Thank you, now I understand the limitations better :slight_smile: