I want to create a shader that will grab a pixel color by the object position
Basically Texture2D.GetPixel(transform.position.x,transform.position.z)
, but in shader.
I want to create a shader that will grab a pixel color by the object position
Basically Texture2D.GetPixel(transform.position.x,transform.position.z)
, but in shader.
You need a SampleTexture2D node to get pixel color in texture, Use Position Node as a sample uv, the Position will give a 3d vector, you can use Split node and Combine node to extract the axis you want and recombine them, then connect it to the UV socket on SampleTexture2D node.