- Home /
how to make shader dont blend color with camera background?
hello everyone
I have a project which need to use customed UI shader. here is what i do...
build a canvas ,and set RednerMode to
Screen Space - Camera
build a UICamera to render Canvas.
set targetTexture of UICamera to a
UIRenderTexture
set alpha of background of camera to zero
in this moment, everything is work fine. but when I use transparent image in my canvas . i found that transparent can't render correct Color
in the end, i found that blend mode of shader of UI/Default Material is below as Blend SrcAlpha OneMinusSrcAlpha
so if my i have a image in Color(1,1,1,0.5f) and camera background in Color(0,0,0,0) , the blend result will be Color(0.5f,0.5f,0.5f,0.25f) , but the correct color should be Color(1,1,1,0.5f).
any one can help me?
Your answer
Follow this Question
Related Questions
Changing images using a shader on a 2D canvas? 0 Answers
RenderTexture on RawImage does not render anything 1 Answer
How do I make a paint trail effect in ShaderGraph? Are there better ways? 0 Answers
A problem involving RenderTexture, Canvas, and UI 0 Answers
How to make a custom GrabPass-like sampler2D in MRT shader? 0 Answers