Hot to use RenderTargetTexture to get result of custom material

Oh no, I want to implement whether the calculation point in the shader is within a rectangular box, and output the result to the texture and extract it on the CPU side

I searched for relevant information and saw a similar link

about

What’s a simple way to do a compute shader without WebGPU?

Compute shaders are not supported in WebGL. You can do a RTT pass and fill your texture by the fragment shader.

I am too new to know how to implement it. It would be great if there were relevant examples