How can this effect be achieved?


I’m trying to replicate the effect you see at the end of the note track in this image (it’s from Guitar Hero Warriors of Rock), which is where the track itself and all the notes fade out as they get far enough away from the camera.

I’m currently using the Vignette effect, and I can only get it to work like I’d want with a completely black background. The problem, is that I’d like to be able to have background images or video playing in the background behind all of the gameplay elements which I can’t do with the Vignette effect (or if I can I have no idea how to do it) since the effect more or less disappears and makes the end of the track visible again.

I can fade my notes individually depending on their distance to the camera, but that obviously doesn’t fade out the track as well. The track is also scrolling, so I can’t just have a texture with alpha applied since that alpha would also be scrolling. If I need to fade the notes individually and do something to the track to make it fade out as well, that would work. I just don’t know how I would fade the track out.

I also have no idea how shaders work, so no idea if a shader would be better to use here.

The solution one way or other does need shaders to pull off, and custom ones. But people might feel like tackling this challenge. I don’t have time so onto the clues…

Method 1
A separate camera that only renders certain layers, and putting objects on that layer (so that camera only renders the fade layer).

Then you tell that camera to render the result to a texture. Once you have the texture it’s another job to correctly blend that texture with your main camera scene. To do this you can overlay a quad with the render texture or use a post effect which will work with the “game” camera. So you prepare your new image then combine them.

This will require you go back and forth with questions on forum to get it right, asking questions about each step.

Method 2
This is much simpler and it’s just using a shader on meshes that supports vertex alpha, then you can texture scroll the conveyor belt and so on. The problem with this approach is while it’s simple, it also is prone to see-through issues but this might not be an issue in your case.

Alternatively have a shader which simply fades the mesh out based on a screen-space texture or vertex shader gradient of some sort.

1 Like

So I attempted Method 1 (I have no idea how to do Method 2), and ended up with a decent looking RenderTexture which I found a shader to apply an alpha mask to which kinda worked but I feel like Guitar Hero would’ve used a 3D effect instead of a 2D one because I could never get it to come out looking right. The RenderTexture also had a black background which I couldn’t figure out how to get rid of.

Could I get any help into how to start with Method 2? I haven’t done really anything with meshes or vertices so I don’t really know where to start.