Use a render texture with a particle system. (transparent background)
Hi all. I'm trying to use a render texture in order to put a particle system on a raw image. It's not working too well though. I've managed to capture it on the render texture but not without a background. I need the background to be transparent. I have tried setting the skybox of the rendered camera to a solid color with an alpha of 0, but this sets the alpha of the particle system to 0 as well as the background. Hopefully there's an easy way to do this. I've seen similar topics where the solution is to use a shader or something, but the truth is... I'm a total noob with shaders :D. If someone could help that would be great! Thanks!
If you use standard shader by Unity, you actually can tell a material of that object go to invisible. Like looking through it.
m_Fade$$anonymous$$aterials.SetFloat("_$$anonymous$$ode", 2);
m_Fade$$anonymous$$aterials.SetInt("_SrcBlend",(int)UnityEngine.Rendering.Blend$$anonymous$$ode.SrcAlpha);
m_Fade$$anonymous$$aterials.SetInt("_DstBlend", (int)UnityEngine.Rendering.Blend$$anonymous$$ode.One$$anonymous$$inusSrcAlpha);
m_Fade$$anonymous$$aterials.Enable$$anonymous$$eyword("_ALPHABLEND_ON");
m_Fade$$anonymous$$aterials.renderQueue = 3000;
Thanks for the answer. I really wish I understood what the code meant that you've posted and where to put it but sadly I have no idea. Just going to work now but i'll have a look into it after and see if I can figure something out :D
Answer by EthanRushbrook2 · Jul 09, 2018 at 01:35 AM
The easiest way to make an image transparent is to create a world space canvas and attach a canvas group component to it. An alpha option pops up and inside of the canvas (as a child) will go transparent.
I think this solves what you’re trying to do. If not, just add a comment.
Thanks for the answer. It doesn't look like it's working sadly. I can't get the render texture to appear at all on the canvas.
Your answer
Follow this Question
Related Questions
Particles Instantiate doesnt show up (Hidden behind background image) 0 Answers
PostProcess Outline Shader GVR alignment 0 Answers
How to Stop Particle effects from overlapping via stenciling/shading 0 Answers
Is there a way to fetch albedo/spec/roughness/AO and normals (RTs) in a deferred frag. shader? 0 Answers