Papervision 3D Programming Tutorial - Fog
Learn how to implement a fog in Papervision. Demo and source code included.
VIEW THE DEMO
DOWNLOAD THE CODE
There was an old PC game that I used to love called Magic Carpet. It was one of the first 3D games that featured an outdoor world. Its biggest drawback was the limited distance that you could see: the game made heavy use of fog to limit how much of the world was actually drawn, and therefore maintain the frame rate. It’s a simple and effective trick.
Papervision also supports a fog through the FogFilter class. Despite the advances in performance made by the Flash runtime, performance is still a big consideration. For this reason you can use the FogFilter to limit the drawing distance of the Papervision renderer, which will increase the performance.
To implement the FogFilter you simply need to assign it to the BasicRenderEngine.filter property. You can see how this is done in the ApplicationManager class.
One of the properties in the FogFilter is segments, which defines how many discreet depths there are to the fog. The sample application allows you to play with the segments property dynamically using the slider at the top of the screen. One thing I found interesting was that on my PC having 23 segments produced a reasonable frame rate, while the jump up to 24 drops the frame rate significantly. Try it for yourself and see if you get the same results.
Go back to Papervision Tutorials

-
Papervision 3D Programming Tutorial - Creating a Papervision Component
| By mcasperson | in Programming
See how Papervision can be packaged into a SWC Flash component, which allows you to drag and drop Papervision into ...
-
Papervision 3D Programming Tutorial - Traer Physics
| By mcasperson | in Programming
See how to implement cloth physics in Papervision 3D. Demo and source code included....
-
Papervision 3D Programming Tutorial - 3D Image Transitions
| By mcasperson | in Programming
Implement 3D image transitions with this Papervision demo . Source code and online example included....
-
Papervision 3D Programming Tutorial - Environment Mapping
| By mcasperson | in Programming
Learn how to implement environment mapping with Papervision....
-
Papervision 3D Programming Tutorial - Terrain
| By mcasperson | in Programming
Learn how to create a realistic looking terrain mesh and texture that can be imported into Papervision. Demo and so...
-
iPhone Resizing a UIImage | By eh9212 | in Programming
How to resize a UIImage in a UIImageView and a UIButton...
-
Threading in dot net 2.0 - separate copy of static variable among different threads using ThreadStatic attribute | By xxris | in Programming
How each thread keeps a separate copy of same static variable using ThreadStatic attribute ....
-
ADAPATIVE ALGORITHM TO FINDOUT DUPLICATE RECORDS | By pinakbhusanmishra | in Programming
Records are list of row that are stored inside database . this is an efficient technique to find out the duplicatin...
-
ALGORITHM TO FIND OUT HIDDENLINKS IN WEBSITES | By pinakbhusanmishra | in Programming
Here we can find out the hidden links in the websites that basically people uses for the browsing ads....
-
PHP and MySQL | By ChaimChaikin | in Programming
PHP is a server side programming language that is used mainly for dynamically creating and mantaining websites. PHP...
-
AS3IsoLib Tutorial Series - Interaction | By mcasperson | in Programming
In this tutorial we add mouse interactivity to the scene....
-
AS3IsoLib Tutorial Series - Camera | By mcasperson | in Programming
In this tutorial we allow the view of the isometric scene to be moved with the mouse....
-
AS3IsoLib Tutorial Series - Height | By mcasperson | in Programming
In this tutorial we show the height of an isometric object by adding a shadow....
-
AS3IsoLib Tutorial Series - Materials | By mcasperson | in Programming
In this tutorial we modify the appearance of the isometric cube at runtime....
-
AS3IsoLib Tutorial Series - Moving Boxes | By mcasperson | in Programming
In this tutorial we add some animated isometric boxes to the scene....








No comments yet.