[Help] Trying to get this effect (Shader or Mask)

Good day everyone,

I’m trying to achieve this effect that I’ve done in photoshop. I’m not sure what the easiest route would be, whether I use a shader of some sort or a mask. I want an area of the grid in a certain radius to be revealed where ever my mouse cursor is.

Start here:

It’ll achieve the effect you are looking for with some minor modifications.

3 Likes

Kinda need to multiply the grid, which is fixed, by a proximity sprite, which moves with the mouse. You could maybe do this with a rendertexture that you draw the grid to, then feed it into a a particle multiply shader or similar, and output it?

Wouldn’t it be much easier to pass the mouse cursor raycast position in worldspace to the shader, and in the vertex shader encode the mask to blend the grid into vertex colors?

1 Like

Perhaps, but then you have to write a shader. I was trying to suggest a non-custom way to do it.

I don’t recall a way to make multiplication happen that doesn’t involve a custom shader. Might be overlooking something of course (I rarely work with sprites).

I think that custom shader is simplest approach here - with passing raycast position, as Martin_H suggested.

The easy solution would be to make hidden alpha-blended grid mesh (texture or no texture, doesn’t matter), and then affect alpha based on distance to raycast position. Should be fairly trivial as well.

The particles multiply shader can multiple the source texture with the backbuffer.

… this won’t work really well.if you want a flat grid that fades out based on distance to impact point.

What do you mean with revealed?
If the photoshop picture displays what you are looking for you it seems you want to overlay a grid that is fading out at the mouse position?

Or are you looking to reveal the whole grid at the mouse position only - like what zombieg. posted?