You are previewing Unity Shaders and Effects Cookbook.
O'Reilly logo
Unity Shaders and Effects Cookbook

Book Description

Shaders promote gaming realism but are not always easy to implement. This book seeks to change that with a cookbook approach to teaching you how to create stunning Shaders using your knowledge of Unity3D.

  • Learn the secrets of creating AAA quality Shaders without having to write long algorithms

  • Add realism to your game with stunning Screen Effects

  • Understand the structure of Surface Shaders through easy to understand step-by-step examples

  • In Detail

    Since their introduction to Unity, Shaders have been notoriously difficult to understand and implement in games: complex mathematics have always stood in the way of creating your own Shaders and attaining that level of realism you crave. Transform your game into a highly polished, refined product with Unity’s post-processing effects.

    "Unity Shaders and Effects Cookbook" is the first of its kind to bring you the secrets of creating Shaders for Unity3D - guiding you through the process of understanding vectors, how lighting is constructed with them, and also how textures are used to create complex effects without the heavy math.

    Starting with essential lighting and finishing up by creating stunning Screen Effects alike those in high quality 3D and mobile games. Discover techniques including Normal mapping, Image based lighting, and how to animate your models inside of a Shader. Explore the secrets behind some of the most powerful Shaders including skin and hair! With "Unity Shaders and Effects Cookbook" what seems like a dark art today will be second nature by tomorrow.

    Table of Contents

    1. Unity Shaders and Effects Cookbook
      1. Table of Contents
      2. Unity Shaders and Effects Cookbook
      3. Credits
      4. About the Author
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Downloading the color images of this book
          3. Errata
          4. Piracy
          5. Questions
      8. 1. Diffuse Shading
        1. Introduction
        2. Creating a basic Surface Shader
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        3. Adding properties to a Surface Shader
          1. How to do it…
          2. How it works…
          3. See also
        4. Using properties in a Surface Shader
          1. How to do it…
          2. How it works…
        5. Creating a custom diffuse lighting model
          1. How to do it…
          2. How it works…
          3. There's more…
          4. See also
        6. Creating a Half Lambert lighting model
          1. How to do it…
          2. How it works…
        7. Creating a ramp texture to control diffuse shading
          1. Getting ready
          2. How to do it…
          3. How it works…
        8. Creating a faked BRDF using a 2D ramp texture
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
      9. 2. Using Textures for Effects
        1. Introduction
        2. Scrolling textures by modifying UV values
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Animating sprite sheets
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        4. Packing and blending textures
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        5. Normal mapping
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        6. Creating procedural textures in the Unity editor
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        7. Photoshop levels effect
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
      10. 3. Making Your Game Shine with Specular
        1. Introduction
        2. Utilizing Unity3D's built-in Specular type
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Creating a Phong Specular type
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Creating a BlinnPhong Specular type
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Masking Specular with textures
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Metallic versus soft Specular
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        7. Creating an Anisotropic Specular type
          1. Getting ready
          2. How to do it…
          3. How it works…
      11. 4. Reflecting Your World
        1. Creating Cubemaps in Unity3D
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        2. Simple Cubemap reflection in Unity3D
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Masking reflections in Unity3D
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Normal maps and reflections in Unity3D
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        5. Fresnel reflections in Unity3D
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Creating a simple dynamic Cubemap system
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
      12. 5. Lighting Models
        1. Introduction
        2. The Lit Sphere lighting model
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        3. The diffuse convolution lighting model
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        4. Creating a vehicle paint lighting model
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        5. Skin shader
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        6. Cloth shading
          1. Getting ready
          2. How to do it…
          3. How it works…
      13. 6. Transparency
        1. Introduction
        2. Creating transparency with alpha
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Transparent cutoff shader
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Depth sorting with render queues
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. GUI and transparency
          1. Getting ready
          2. How to do it…
          3. How it works…
      14. 7. Vertex Magic
        1. Introduction
        2. Accessing a vertex color in a Surface Shader
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        3. Animating vertices in a Surface Shader
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Using vertex color for terrains
          1. Getting ready
          2. How to do it…
          3. How it works…
      15. 8. Mobile Shader Adjustment
        1. Introduction
        2. What is a cheap Shader?
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Profiling your Shaders
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        4. Modifying your Shaders for mobile
          1. Getting ready
          2. How to do it…
          3. How it works…
      16. 9. Making Your Shader World Modular with CgIncludes
        1. Introduction
        2. CgInclude files that are built into Unity
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Creating a CgInclude file to store lighting models
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Building Shaders with #define directives
          1. How to do it…
          2. How it works…
      17. 10. Screen Effects with Unity Render Textures
        1. Introduction
        2. Setting up the screen effects script system
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        3. Brightness, saturation, and contrast with screen effects
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Basic Photoshop-like blend modes with screen effects
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        5. The Overlay blend mode with screen effects
          1. Getting ready
          2. How to do it…
          3. How it works…
      18. 11. Gameplay and Screen Effects
        1. Introduction
        2. Creating an old movie screen effect
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Creating a night vision screen effect
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
      19. Index