|
1. To have the object fade in or out as it nears another object (eg a camera), you will need to set the Point X, Y and Z in the shader to match the camera's location. Just copy the object location from the camera's Object Properties box into the Point X, Y and Z of the shader.
2. You can move the point used to test for distance rather than move the object - just keyframe different values into the Point X, Y and Z of the shader. For very unusual effects, keyframe lots of direction changes for the point!
Note that this effect does not follow the camera automatically, unlike the original Distance Transparency. You'd have to set keyframes for the Point X, Y and Z to follow the path of the camera, which would be very difficult for all but the most straightforward of animation paths.
3. An Explanation Of Using Distance To Plane This is best illustrated with an example. Let's make an object appear as it nears the ground.
Set Point X, Y, Z to (0,0,0), which is the world origin (any point will do, really, so long as the Z is 0 in this case, since that's ground level). Remember that the plane normal is at right angles to the plane itself, so for the ground we want the normal to be pointing straight up. To achieve this, set the Plane Normal to (0, 0, 1).
Now ensure that Use Plane? is checked, set the distances from the ground where you want the object opacity to change, and you're done!
For a plane at the location of a StarGate (say), facing toward the front view in the world, set Point X, Y, Z to the location of the StarGate object, then set the Plane Normal to (0, 1, 0).
You can of course set angled planes, by setting more than 1 of the x, y and z values for Plane Normal, but be prepared to do some math to figure out the necessary normal! I would suggest keeping the plane aligned to the x, y or z axis of the world, so it would be worth giving some planning to your scene to ensure that this is how it is set up (you can then always angle the views and objects to the plane).
Remember that it will make a difference whether Use Absolute Distance? is checked or not. In our first example of setting the ground as the plane, anything above ground level will have a positive distance, whereas anything below ground level will have a negative distance. By checking Use Absolute Distance? you remove this distinction, and anything above or below the plane will have a positive distance.
4. Use Object Location? Check this parameter, and the whole object will take on the same transparency. With it unchecked, the transparency can vary across the object. For appearing through a StarGate type effect, I'd suggest leaving it unchecked, so that only the parts of the object that have passed through the StarGate become visible. For a decloaking ship, I'd suggest checking this parameter, so that the whole ship decloaks evenly.
5. Placing The Point Inside The Object You can place the point used to test distance inside the object itself. If you leave Use Object Location? unchecked, you can create effects such as the outer edges of the object being transparent while more central points are solid. Try creating and centering a cube, and positioning the Point X, Y and Z at (0,0,0) to see what I mean.
This could be useful for creating new types of glow effects (since unlike SphereGlo and TG Glow, it is not dependent upon the angle of view, only on the distance from a point). |
|