Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Unity 5.x Shaders and Effects Cookbook

You're reading from   Unity 5.x Shaders and Effects Cookbook Master the art of Shader programming to bring life to your Unity projects

Arrow left icon
Product type Paperback
Published in Feb 2016
Publisher
ISBN-13 9781785285240
Length 240 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Alan Zucconi Alan Zucconi
Author Profile Icon Alan Zucconi
Alan Zucconi
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Creating Your First Shader 2. Surface Shaders and Texture Mapping FREE CHAPTER 3. Understanding Lighting Models 4. Physically Based Rendering in Unity 5 5. Vertex Functions 6. Fragment Shaders and Grab Passes 7. Mobile Shader Adjustment 8. Screen Effects with Unity Render Textures 9. Gameplay and Screen Effects 10. Advanced Shading Techniques Index

Scrolling textures by modifying UV values

One of the most common texture techniques used in today's game industry is the process of allowing you to scroll the textures over the surface of an object. This allows you to create effects such as waterfalls, rivers, lava flows, and so on. It's also a technique that is the basis to create animated sprite effects, but we will cover this in a subsequent recipe of this chapter. Let's first see how we will create a simple scrolling effect in a Surface Shader.

Getting ready

To begin this recipe, you will need to create a new shader file and material. This will set us up with a nice clean shader that we can use to study the scrolling effect by itself.

How to do it…

To begin with, we will launch our new shader file that we just created and enter the code mentioned in the following steps:

  1. The shader will need two new properties that will allow us to control the speed of the texture scrolling. So, let's add a speed property for the...
You have been reading a chapter from
Unity 5.x Shaders and Effects Cookbook
Published in: Feb 2016
Publisher:
ISBN-13: 9781785285240
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime