Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Panda3D 1.7 Game Developer's Cookbook

You're reading from   Panda3D 1.7 Game Developer's Cookbook Over 80 recipes for developing 3D games with Panda3D, a full-scale 3D game engine

Arrow left icon
Product type Paperback
Published in Mar 2011
Publisher
ISBN-13 9781849512923
Length 336 pages
Edition Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (20) Chapters Close

Panda3D 1.7 Game Developer's Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Setting Up Panda3D and Configuring Development Tools FREE CHAPTER 2. Creating and Building Scenes 3. Controlling the Renderer 4. Scene Effects and Shaders 5. Post-Processing and Screen Space Effects 6. 2D Elements and User Interfaces 7. Application Control 8. Collision Detection and Physics 9. Networking 10. Debugging and Performance 11. Input Handling 12. Packaging and Distribution 13. Connecting Panda3D with Content Creation Tools Index

Adding a depth of field effect


An effect you can very commonly see in photography is objects that are very close to or very far away from the point of view. Therefore, appearing fuzzy and blurred while the middle portion of the image appears focused and sharp, emphasizing an object of interest in the scene. This focused part of the scene is referred to as 'depth of field'.

In this recipe you will learn how to mimic this cinematic effect in a post-processing filter. This will help you to emphasize the visual depth of a scene and focus a point of interest while blurring the background and foreground.

Getting ready

Set up the project structure found in Setting up the game structure, add a directory called shaders inside the project directory, make sure it is in the engine's search path and you're ready to go!

How to do it...

This recipe requires you to write some Python and Cg code as presented in the following steps:

  1. Paste the following code into Application.py:

    from direct.showbase.ShowBase import...
lock icon The rest of the chapter is locked
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Panda3D 1.7 Game Developer's Cookbook
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
Modal Close icon
Modal Close icon