Glow 2 Cameras

Is it possible to have a 2 camera setup with one camera drawing objects with glow on top of another camera drawing non-glow objects or is this not possible now(or ever)? When I try this now the whole scene “glows”. This makes sense I guess with the buffer being drawn on top of eachother, but I’d love to separate image effects into separate layers (offscreen buffers?). It would be so nice to render a second camera layer with glow that is depth only, but it doesn’t work at the moment. Am I doing something wrong or is this just not possible?

What if you render the second camera (with glow) into a render texture and then “composite” it over the main camera?

Hmmm, ok, I’m working on a simple puzzle game that isn’t too GFX intensive… so compositing a separate render layer wouldn’t be a big deal. But depth buffering is going to screw everything up if it’s not there…

The crux is that you can use an image effect in the “bottom” layer (the blur desert depth effect thing I did exemplifies this), but if you try to use an image effect on the “top” layer it affects the entire onscreen buffer (this makes total sense of course). I’m just curious if there is a way around this? I want objects on top of the playing field that glow (and “depth only” doesn’t work). And "ALL glow’ (both cameras) is too much glow. Damn, you know what I want… self-Illuminated texture = image glow effect would be an ideal “image effect” script…

Did you see that you can adjust the amount of glow usually by configuring the alpha of a Material’s main color? Or the specular alpha for specular highlight glow. Then you can preview this in the alpha view of the scene view. White = lots of glow, black = no glow, then anything inbetween.

Nevermind if this isn’t the right topic. :slight_smile:

-Jon

Thanks Jon, no, I’ve got all the specularity and diffuse tweaked and I don’t want to change it too much because I really like the surface highlights I’m getting with the 2 pixel lights I’m using.

I’ve tweaked/intensified all the texture colors and self-illum on everything and it’s just too much for this project. I really want to separate a certain set of objects to “glow”. A glow material Tag would be sweet… or a “if pixel intensity exceeds X then glow” thing would be great.

But more fundamental is how to layer Camera effects (if possible).

You use the alpha value to control which objects glow and which do not. Modifying the material alpha does not modify the color, only how much it glows.

Apart from this - very precise - control, there is no way to glow individual objects with a glow filter.

On which shaders? Self-Illum or every shader? I only want to poke certain objects into glow and if I can control that with alpha channels on certain shaders then let me know what those shaders are. If it’s self-Illum then I’m good to go because those are the ones I want to pop.

On all builtin shaders. The details are in the documentation.

Basically you’d set alpha to zero on all objects, except the self-illumin ones.

Great news this is. I was trying to do the same thing using layers and ran into the same depth issues.

Thanks for chasing this down Ant! And thanks to OTEE for thinking this through =)

Aras, is there a way to similarly selectively include / exclude materials from other fullscreen effects? For example, color correction…

The docs don’t make any mention, but I thought to ask anyway. :slight_smile:

Not by default.

Some of the effects could be controlled by the alpha, at a performance cost.

With glow, however, you NEED this control so that’s what we optimized for.

Just to clarify: the image effects included in Pro Standard Assets are just several examples of what you can do. All the image effects are just scripts that you or I or anyone else can write.

So if you can think up some image effect that given an input image would produce the output image, go ahead and implement it (or ask someone else to do that)!

The color correction example: you could use the alpha channel of the input image to control correction in some way. You just have to think up how exactly do you want to control it.

Ok, great. Thanks, I’ll dig in it. I’m not much of a shader writer, but hey, I’ve got to start sometime!

The problem I’m running into (and I hope is solvable) is that I need some light fixtures to glow. So they have an Alpha turned up. However, other objects (like a map that fades in and out) has to have an Alpha shader on it to fade in and out - and so it’s glowing too.

How do you get glowing objects to glow, but non-glowing objects (that need or have an alpha) to not glow?

The built-in alpha shaders do not write anything into alpha channel, so whatever will be behind them will glow.

What you can do is write a custom shader that first renders colors (into RGB channels only), using alpha. Then it would render into alpha channel only (e.g. set it to black so it won’t glow).