1

How do we know the end of this process can be done?

material.map = new THREE.Texture( canvas ); 
material.map.needsUpdate = true;

Because if not then it is complete snapshot is sometime black result

var snapshotData = renderer.domElement.toDataURL(strMime);

What can be do successfully changed material callback?

Thank you :)

WestLangley
  • 102,557
  • 10
  • 276
  • 276
  • It sounds like you may be having the same problem as http://stackoverflow.com/questions/16066448/three-js-texture-image-update-at-runtime – Rocky Sims Dec 07 '16 at 03:42
  • Thanks for answer me and and sorry for my bad english. but my problem is different because : 1. I not have texture URL, i have only a canvas file. 2. it's not about loading texture , it's about rendering texture. What I really want is how to know when rendering texture is finished for mesh. Thanks you :) – М. Түвшин - заяа Dec 08 '16 at 03:20

1 Answers1

1

You can try putting it inside the onload funtion for checking if the texture is loaded or not

var textureLoader = new THREE.TextureLoader();

var texture = textureLoader.load(texturePath, function()
{
     //the code below executes only after the texture is successfully loaded
     mesh.material.map = texture;
     mesh.needsUpdate = true;

     //write the code to be executed after the texture is mapped 
})

I hope this is helpful.

NikhilSN
  • 43
  • 1
  • 13
  • Hello, Thank you for answer me and sorry for my bad english. Maybe you're understand me wrong. Actually I it's not about loading texturePath, it's about rendering texture. What I really want is how to know when rendering texture is finished. For example, texture is already rendered in mesh. If so I want to do something. I only have a canvas. Thank you for your helps guys. – М. Түвшин - заяа Dec 08 '16 at 03:15