Security Feed Material

I got started on a security feed material this week! I’ve wanted to do a little unreal material editor work for a while, so taking a break from the exporter project to make some funky shaders!

2

This took me a couple of hours on Saturday afternoon – I’ve been out of UE4 for a while and I don’t do shaders regularly at work, so I figured this would be a slog. Not at all -the basic set up was really fun!

1

Fish Eye Distortion

I’d never created anything like a fish eye distortion before, so this was really interesting. It is created by distorting the UVs based on something.

The tex coords are first multiplied by 2, to give us the whole texture, as the distortion will change its size, and then 1 is subtracted from it to remove the appearance of tiling.

To create the actual distortion, we have to multiply a normalized version of the uv coordinate (a single number representing the vector) and the length of the vector, squared. The image below shows how the two values combine to create a rounded appearance.

Fiseye

The add and divide are to fix the tiling after the multiplication, other wise the image would be offset by a quarter of its size. We are very close to undoing the coordinate changes we made in the beginning.

4.PNG

3

Can’t wait to do more on this!

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s