I need to write an automatic white balance shader for a project, and for it to work, I need the whitest point of the image. I already tried to copy the RenderTexture into a Texture2D, but I got down to 7 FPS, since I'm doing this for every rendered image. I have to do this for every rendred image since it is a realtime realistic camera simulation, and performances are an important aspect of the project.
I thought using the shader's properties to do so, and getting the white point in the C# using GetFloat after browsing the whole image, and sending it to the shader for the balancing in another pass, but since the RGB values needed change in the vertex shader, I have no way to keep the modified property and send it to the C# script, as the modified value stays on the GPU.
This question might be confusing, and I apologize for that.
Thanks in advance for your answers.
↧
Can I get the whitest point of an image within a shader, and use it for white balancing the image?
↧