Basically I have a scanner and I want it to be able to have a visible laser scan. It shouldn’t be visible in the air, just on whatever object it touches.
I’m quite new to creating anything more complex material wise, but after looking around for a while I tried creating a simple box and applying a material that’s using a Depth Fade node that’s inverted with a OneMinus node. The result is fairly close to what I need, but the main problem is that the laser isn’t actually blocked by objects and will appear on the backside just the same as it does on the side facing the scanner.
I was thinking that I could perhaps use decals somehow, but as far as I’ve been able to find out you can’t really parent a decal “projector” in that way.
How would you go about doing something like this?
Could you share what you’ve already done to give a better idea of what you’re trying to achieve?
Actually I think I could just do it with a SpotLight rather than a material. However, now my problem is how to increase the size of the actual light emitter so that the light doesn’t shrink into nothingness as you move the scanner closer. Increasing the “Source Radius” doesn’t seem to do anything.
Source Radius determines the radius of the sphere that shows in reflections.
You could use a sphere mask node to mask the scan effect in your material. Use a line trace from the camera to specify the world space position of the sphere mask and just use a constant radius.
Try this out:
Make this material: Sphere Mask posted by jkelly206 | blueprintUE | PasteBin For Unreal Engine 4
Make sure to make a “Material Parameter Collection” and give it a vector input called “location” and use that where the “collection parameter” goes. The “Component Mask” is “RGB.”
Then add this code to your pawn - with “Set vector parameter value” tied to your “Material Parameter Collection”
This is the result: UE4 Sphere Mask Material - YouTube