Step 1 -Texture
For start we will need a sky texture. I strongly recommend CGtextures.com. Browse their library and pick a texture that you like. I created a tiled texture.
Note: Your result should be saved with the .tga suffix. Let’s say diffuse_test.tga
Recommended resolution is 1024x1024 pixels.
Step 2 –Mask
What we will need now is a circle that need to be centered on the mask document. To achieve this, create a new document with the same resolution as the texture and set the Background Contents to Transparent.
Now follow the steps:
1. Select the Elliptical Marquee Tool;
2. By holding the Shift Button, drag a circle in the middle and fill it with black. What we will need now is a new document (mask_texture) with the RGB as color mode in which we create half of the mask or something like that. Drag the black circle (mask_test) on the new document (mask_texture), after, select all by pressing CTRL+A and with the MoveTool selected press the “Align vertical centers” and “Align horizontal centers”.
Now that the circle is perfectly centered create a new layer and in that layer draw a black box so it should look this:
Don’t forget to merge the layers. If you want to be more accurate with the box, create a new document (Width-1024 pixels and Height-512 pixels) with a black background and copy that on the document with the circle.
Yeah I know it’s a bit stupid and mindf*****g. Again you will need to create a new document with RGB as color mode. After you have created the new document go to channels and select the Red Channel and place the half mask and align it with the top. In the Green Channel you need to put the same mask but rotated 180 degrees. The result should look like this.
Apply separately to the channels a Gaussian Blur. Personally I use a radius of 100 pixels, but you can try different settings. The final result (final_mask.tga):
Step 3 –Material Editor
- Now that we are done with the textures let’s make the material. Open UDK, import “diffuse_test.tga” and “final_mask.tga” and Create a New Material.
- Open the new material and insert the following nodes: Texture Sample; Vector Parameter; Multiply;
- In the Texture Sample put the “diffuse_test.tga”; set the Vector Parameter (1,1,1,1) and name it Sky Color.
- Group this as “Diffuse”
- Now for the “fun” part we need the following nodes: Texture Sample; 2 Vector Parameter; 2 Multiply; Add;
- In the Texture Sample put the “final_mask.tga”, name a parameter Horizon Color 1 and the other Horizon Color 2 (give some different values to the parameters to make de difference) and connect them as shown:
- Finally connect the two Multiply nodes to a Add node.
- Group this as “Mask_Normal”
- We need to inverse the mask so the colors do not multiply , if so the horizons will be more powerful and will start glowing.
- For this we need: 2 Add; 3 Multiply; OneMinus;
- In one Add node connect the Red and Green Channel from the “final_mask.tga”. The respective Add node should be connected to Multiply node along with a “diffuse_test.tga”.
- In the OneMinus (1-x) node connect the Add node. The OneMinus node should be connected to a Multiply node as shown.
- And the rest…I think you can figure it out from the image.
- Don’t forget to group it “mask_inversed” . Oh… and the Add node from “Mask_normal” should be plugged in the Add nodefrom “mask_inversed” .
- Connect the Multiply node (with the texture in the circle) to Diffuse and the Multiply node (with the black circle) to Emissive;
Step 4 –Material Instance
For the grand finale. Save the material, right click on it and select “Create New Material Instance (Constant)”. Now for the FUN part. Open the material instance and play with it. It should look like this: