Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Papervision3D Essentials

You're reading from  Papervision3D Essentials

Product type Book
Published in Sep 2009
Publisher Packt
ISBN-13 9781847195722
Pages 428 pages
Edition 1st Edition
Languages

Table of Contents (18) Chapters

Papervision3D Essentials
Credits
About the Authors
About the Reviewers
1. Preface
1. Setting Up 2. Building Your First Application 3. Primitives 4. Materials 5. Cameras 6. Moving Things Around 7. Shading 8. External Models 9. Z-Sorting 10. Particles 11. Filters and Effects 12. 3D Vector Drawing and Text 13. Optimizing Performance

Applying filters on viewport level


So far we have discussed applying filters on viewport layers. You can also apply a filter to the entire viewport. This can be done in two ways:

  • Directly applying a filter to the viewport, resulting in basic filter effects.

  • Using the BitmapViewport3D class to create a bitmap viewport of the rendered scene and apply filters to the data (pixels) of this bitmap. This allows you to create more advanced filter effects, for instance effects that can be best described as "trails".

For example, a trail is the illusion of vapor or smoke, as demonstrated in the following screenshot. It shows a particle moving upward, leaving a vapor or comet trail behind:

BitmapViewportExample

Directly apply filters to the entire viewport

Applying a filter directly to the entire viewport is easy and goes as follows:

var blur:BlurFilter = new BlurFilter(8,8,BitmapFilterQuality.LOW);
viewport.filters = [blur];

The previous two lines of code will blur the whole viewport, so every...

lock icon The rest of the chapter is locked
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 $15.99/month. Cancel anytime}