Day/Night Texture Baking - Material Mask Reveal

This would be easy enough for a generic day/night cycling map, because you could easily drive the lerp for everything via blueprint, and using a material parameter collection to pass in the light vector. See the BP_SkySphere in the engine folder for an example as to how this is done. But for having a flash light reveal daytime textures… that will be very hard.

You’ll have to do a LOT of the Math in a blueprint, then pass that to the material editor as part of the Pixel Shader. The only way I can think of doing it is tracing a cone from the light source out into the world, then calculating where that cone intersects with geometry somehow. For each object it hits you’ll have to procedurally generate a mask based on the intersections and send that to the shader. You won’t be able to do any per-pixel operations in Blueprint without some pretty extensive C++ code, so you’ll have to create a lot of LUT’s. The downside of this is, it’ll perform like **** because you’ll be doing a render-to-texture for every object your light touches, and performance will depend on how many objects you’re hitting.

Another way perhaps, would be to generate a mathematical cone-shape in the materials themselves, and rotate/move that cone in world-space to follow the flashlights location, again passed in through blueprint. Still relatively expensive I imagine, but probably easier and safer to implement than the other method. Either way this isn’t an easy task, you if you’re new to either of the tools or technical art in general it’ll be a struggle!