DX Fog Shaders

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

DX Fog Shaders // The Garage

1  |  

Post by Délé // Apr 23, 2008, 4:46am

Délé
Total Posts: 1374
pic
Here is a library with the DX Fog Shaders that I've been working on. I haven't had time to make the video to demonstrate how to use them yet, but I figured that I'd upload the library in the meantime.


There are several things included in the library:

1. Several Fog Shaders that you can drag and drop onto your 3d objects.

2. Several shader bricks that you can use to build your own fog shaders.

3. A couple of lights that fade out as you move away so they work with the fog shaders.

4. A demo scene (Underwater Ruins) that demonstrates the use of both the Splend and Fog shaders.


I will make a video demonstrating how the Fog Shaders work when I get a chance. When I have that done I'll update this post with it. Until then, here are some tips.


The Fog Shaders work by making your object fade to a solid color based on the distance from your view. You can adjust the fog color and distance on the shaders. This is not as good as real DX Fog, but could work as a substitute until it is implemented (hopefully it will be).


Some things to keep in mind:

1. The Fog Shaders work on a per object basis. So you will have to apply the shader to each object in your scene that you want to have fade out. You will likely want to make sure the distance and fog color is the same for each object.

2. The Fog Shaders require uniform lighting. This is a bit of a drawback. You will likely want to use an ambient light to create uniform lighting. I have included two lights in the library that are intended to work with the Fog Shaders. There is a spot light and omni light. They fade out as you move away so the lighting in that area returns to the uniform lighting you have created with the ambient light. No other lights other than the three mentioned here will work well with the Fog Shaders.

3. If you have a large object (such as the ground), you will want to make sure that you have enough geometry to it. If it's just one big polygon, you probably will get lighting differences as you move from one side to the other.


There are several Fog Shaders included in the library, including a couple combinations of the Splend and Fog Shaders. There are also the shader bricks so you can assemble your own custom fog shaders.


If you have any questions, feel free to ask. :)


12190

Post by kena // May 7, 2008, 1:18am

kena
Total Posts: 2321
pic
Can't have enough shaders. thanks.. Looking forward to the demo/tutorial.
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn