So, I’m on my way to recreating something similar to the PowerWash Simulator. I already have the painting/erasing from surfaces part done. What I have to do now is read the average color from the mask render target. I have a render target that uses white or black for masking the material of the surface. I tried some things like directly reading the pixels from it using “Read render target pixel,” but it’s a really heavy operation and affects a lot of the performance. I also tried rendering the RT into another RT that is 1x1 pixel, but this only gets the pixel from the corner, and even reading only 1 pixel per second is a heavy task for the GPU and CPU. I also tried using CPP and the Auto Generate MipMaps from the RT, but using that option caused the mask to disappear in the distance and didn’t quite work with CPP.
If someone has the solution for this, I would appreciate it a lot, thanks!
Checking with my peers, we think your logic is close, changing the order on how the render target is done might be the fix.
As you mentioned, Read Render Target Pixel is quite heavy, but that’s regardless of it scanning 1 pixel or 10k, so it won’t matter how much is in front of it. Instead, test by adding an intermediate step:
Leave your RT mask as it is, with MipMaps disabled
Add another RT in the middle, same size as the mask, and make it a Float, with Auto Generate Mips set to On