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

Using post-process rendering pipelines with Babylon.js


Now, you are able to create post-processes and attach them to a camera. The problem is that if you manage multiple cameras in your project, then you'll have to dispose or detach post-processes in order to reattach them to a new camera. To facilitate the task, you can use the rendering pipelines. In other words, you can see a rendering pipeline as a list of post-processes, which you can attach to multiple cameras.

Create a rendering pipeline

The steps consist on creating a pipeline reference, adding the pipeline to the scene, and attaching the pipeline to the cameras.

Create a rendering pipeline, as follows:

var pipeline = new BABYLON.PostProcessRenderPipeline(
  engine, // The Babylon.js engine
  "renderingPipeline" // The name of the rendering pipeline
);

Once the pipeline has been created, add it to the post-process render pipeline manager of the scene (referenced by the engine that you passed as an argument to the rendering...