Untitled night scene WIP

General / 07 June 2021

A preview of My latest personal project. Most of it is placeholders and basic blocks.
I like to focus on the lighting and general look and mood from the early stages, and then detail and refine it later. I have so many props to model, so I'm going to take this one step at a time


  

Attending the Leartes & Dekogon Realtime Game Art Challenge

General / 14 February 2021

I stumbled upon this challenge and I will be participating. It will be a great opportunity to improve and showcase my skills in real-time environments and props.

I will use Blender, Substance Painter & designer, Marmoset ToolBag, and Affinity Photo & Designer, then put everything together in Unreal Engine.

The idea I have in mind is an abandoned urban city, based on my own interpretation of the theme. I am looking forward to this!


  

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!

The finished .blend can be downloaded from this link : https://mega.nz/file/yPwGjKqa#608s4FNA9vphU--pYhco9KfR-IRrI3LREKRpBfpb5l4

Conclusion

In this tutorial I explained how to pixelate an image and how to add distortions and a dot matrix effect with Cycles shaders. This allows you to have control and interesting effects in a non-destructive manner. I hope this was helpful, and if you have any questions don't hesitate to ask.

Have a nice day and stay safe!


CRT Bot - Animated screen tutorial - part 1

General / 21 January 2021

Hello!
Some people asked me to explain how I made the screen effect from the CRT bot model in the short animation below, so I decided to explain the process in this blog post. I will create this in Blender and Cycles/EEVEE.
Please note that I will not be explaining the basics of Blender and the node editor, and assume you have prior knowledge in Blender and know how to do research. However feel free to ask question if you find anything unclear or ambiguous!

(More shots and info at : https://www.artstation.com/artwork/kDogPd . Design by Cameron Sewell : https://twitter.com/Thdark101/status/1335816473856663553 )

Part 1 : The Pixelated effect - Basic explanation

This is the first step I did. I will explain a different, simpler process first so you can understand more easily. You don't need to follow along in this step, as I'm only using it to explain, but you can try it if you want to.

Let's start with a simple plane and an image texture

Open the UV editor view on the right, and keep the 3D view on the left. So far it's only one polygon, and the image is not pixelated yet.

Add a few subdivisions to your model. Each pixel will be represented as one polygon.

Perfect, now we will make each polygon act as a single pixel, and therefore should have a single uniform color.
To do so, we will need to "collapse" the UV map of each square to the middle (see the arrows in the image below). Each squares's UV will point to one single coordinate, instead of a whole area.

This is how the UV map (right) should look like, only dots, while keeping the geometry (left) the same. 

To do this, select a vertical edge, press CTRL+G to bring the "select similar" menu and choose "Direction". This will select all vertical edges. Press V to split them. Repeat the same process with horizontal edges. you will end up with each polygon separate from each other.

From the UV editor window, press "." to bring the pivot point menu and set it to "Individual Origins", select everything and scale down everything (in the UV editor still) to 0.



You will end up with dots in the UV editor and a pixelated image in the 3D view



Part 2 : The Pixelated effect - Shader

The previous method was relatively easy, but what if you wanted to change the resolution? or change the shape? or apply it to another model? You will have to do everything from scratch every time. That can easily get very repetitive and tedious.
Luckily we can make this dynamic, and let the shaders do everything for us.

First let's start with previewing the distorted ("pixelated") UV map we got from the previous part, which should be our target, and compare it with a normal one. We can do this by plugging the UV output to an emit node (I recommend using the node wrangler addon and CTRL+Shift+LMB to do it automatically).

As we can see, the UV map is 2 dimensional, and the X component is represented as red, and Y as green. We can use a Separate XYZ (or Separate RGB) to preview only the X or Y component at the same time, and this should make things much clearer.

As you can see, the X component goes from 0 (black) from the left to 1 (white) to the right. Same thing for the Y, it goes from 0 in the bottom to 1 at the top. Let's only concentrate on the X component for now.

In the normal plane on the left, this is a perfectly smooth linear gradient, but when we applied the process in part 1 it became stepped with no transitions. This is what gives the pixelated effect, and we can replicate it entirely with shaders and using only one single polygon!

How can we achieve this? Lucky for us there's a "snap" function in the math node. (ctrl+A > converter > math ). Instead of increasing at a steady pace (left), it will increment at once, which will make a step pattern.

The increment value will define the number of steps, but we want to do the opposite : define the number of steps (number of horizontal/vertical pixels), and let the shader calculate the increment value for us instead. We can simply divide 1 by the number of steps and we will get the increment value. How convenient!
You can see the resulting node tree below. I like to use a "value" node for variables I will adjust in the future. It's not absolutely necessary, but it's nice and keeps things clean. So here I used a value node to keep the X resolution.


There are some edge cases, but let's focus on the most important one : decimal values. In the picture below you can see a "fifth of a pixel".


There's no such thing as that of course, so we want get rid of that and only keep the whole part of the number and ignore the fractional part. We will use my favorite node again, the math node. It has a "floor" function that does exactly that, so let's add it.



 Perfect! Now let's repeat those steps for the Y component. Only 4 extra nodes, that should be easy now that you know how to do it!


  And finally, let's ad a "Combine XYZ" (or "Combine RGB") node and preview it

It's working now! You can change the X and Y resolution on the fly and it updates instantly.
To keep things clean, we will put this in a node group. Select all those nodes we created and press CTRL+G to put them in a group, then disconnect the "X Resolution" and "Y resolutions" outputs and connect them to the Group input instead. Don't worry if if the preview turns black, the default values of a group nodes are always 0.5 and that gets rounded down to 0 pixels, which is normal.

You can press "Tab" to open and close a group node. Close it and set the X and Y resolution to values like 32, and then connect the vector output to the image texture node and done! one single node group to pixelate the image!


That's it for this part. In the next part I will explain how to make the dots and how to animate and distort the image.

If you want to get a better node tree, ready to be used in your projects, you can have a look at my full dot matrix shader https://blendermarket.com/products/dot-matrix-shader-cycles-eevee

Don't hesitate if you have any questions or thoughts!