2
\$\begingroup\$

How do I apply the Bloom Effect Line Renderer's only? I'm using the bloom effect from the Unity Pro image effects script but it's affecting the way light is rendered to the scene.

\$\endgroup\$
  • \$\begingroup\$ At first I had no idea what you were talking about. then it occurred to me you might be asking how to do glowing lines like in Tron forum.unity3d.com/… is that what you're asking? Because if so you should say that instead, clearer \$\endgroup\$ – jhocking Mar 17 '14 at 20:23
  • \$\begingroup\$ also that image comes from a forum thread asking how to do that in unity, so maybe there's an answer there forum.unity3d.com/threads/… \$\endgroup\$ – jhocking Mar 17 '14 at 20:24
2
\$\begingroup\$

Typical bloom effects are applied as a post-process to the entire rendered frame. This makes it difficult to bloom only select objects. Even windowing the bloom to a region around the lines risks blooming unrelated content that comes too close.

Instead, you can try "pre-blooming" your LineRenderer content - using a wider ribbon and baking a soft surrounding glow into its texture or calculating one in its shader. This is approximate (tricky to get the bloom distance constant in screen space), but simple to implement.

The enemies in Lovers in a Dangerous Spacetime use a "fake bloom" approach like this.

A more rigorous approach is to put your lines on a layer that is not seen by your main camera. Then you can manually render them to a separate render target, using the main camera's depth buffer to ensure they are occluded correctly (this requires some Graphics.SetRenderTarget jiu jitsu, and is not for the faint of heart). Now you can bloom this render target independent of the rest of the scene, and composite it into the rendered frame at the end, without affecting other in-scene content.

\$\endgroup\$
0
\$\begingroup\$

You should try a Replacement Shader to replace only the material set on the line renderer. You can then keep shading from that material and add a blooming effect around it (by playing with the bloom shader).

I can't remember if it's in Unity's standard assets or a package from the asset store...

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.