hi is it possible to apply a custom shader to the material used on the output of the pixel perfect camera?
Good question! Let us know what you find out.
How to report your problem productively in the Unity3D forums:
This is the bare minimum of information to report:
- what you want
- what you tried
- what you expected to happen
- what actually happened, especially any errors you see
- links to documentation you used to cross-check your work (CRITICAL!!!)
If you post a code snippet, ALWAYS USE CODE TAGS:
How to use code tags: https://discussions.unity.com/t/481379
You may edit your post above.
Thanks for the free bump Kurt. It’s a pretty simple question.
Yes it is possible, but may not be trivial. You can output of the camera to a render texture and apply the custom shader. If you’re using URP, I would recommend using Renderer Features to apply the material after the camera rendering pass.
Thanks for the reply. I’m wondering about the output of 2D Pixel Perfect package.
I have applied this kind of technique before using render textures without the package, however would like to use 2D Pixel Perfect so I can still intercept canvas ui touch data.
This is in Standard RP.
I thought the Pixel perfect camera doesn’t support render texture.
if (m_Camera.targetTexture != null)
Debug.LogWarning("Render to texture is not supported by Pixel Perfect Camera.", m_Camera);
From what I remember when I tried to use it the warning was there for reason. Camera was outputting something but it was making a bunch of assumptions about target texture not being used, thus using wrong numbers for calculations and not producing correct pixel perfect output.