# CRT Bot - Animated screen tutorial - part 2

General / 03 February 2021

Hello, I hope everyone is having a nice day!
This is the second part of my animated screen tutorial. In this blog I'm going to explain how to make the dots effect, the distortions and how to make it possible to animate.
In case you haven't checked the first part already, here is the link : https://www.artstation.com/abdoubouam/blog/Vwr2/crt-bot-animated-screen-tutorial-part-1

Let's get started.

# Dot Matrix effect

So let's pick up from where we left in the previous part. We have a "pixelate" node with a configurable X and Y resolution. We need to turn the pixels into circles.

We know that the formula for a disk is X²+Y²<R, where X and Y are the 2D coordinates, and R is the radius. Let's translate it into nodes, using the "Separate XYZ" and "Math" nodes.

As we can see, the disk's center is in the lower left corner of the plane, so we need to shift it to its center. All we have to do is add a math node and subtract 0.5 form the X and Y values. Voilà!

Once disk is good and all, but we need as many of them as there are pixels, so let's multiply X and Y by two numbers, one for the columns and one for the rows.

So far there's only one disk, taking the correct place and dimensions, but we need it to repeat. The solution is simple : add a math Warp node, and set the minimum and maximum to -0.5 and 0.5 (or 0.5 and -0.5 like in the screenshot, it doesn't matter if the disk is mirrored since it's symmetric)

Now make that into a group, select everything (excluding the output node and the emit/viewer node) and press CTRL+G, then add "columns" and "rows" as a group input

And finally, use a mix RGB node, set it to multiply and mix the pixelated image with the dot pattern as follows. Make sure the X Resolution have the same value as columns and Y Resolution has the same one as Rows. Set the radius to any value you like.

# Animation:

Now that we made the dot matrix effect, let's move on to animation. We want to be able to move the image while keeping the pixel pattern the same. To do that, we need to edit the "pixelate" node and add a "shift X" and "shift Y" parameters. Let's start by selecting the node group and pressing Tab to enter the group

This is fairly simple, just add two math subtract nodes to the end, just before the combine XYZ nodes, and connect the value we want to subsctract to the group input. So now the pixelate node has 4 inputs instead of 2.

This is the result

# Distortion/glitch effect

The last part is about distorting the texture. Let's start by adding a noise texture node.

We want to use it to distort the UV coordinates, and we can do that by first using a mix RGB node to substract RGB(0.5,0.5,0.5). This will make the noise texture values go from -0.5 to 0.5 instead of going from 0 to 1. The negative part will distort the texture to the left/bottom and positive ones will distort it to the right/up.

And finally add a mix RGB node and mix the vector output of the pixelate node with the noise texture.

The mix factor can be used to control the amount of distortion .

This is not strictly necessary, but I want to remove the distortion among the Y axis, so I added a mix RGB node and multiplied it with RGB(1.0,0.0,1.0). This makes all green/Y values equal to 0 and therefore have no effect.

This is the result, much better! Don't forget that you can change resolution and dot radius at any time, use whatever values work best for you.

This is the overview of our node tree so far

And finally, to animate the distortion, we need to add a mapping node (Vector > mapping), and adjust the Z Location value.

To change the color we can use a mix RGB node, or a ColorRamp node for better control.

That's all! The shader is ready to be animated. You can change the position of the texture, the resolution, the distortion amount and mix between those. Additionally, you can use multiple textures and a simple mix RGB nodes to change the images to make it interesting!