Book Image

Babylon.js Essentials

By : Julien Moreau-Mathis
Book Image

Babylon.js Essentials

By: Julien Moreau-Mathis

Overview of this book

Are you familiar with HTML5? Do you want to build exciting games and Web applications? Then explore the exciting world of game and Web development with one of the best frameworks out there: Babylon.JS. Starting from the beginning, the book introduces the required basics for 3D development and the knowledge you need to use the Babylon.js framework. It focuses on the simplicity provided by Babylon.js and uses a combination of theory and practice. All the chapters are provided with example files ready to run; each example file provides the previously learned features of the framework. Finally, developers will be ready to easily understand new features added to the framework in the future.
Table of Contents (15 chapters)
Babylon.js Essentials
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

Chapter 8. Add Rendering Effects Using Built-in Post-processes

Remember Chapter 4, Using Materials to Customize 3D Objects Appearance, about materials? Behind the materials are GPU programs called shaders. Shaders are a combination of two linked programs: the vertex shader and the pixel shader. The vertex shader works on vertices (transforms their 3D positions to 2D positions on the screen), while the pixel shader works on pixels (determines the final color of each pixel). Here, you can see the post-processes to be only a pixel shader since the vertex shader is the same for all.

Finally, the post-processes tend to create effects only in the view space. In other words, the post-processes are never applied to objects such as meshes, they are applied only to the camera itself. In this chapter, we will cover the following topics:

  • Using post-processes with Babylon.js
  • Using post-process rendering pipelines with Babylon.js
  • Discussing the built-in post-processes