Hi,
I'm trying to learn some more advanced shader techniques and I'm finding that I don't quite know enough to be able to google my problem, here's what I'm trying to do:
I have a shader that simulates a datamosh effect using _CameraMotionVectorsTexture. What it does is it either moves pixels on the screen by their respective motion vector from the motion texture, or it "refreshes" them by lerping between the rendered image and the screen texture using a local value. A value of one for each pixel will just render the image like normal, a value of zero will keep the screen texture and apply the effect. Currently, the lerp value is determined by the distance to a global position in the world, and that position is set with a script. This system works as intended so far.
The problem right now is I can only have one position at a time and I want to have multiple entities producing this refreshing effect. Previously I have implemented this by looping through an array, but for this rewrite I want to have Objects in the world that directly write to some custom texture that my postprocessing shader can access, but looking up things like "Unity shader custom pass" hasn't shown anything that I can seem to use, so I'm probably starting in the wrong place and getting terminologies wrong. Once I have a shader that can quickly switch between the normal rendered image and this custom grayscale effect, I'll know I'm on the right track; are there any resources that can point me in that direction?
Thanks in advance
↧