- Home /
Get color of pixel before pass: prefer cg, shaderlab is last resort
I want to get the color of a pixel in one pass, save this color to a color object and then use it in another pass. I heard shaderlab can have problems on certain graphics cards/chips when using grab pass, so this is why I want to prefer cg if I can.
I tried using grabpass("_Texture") to store this information, but I think this is the entire screen and not the pixel. This is also a sampler2D object and I am unsure how to get the color of a sampler2D. I believe I also need the pixel coordinates I am rendering, so would I need this in my structs?
I also want to avoid surface shaders (as I am not using light and my object is flat colored).
How do I get a pixel that makes up an object this shader is made up of, and grab the color that the pixel was prior, and then save this color to use for a later pass?