How to add color (with opacity) on the whole screen at the beginning of every frame (2d)
it's like at the beginning of every frame (2d). The camera is set to "don't clear"
1) first, render the whole screen with a color (for example red color with opacity 0.5)
2) then, render other objects.
Thanks
I've tried to attach a script to the camera, but it doesn't work. The camera draws a solid red color (opacity 1.0) on every frame
private void OnPreRender()
{
GL.Clear(false, true, new Vector4(1, 0, 0, 0.1f));
}
Like some kind of Epilepsy Simulator? Sounds fun. Have you tried 0.5 in your Vector4 ins$$anonymous$$d of 1? Does 1 even work and not throw you some error? (1.0f) You say Background but also say Whole screen. You may need to clarify. Background can be handled via the camera and Whole Screen may need Image Effects or a hacky plane placed by the near clipping plane (expensive transparency). Perhaps enable the depth field and specify a value. Perhaps its simply falling short?
In most other situations, some camera is drawing something somewhere, and probably is clearing already with the background color of the skybox (GL.Clear) - $$anonymous$$gests change the skybox.
Hi it's the whole screen and the camera is set "don't clear".
So have you tried post process image effects?
Your answer
Follow this Question
Related Questions
Meshes appears very dark than expectation 0 Answers
LWRP lowest android version 0 Answers
Simple "Render on Top of Everything" Shader? 1 Answer
Shader Graph Editor fails to open shaders 0 Answers
Unity particle pack 0 Answers