Hello there,
I have a basic cube object with a RenderTexture assigned to it that acts as a monitor. I would like the monitor to light up the nearby area based on what the screen shows, so my first thought was to simply get the average colour of the RenderTexture via the shader i am using and get that from a script.
I ended up using a public colour property named _AvgColour and at the end of the surf function i called
_AvgColour.rgb+=(_AvgColour.rgb+c.rgb)*0.5f;
where c is the colour of the current texel. Unfortunately that doesn’t seem to modify the _AvgColour property at all. How else would i be able to calculate the average colour of the camera’s RenderTexture each frame?