|
|
|||
|
3D page
visitors since 26/10/01 |
Powered by Eric Grange's |
|
|
|
|
|||
|
|
|
|
The shadows demo has been
updated. Some bugs were fixed, and it now runs much, much faster. The main bottleneck
is now the AGP-bus, since the Z-buffer of the main view, and the light-source
camera must be grabbed for every rendered frame, and then the shadow texture
must be passed back to the video card. On most video cards, this simple
transfer takes longer than the complex, but now highly optimised ray-casting
code for calculating the shadow texture. Watch this space though, I have some
new and exciting projects planned for the near future...
Download Shadows.zip(406
Kb)
|
|
|
|
This is a truly amazing
effect....Dynamic real-time soft shadows, that cast correctly onto walls,
curved surfaces, and other objects. These shadows are NOT pre-calculated,
but are calculated per pixel, and overlaid onto the scene in real time.
I wrote this code as a GLScene object, making it very easy to add
shadows to any scene, as shown by the accompanied demo. The camera,
light-source and objects can be rotated and moved around, and the shadows
instantly follow.
The TZShadow component
uses the OpenGL Z-Buffer to calculate the world-coordinate (xyz) of every
rendered pixel, and then traces a ray back to the lightsource, very similar to
ray-tracing, but in real-time. Every point that is not directly visible
from the light-source, is drawn as a shadow. I did NOT use the new GeForce
shadow-extensions, so this code should run on most older graphics cards, as
long as the Z-buffer is enabled.
Download Shadows.zip(406
Kb)
|
|
|
|
The ThorFX component is my first
attempt at writing a Special-effect type object for GLScene, and is based on Eric Grange's FireFX. This special-effect is mostly
for creating lightning-effects, and is animated, using a fractal algorithm, to
simulate the way electric arcs move. However, it is very flexible. The
"OnCalcPoint" event lets you easily write your own formulas for the
movement of the particles. ThorFX can be attached to any object in a
GLScene, and has plenty of parameters to play around with.
You can download Thor.zip(424
KB): (The demo is also included in GLScene,
under GLScene\demos\specialsFX\thor)



You can also see ThorFX in action in Robert Hayes's
excellent WorldScene Quake-like demo:
|
|
|
|
|
|
|
|
Here's my little Navigator demo
for GLScene, to demonstrate a textured
heightfield landscape with an MD2 Actor, distance-fog moving clouds and a
sky-dome. In the demo, you can drag with the mouse to rotate the camera view,
and use the cursor keys to make the actor run around.
The MD2 actor was downloaded
from http://www.polycount.com/ and the
texture and height-map were generated, using Terragen. In
the grayscale height-map image, the darker pixels represent the lower areas in
the mountain range, and the lighter pixels represent the peaks of the
mountains.
You can download the source
here: navigator.zip
(932 kB)
Here are some tips on how best
to create a suitable height-map & texture for this application:
As an alternative to using Wilbur, Eric Grange wrote a little utility (RawToBmp.zip)
to convert .raw files to a grayscale height-map. Instead of saving to
".ter", export with Terragen
to ".raw", open the ".raw" with the utility and save to
BMP, et voilà!.
![]()