Book Image

Unreal Engine 4 Shaders and Effects Cookbook

By : Brais Brenlla Ramos, John P. Doran
Book Image

Unreal Engine 4 Shaders and Effects Cookbook

By: Brais Brenlla Ramos, John P. Doran

Overview of this book

Unreal Engine 4 is a powerful game engine, one which has seen a recent boost in widespread adoption thanks to its ease of use and the powerful rendering pipeline that it packs. Seeing as how it's relatively easy to create stunning presentations and visuals, Unreal has quickly become a strong contender in industries where this kind of software had been previously denied entry. With that in mind, this book aims to help you get the most out of Unreal Engine 4 - from creating awe-inspiring graphics to delivering optimized experiences to your users. This is possible thanks to a mixture of hands-on experience with real materials and the theory behind them. You will immediately know how to create that material that you want to display, and you'll also end up with the knowledge that will let you know how to control it. All of this will be done without losing sight of two key components of any real-time application - optimization, and efficiency. The materials that you create will be light and efficient, and they will vary depending on your target platform. You'll know which techniques can be used in any kind of device and which ones should be kept to high-end machines, giving you the confidence to tackle any material-related task that you can imagine. Hop onboard and discover how!
Table of Contents (16 chapters)
Title Page
Copyright and Credits
About Packt
Contributors
Preface
Index

Customizing UVs


Games are generally computationally expensive, so it makes sense to improve performance whenever you can. With a computer's GPU, a vertex shader is run for every vertex on a model, and pixel shaders are run for every pixel on the screen. Unreal has a feature called CustomizedUVs that can give a performance boost if you run it on just the vertex shader instead of also needing to use a pixel shader. This gives us the ability to tile a texture more efficiently.

Getting ready...

To easily see the differences in UVs, you should have a texture where you can easily tell where the edges of it are. In this case, I will be using the UE4_Logo texture, which is included in the Engine Content/VREditor/Devices/Vive/ folder in the Content Browser.

How to do it...

Before we can modify the UVs of a material, we need to create a material to use. Let's get started:

  1. Create a material and give it a name of M_CustomizedUVs. Double-click on it to enter the Material Editor.
  2. From the editor, create a texture...