Bumped Decals (blend multiply)?

I’ve been pondering today how to create ripples in water when a projectile falls in. I’m curious if creating a Bumped Shader set to multiply would create a transparent bumped surface if placed ontop of the surface of the water as a decal or Projector. You’d still see the surface of the water, but the bumped lighting of the decal/projector would be shown ontop of that.

The bump map would be a very small greyscale QuickTime movie that animates the ripple.

Pipe dream or possibility?

I think you’d only need the alpha blend, and have alpha in a way that the “ripples surface” (decal or projector) fades out.

This isn’t about creating a ripple that fades out, but a ripple bumpmap that could be projected onto the surface of another object (water surface) creating the proper illusion of bumped ripples on the surface.

Last night I came up with a pretty good scheme. Instantiate the bumpmapped greyscale ripple decal where the projectile hits the water. Use an orthographic camera right above it to capture the decal at that point with the proper lighting for the bumpmap. Then use a projector to project the RenderTexture from the camera down onto the same spot using blend multiply. This creates the proper lighting/shadow illusion as long as the main camera is stationary (which is all I need).

The only problem left is I need an Image Effect that bumps the contrast of the RenderTexture up to pure white for the non-ripple part so that only the shadowing of the bumpmap is projected with blend multiply… right now I’m still getting unwanted artifacts from the decal.

But anyway, I was really just curious if there is any magical way to project “only” the bumpmap of a shader onto another object. I’m assuming this is very complicated… With things like bullet decals you can use a bumpmap quite easily because you also have a diffuse texture. But with this ripple bump you want a 100% transparent diffuse channel with only the bump information affecting the water surface.

Funny thing is, I was just thinking about this exact same problem. I didn’t get as far as that, though, especially since I just have Indie for now. I’m just going to fake it with a normal decal or something. :wink:

–Eric

I wish we could both “fake” it with a normal map, but unfortunately it’s not that simple. I think I could make my projection method work with an Image Effect that does an “auto level” similar to PhotoShop to bump the whites to pure white. Any tips for this?

Well, this is what I ended up with. That’s two meshes, which get scaled outward and flattened, plus an alpha bumpmap which fades from 50% to 0% opacity. Far from perfect, but it looks semi-convincing in motion, which is good enough for my purposes. :slight_smile: It would be nice to flatten the bumpmap over time too, but short of animating it over a number of frames I guess that’s impossible.

–Eric

This looks great, I must say! Can you build a webplayer for us to observe the real thing?

flattening a bump map over time is easy. Basically you just lerp towards blue in your pixel shader, based on some uniform float which you feed to the shader using material.SetFloat();

OK, why not…here you go. Hours of fun. :wink:

Sure, easy for you to say. :wink: I’ll see what I can manage, thanks!

–Eric

hours of fun indeed! :wink: that’s great!

Yay! Looks super cool! Now if you’d only do a raycast and spawn the drop where the mouse intersects the water surface… :roll:

I found something: If you click REALLY fast, you can spawn two balls on top of each other so they get pushed away.

Yeah, I know… I need a life.

That’s great! Sound and particles make the effect complete!

Yeah, I know… I need a life.

hahaha! yeah me too! i did the same thing!

That is really nice! So, do I understand correctly that you are modifying the meshes (doing something with the vertices)?

I think he’s just scaling the meshes, not manipulating verts. Enlarging on X and Z, while shrinking on Y.

Exactly…manipulating verts is beyond my abilities, though that’s what my original thought was. Then I realized scaling would do pretty much exactly the same thing in this case. The sound I threw in at the last minute; the first effect I found on Google just happened to more or less sync with the particle system, which was nice. :slight_smile:

Sheesh, next you’ll want a high score table, bonus rounds, multiplayer, and boss fights. :wink: Oh well, I suppose I have to learn about raycasting sometime so I might as well. (OK, that was actually simple stuff…I thought it was going to be arcane or something. No doubt Unity is taking care of all the scary math. :slight_smile: )

Here’s a new version, plus I tweaked the particle system. I think just using billboards looks better than stretching after all, or not? Plus I added another particle system for that something extra. The trouble with Unity is that development time is never as little as I think, because I can’t seem to leave well enough alone…enough already, I will NOT try to add interference patterns to the ripples and you can’t make me! :wink:

–Eric

Eric5h5, that looks sweet! It’s fairly convincing and I’d be really interested to see it with realtime reflections on it. I’m still unclear whether you’re using a 3D ripple mesh or a flat decal with a normal map. It looks like a 3D mesh that you’re scaling and flattening. I tried this method but got some annoying depth sorting issues with the alpha channel. Any more tips for how you set this up with regards to the shader you used and how the textures were placed? I would really appreciate it.

Thanks,
Ethan

Both. :slight_smile: It’s a 3D ripple mesh (two copies scaled differently, actually), with the alpha bumped shader. (The pink ring is a separate mesh used to generate both particle systems; it’s invisible in the scene.) Using just the alpha+bump on a flat surface doesn’t look that bad, but lacks the depth to make it more convincing. Using just the 3D ripple without bump mapping has shading that (ironically) looks too flat. Only when combined did it turn out OK. I’d be interested to see it with realtime reflections too…the 3D mesh + bumpmap might mess that up, or not. If you want I could upload the project somewhere; it’s a few MBs.

–Eric

I don’t see the ripple mesh in the new webplayer (MacBook Pro). Just the particles and the small ripple-things. Did you change something essential?