Hazel Whorley
Level Design

me@hazelwhorley.com

Tutorials

Quick Custom Shaders [UED 3]

This tutorial doesn't show you how to create your own textures and environment maps from scratch, but it will show you how to take existing textures and give them that extra shine.



Shader Basics

A Shader can alter the appearance of a material by modifying its output blending mode, changing its alpha channel or detail texture, adding a kind of light map or specularity material.
- Shaders (UnrealWiki)

In other words you can make shining metals, glass, animating textures, water and a whole range of other effects.



Shiny Glass

To make this glass texture you need a basic glass texture and an environment map (that makes the shining effect). If the texture doesn't already contain an alpha map, you will need to make a FinalBlend to make it transparent.

Step 1: Create a new shader
Go to the texture Browser and click File > New. Enter the following in the window that appears:

Package: myLevel
Group: Anything you like, i.e. Glass
Name: The name of your texture.
MaterialClass: Shader.

Step 2: Choose a glass texture
Go back to the texture browser and select a glass texture (don't close the shader properties window). I chose one from the UCGeneric.Glass package. In the new shader's properties click "Use" on the Diffuse property. You should now see the texture in the shader preview.

Glass Textures

Step 3: Add transparency
This part is optional. Don't worry if the glass texture you chose isn't transparent, we can add that later.

Select the same texture you used in step 2 and click "Use" under Opacity in the shader's properties. This makes the shader use the existing alpha channel from the glass texture. The texture in the preview should turn transparent.

Step 4: Adding Shine
The shader's Specular property allows you to add the shiny part. You'll need to find an environment map for this, there are loads in the package "CubeMaps". I chose this one > CubeMaps.Alleria.AlleriaGenTexEnv. Select a TexEnvMap and click "Use" under the Specular property.

Environment Maps

Finishing Touches
This is what your properties window should look like:
Shader Properties

This way you can make any texture you like shiny, but remember not to use it everywhere because it will kill the framerate! If the original glass texture isn't two-sided, make sure you change TwoSided to true in the shader properties. Please keep reading if your shader isn't transparent yet...



FinalBlend - Transparency

So you've made a glass texture, but it isn't transparent! The base texture you chose had no alpha channel. There is an easy way around this without having to create an alpha channel yourself.

Step 1: New FinalBlend
Click File > New and enter the following in the New Material window:

Package: myLevel
Group: Glass (preferably whatever you put last time)
Name: The name of your new finalblend texture.
MaterialClass: FinalBlend

Step 2: Select Material
In the FinalBlend Properties, choose your shader as the material.

Step 3: Choose Effect
Select one of the following in FrameBufferBlending. There are a few different effects you can choose here, the best way is just to mess around with them and apply the FinalBlend to a surface to see what it looks like.

FB_Modulate - Gives a darker translucent effect.
FB_AlphaBlend - Makes the texture translucent based on the existing brightness of the texture. (recommended)
FB_Translucent - Can result in a very bright texture.
FB_Darken - Looks like a transparent negative of the original texture.
FB_Brighten - Makes the texture brighter.



Example Map

This example map contains all the shaders created in this tutorial:
Quick shaders example map [6KB]