Papervision 3D Programming Tutorial - Enhanced Fog
Create a smooth fog look in Papervision using the standard Flash BlurFilter and ColorMatrixFilter. Demo and source code included.
VIEW THE DEMO
DOWNLOAD THE CODE
Previously I showed you how to use the FogFilter to implement a fog effect in Papervision. While it does the job, personally I think it’s a bit rough. Objects seem to pop out of the fog in jarring intervals, and for some reason there is a big performance drop when you set the segments over a certain amount.
This sample demonstrates the use of the standard Flash BlurFilter and ColorMatrixFilter to achieve the same fog look. If you compare the two samples side by side I think you’ll agree that the Enhanced Fog is a lot more subtle, and a lot cleaner. Using the Flash filters doesn’t seem to incur any noticeable performance hit either.
The code responsible for the fog is now in the Block class. Take a look at the setupFilters function, which is called every frame. It alters the colour and blur of the object depending on how close to the camera it is. The distances that are used to calculate the effects can be modified using the sliders in the top right hand of the screen.
The only real downside to this method is that it does not cull any objects that are totally obscured by the fog. The FogFilter does give some performance increase by not rendering objects behind the fog "veil" so to speak. However it would be a fairly trivial task to simply remove the object from the scene if it was beyond a certain distance from the camera manually.
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 - 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...
-
Papervision 3D Programming Tutorial - Texture Smoothing
| By mcasperson | in Programming
See the difference texture smoothing can make to your Papervision 3D applications. Demo and source code included....
-
Papervision 3D programming tutorials - Clipping & Culling
| By mcasperson | in Programming
See how to use Papervisions clipping and culling options to improve performance and visual integrity. Demo and sour...
-
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.