r/howdidtheycodeit • • Aug 31 '19

This moving projector in Control

https://gfycat.com/untimelyenergeticinexpectatumpleco
151 Upvotes

11 comments sorted by

61

u/CptCap Aug 31 '19

This is probably just a spot light with an animated projected texture.

It's essentially the same tech used everywhere (often called light cookies1 ) to give some texture/internal shadowing to the light.

It works by computing the angle from each lit pixel to the light source and then using that as UVs to look up the projected texture (with some added trigonometry)


[1] Unity doc on light cookies

4

u/ethanicus Sep 13 '19

Same effect is also used for flashlights with textures. The beam of light is slightly more complicated though.

0

u/[deleted] Nov 06 '19

[deleted]

1

u/ethanicus Nov 06 '19

Interesting thought. I've definitely been getting into UV mapping lately so I'm having fun learning a lot about the things you can do with it.

2

u/JmcmProgrammer Aug 31 '19

This. Possibly some shaders for the glow effect. Looks great!

4

u/theroarer Sep 05 '19

What game is this? It looks neat.

2

u/[deleted] Nov 08 '19

Where's the plug?

2

u/yoctometric Aug 31 '19

This is very very cool!

2

u/Callumnibus Aug 31 '19

Potentially a decal using deferred rendering. Games often use these to apply "stickers" or bullet marks or splodges etc. to arbitrary geometry