Best Way to Make an Overhead Projector Crawl Up Walls?

Apologies in advance if this is a nooby question. I just started Unity, so I have a lot to learn.

So I’m working on a game with an echolocation mechanic. Essentially, the scene has zero light and the only way to see stuff is by emitting sound (for example, walking around or throwing a ball onto the ground). When this happens, a projector spawns overhead and increases in size, and then destroys itself. So far, the mechanic looks and works great for outdoors scenes and such. However, when I try and use this for indoor scenes with ceilings and walls, the projector doesn’t provide the desired effect. Because of the way the overhead projector works, the sound waves will climb quickly up the walls and in a straight line, not in a circular fashion like with the floor. What should I do to fix this?

Ex: On terrain and other objects, the sound wave looks fine. The picture below illustrates that.

However, because of the nature of projectors, when interacting with walls, the sound wave does not create a circle like it does with the ground.

Any help or suggestions are appreciated. Thanks for your time.

Bump, still looking for any help. Thanks!

Ohhh, this is a simple mistake made by many human beings such as yourself. All you need to do is change all the "."s to ","s and it will all be fixed. Common mistake. If you need any more advice just PM me. Thanks! :smile:

You need to change your system to use a projected sphere, not a circle. To do this you’ll need to use a custom projector shader. If you look at an existing projector shader with a falloff texture option it’ll have the usual xy value for the main texture and a z for the falloff. What you want is to use xy and z.

Something like:
float3 centeredUV = i.uv.xyz * 2.0 - 1.0; // expand the usual 0.0 - 1.0 uv space to -1.0 - +1.0
float sphereDist = sqrt(dot(centeredUV, centeredUV));
return tex2D(_MainTex, float2(sphereDist * 0.5 + 0.5, 0.5);

Thanks! Unfortunately, I don’t have much knowledge on how to code with shaders. Where and how would you implement that code?

Thanks again for your help.

I suggest you read this (all 5 parts!):

And download the built in shader source here:

Afterwards you’ll want to look through the built in shaders and look for the projector shaders, specifically one that has a second falloff texture. That should already have a vertex function setup that passes the appropriate information to the fragment shader, then my above code should work with the rest.

Sounds good, I’ll give it a read and try it out. Thank you so much! I really appreciate it.