renderer.domElement.toDataURL(type,encoderOptions) missing texture

Hello,there!
I’m doing some snapshot function.

snapShot(type="image/jpeg",encoderOptions=0.92){
    return this.renderer.domElement.toDataURL(type,encoderOptions);
}

This works but missing some textures.


The black spot is the missing texture position.

Maybe you perform the snapshot before the texture has been fully loaded?

1 Like

A partial code out of context, it is not much to go on.

Before capturing data, make sure you call renderer.render(scene, camera) to populate the buffer.

Yes,call renderer.render first.Mugen has solved this,the texture wasnt fully loaded

Ah!Yes!Silly me,give it a few seconds,i have the textures now.Huge thanks!

1 Like