Yeah, I find the correct way to draw the shadow map texture on the plane, thanks for your answer.
However,there is still a question that the shadow quality is very low, I set shadow map size 2000 * 2000, is there other way to improve the shadow quality?
now the shadow is look like this:
Hey @vaing4723, I don’t know if you had solved this problem. And I met the low quality image too. I figure out it’s a problem about devicePixelRatio. try the code below:
let expectedWidth = 512
let expectedHeight = 512
let devicePixelRatio = window.devicePixelRatio
canvas.style.width = expectedWidth*devicePixelRatio
canvas.style.height = expectedHeight*devicePixelRatio
canvas.width = expectedWidth*devicePixelRatio
canvas.height = expectedHeight*devicePixelRatio
var context = canvas.getContext( '2d' );
renderer.setSize(expectedWidth, expectedHeight)
renderer.render( scene, camera );
context.drawImage( renderer.domElement, 0, 0);
canvas.style.width = expectedWidth
canvas.style.height = expectedHeight