I am trying to send video camera data to my shader at runtime. (Also, tried with just a plain video) Everything works great in the PC version but when I build to android all I get is a grey screen. Here is the code I have in the frag section. Any idea why this is not working on Android? Also did not work on WebGL.
float4 frag (v2f i) : SV_Target
{
float4 back = tex2D(_BufferTexture, i.uv);
float4 front = tex2D(_Buffer2Texture, i.uv);
float4 change = (front - back);
return change;
In the camera script I have
void Update () {
if (Cam.didUpdateThisFrame)
{
Graphics.CopyTexture(Cam, _Buffer2Texture);
//I also update the BufferTexture but a frame back
}
}
I only posted the relevant parts of the code.
Thanks