Is there a way to make the effect of camera clear flags on render texture in URP Unity

119 views Asked by At

I'm making a fog of war effect and I want to use the camera no clear flags method that used to be available to paint the trail of vision for many units. The ability to do the clear flags method seems to have faded and there seems to be little documentation on other options.

What can I do to recreate this method of painting textures in Unity now? The no clear flags option seemed like it was almost for free, as it just didn't clear the previous frame before rendering a new one. Now it seems I would have to make a system of painting pixels, which would be quite taxing for multiple objects each frame.

Alternatively I've looked at doing vertex painting systems, but again, for hundreds of objects at once, that would be terribly inefficient.

I have the feeling that I could do some magic with making some render features in URP to do it, I would have to learn that side of Unity some more. I also have the feeling that a shader could manage it too. But I'm not sure if I should somehow multiply the latest frame with the first frame perpetually? I don't know how I would access the latest frame from a render texture, while keeping an original to multiply it with.

I've tried Uninitialized background type on my render texture camera, but it renders a white background. I've tested rendering other objects and it doesn't seem to do what the no clear flags method did anyway.

0

There are 0 answers