
What's FxEngine?
FxEngine is a 3d graphics engine developed by the author of this site using the 3d hardware to its
limits and it's intended to
be a good resource to learn from, therefore I will present to you FxEngine along with sourcecode
which you can learn from and probably doing your own
3d engine (with your own effects hopefully).
There is just one thing to remember: I would really like to hear from you
who uses FxEngine. Tell me what you like, what you doesn't like and give
me some tip on how to improve it or even better: contribute with your own sourcecode.
In that way we all is going to learn from eachother and make even better things!
Currently supported features: (v0.41)
- Dithered bilinear filtered texture mapping
- Enviroment mapping
- Unlimited amount of RGB lightsources
- Landscape rendering
- Loading of heightmaps for landscape rendering (from I8 64x64 3df files)
- Unlimited amount of objects
- Translucent objects
- 3ds loader
- Real 3d clipping
- Multiple Camera support
- Gouraud shading
- Simulated phong shading (trough enviroment mapping)
- Collision detection (Object-Object and Object-Landscape)
- Object loader utility functions
- Particle system
- Lensflare effects
- Can specify different 3d rendering windows.
- Light mapping on landscapes.
- 2d text functions
- Smoke effects
- Nice restoring/loosing of focus for FxEngine applications.
(you know the irretating problem when you accidently hit the ALT-TAB key..)
- Skybox support
- Texture system which only loads required textures and with a texture cache
system that caches textures in system ram that can't fit in texture memory.
How do I contribute?
What you can do is either take a function and reprogram it keeping the inteface the same
or doing your own function, each function in FxEngine has
the prefix fxe and then the rest of the function name is given. The function names
should be selfexplained and heavily commented so users understand whats going on.
Along with your functions or datastructures or whatever send in a little textfile which
describes what your piece of code does so the rest of us doesn't get to frusterated : )
You shall send in the sourcecode to me this way.
How can I download FxEngine?
You can download everything needed to code FxEngine applications and the
sourcecode in a single package
here.
To install FxEngine, unzip it to a root directory
on one of your drives. It is important you unzip it into a root directory.
Don't worry about FxEngine will install itself into the root directory because
it is installed in the \3dfx\fxengine\ directory when unzipping into a root directory.
Important notes for the demonstration programs
To be able to run FxeWinTest with the old engine (v0.31) you need glide2x.dll in your c:\windows\system
directory. Yes, exactly that directory.
Portability - To use FxEngine on different plattforms
FxEngine v0.41 successfully compiles on MSVC++ 5.0. I hope
it will work on the most compilers out there.
If you only want to use FxEngine without using the source you can use Delphi too.
Just you the fxengine.pas unit in the delphi directory.
Doom5 is now finished with the FxEngine port to linux (v0.31). You can download it now!
Known bugs
- Translucent polygons doesn't work.
- Z sorting of particle system and smoke system doesn't work right.
Performance of FxEngine
- Can render 100k triangles/sec on a p266mmx, 64mb ram with v2 using trilinear filtered
texture mapping,
gouraud shading and one lightsource. On my machine the highest possibe polygon
throughput have been measured to 115k polys/second using flat shading.
What about documentation?
From version 0.2 and up FxEngine have its own documentation.
I recommends readers of the documentation to use win95 Wordpad and not MS Word as
the documentation is written in Wordpad. Be aware of that the documentation is
far from complete, I will improve it when I have time. Maybe I will convert it to
html so you can read it online if you want.
You can also check out the new FxEngine tutorials I have written, I hope
these tutorials will make it easier to understand and use FxEngine.
The documentation is in the FxEngine package which concists of the FxEngine
headerfiles, libraryfiles, sources and documentation.
And some screenshots!
These screenshots were taken from FxeWinTest with FxEngine version 0.31/0.35/0.37/0.40
on a 3d blaster voodoo2 at 800x600 and with trilinear filtering enabled.
It looks pretty good to me. Click on the pictures to enlarge them.
Currently Plans for FxEngine
Animation routines,
ASC loader,
bump mapping, BSP rendering, maybe OpenGL support. Explosion(!) routines...
Version 1.0: This version is the FINAL version. When this version is coming is
hard to tell right now as I have so much things I want to implement.
01/03/1999
FxEngine 0.41 is uploaded!
I want to begin with saying that FxEngine now is over a half year old. I have worked
on FxEngine in my freetime for a half year although not very hard lately...
Because of this I hope someone of you out there finds the engine useful. A lot
of people have had problems of using it much because of its lack of documentation.
I really hope the tutorials can be written soon... The problem is that the coding
takes up all my time.
So what can I say about the new features of FxEngine 0.41?
Well, here is a list:
- I have coded a new texture cache system which can cache textures in system ram that
there isn't room for on 3dfx card. In FxEngine 0.40 the engine did just lookup
when there wasn't any texture memory left. This wasn't good, I agree. For speed
reasons the best thing of course still is too use as small textures as possible
to save texture memory. But you can load many large textures if you want now.
- When the application using FxEngine lost its focus because the user pressed the
ALT-TAB key the application failed to restore itself when it recieved focus
again. This is fixed now. When your application is inactivated then call the
fxeLooseFocus function and when your application is receiving focus again call the
fxeSetFocus function. Check out the fxewintest2 program for the details.
- Fixed some problems in the Delphi port, I had left some function prototypes out from the
fxengine.pas file but now they should be there.
- Enviroment mapping should work fine now.
- Fixed problem with the lensflare effect causing the lensflare to display although
the lightsource was behind a object or a landscape.
12/12/1998
Hello, if you haven't noticed finally version 0.40 is online.
I have put a big effort in this release. New is support for
light mapping on landscapes, it really looks good. New support for dynamic lightsources. Simple lightsources that only
have a r,g,b intensity and a radius around it. Good if you want explosions and the like. Also support for Delphi,
now you can use Delphi too if you want to use FxEngine. Just use the
new fxengine.pas unit in the delphi directory. Better support for v1 and
voodoo rush in this release since FxEngine is not using clip coordinates anymore,
which have been a problem in Glide3 drivers for these cards. Of course
some bugfixes is also included in this release although I think that this
release will introduce some new ones too ;)
11/21/1998
I have been gone a while since last time. I have been very busy and I haven't time to code much on
the engine. Now it should work fine on voodoo1 and
voodoo rush since I have a separate version now that not it using clip coordinates,
clip coordinates doesn't seem to work at all on these cards. I have had a report of that
FxEngine crashed on a voodoo rush when calling this glide function:
grCoordinateSpace(GR_CLIP_COORDS);
Can you imagine that? It isn't even POSSIBLE to initialize clip coordinates in on a voodoo rush!
Also I have had a report from a guy that asked 3dfx what to do about it. The answer was really lame:
"Don't use clip coordinates"
That's why my engine haven't worked for you v1 and voodoo rush owners out there...
What's the new features of FxEngine 0.38 then? Well now you can specify a 3d render window anywhere
on your screen, also added function for collision detection Landscape-Object. Also implemented Lens Flares
.
(Many thanks goes to Daniel M Jones for the Lensflare and Terrain Following).
10/24/1998
FxEngine 0.37 is online. I have implemented the particle system I talked about and it looks
very good. It is very much based on the particle system by Daniel M Jones that was written for
the old engine for MSVC (v0.31) using glide2. Also I have extented the collision detection routines to detect collisions between
landscape and object. I have added a function for loading a heightmap from a 3df file that is used
for landscape rendering. It is very easy to design your own landscapes now I think.
(Just make a 64x64 grayscale tga image in Paint Shop Pro then convert it to a 3df file
in the i8 (intensity 8 format) with the texus utility). This way you can design a landscape in
a matter of minutes. I have fixed several bugs also as usual. Especially the clipping bugs
in the landscape renderer. The engine have been tested on voodoo2
with the newest glide3 reference drivers from 3dfx, I recommends all of you too download these
drivers as they finally seems to be stable...
I have also rewritten the documentation for FxEngine including some tutorials I have put up on this site.
I hope that with these tutorials and better documentation FxEngine will be more easy to use.
In this version FxEngine is shipped as a static linked library instead of a dll. It have been
compiled successfully with MSVC++ 5.0.
I have optimized the shading function, the engine now precalculates the normals of all polygons
(much faster than calculating them in real time...)
I have worked on a system to load textures, objects and so on from the exefile instead of loading files from
disk, for the moment it works with 3ds files.
FxEngine is now (again) shipped as a single package with everything you need to use and compile FxEngine.
So what am I currently working on?
I want to rewrite the character set loading functions so that all characters of a characterset
can coexist in the same 3df file instead of a file for every character. Also memory requirement optimizations is to
expect. I know that when large objects is loaded (10000 polys) then
they eats terribly much memory.
10/06/1998
FxEngine 0.36 is online. I have fixed slow z sorting with translucent polygons.
Implemented collision detection (Object-Object) and multiple camera support. Also
you can now lock a camera at a object. When the camera is locked it will always look
in the direction towards the object it is locked on. I have written some object loader
utility functions, it will make it easier to make new object loaders for FxEngine than
before. The reason why I did these functions is mainly because a user of FxEngine wanted
to code a md2 (quake2 model) object loader for FxEngine but he was he was very confused
of the object structure of FxEngine (I can't blame him...). The object loader utility functions
is functions to perform default initialization of a object. Add vertices and polygons to
it and so forth. It will be much easier to write object loaders for FxEngine now I think.
My current plans right now is to implement the particle system you could see in FxEngine 0.30
for MSVC++ in the new version of FxEngine. (In the FxEngine glide3 driver). The
main reason for this is that it looks VERY good. Also I want to precalculate the normals
of all polygons to speedup the engine. This will probably be in version 0.37.
09/21/1998
Finally FxEngine 0.35 is out. I think it's enough bugfree now to release
FxEngine 0.35.
Included landscape and fogging support in FxEngine 0.35. Fixed camera bug. Fixed
3ds loader bug + some more I have forgot by now.
09/18/1998
FxEngine is now fully compatible with MSVC++ 5.0. I have compiled the engine and the samples
successfully. The 3ds loader is still some buggy, the normals screw up so the
backface removal code is removing wrong polygons and the lightning function
lits object in the wrong direction. I'm working on this.
09/16/1998
I have made several bugfixes in the FxEngine 0.35 glide3 beta driver (not in 3dfx own ;-).
Particularly the lightning functions
which crashed if some 3ds objects was loaded. Also flat shading should work properly.
I hope this version now will work with voodoo1. Maybe the reason why it didn't work was
the buggy lightning routines... Download the glide3 beta driver I put up for voodoo1 and try that too and
see if it helps. With this driver FxEngine have never crashed on my computer, yet...
The only things that not is working in this version is landscape rendering and fogging.
Soon I hope I can release the real FxEngine 0.35 Glide3 driver. In this version everything
must work, yes landscapes and fogging too.
09/15/1998
I now have done a completely new structure of FxEngine. FxEngine now use drivers in
Dll's instead of statically libraries. This makes it much easier to make bugfixes,
you don't need to recompile your applications, just copy the new dll into the directory
where the exefile of the application is. This also makes it possible to use different
drivers for different hardware. Currently FxEngine only have a glide3 driver but
a OpenGL driver is planned. You can have different drivers installed and when your
FxEngine application is starting up you can choose which driver you want to use.
I also fixed some bugs in the glide3 driver, It now starts up in 60Hz instead of 85 Hz.
Maybe this was why 0.35 didn't work on v1.
09/14/1998
I have fixed some bugs in FxEngine 0.35. Transparent objects works now,
the 3d clipping works too. The clipping routines was very hard too write
but I hope 3d clipping will work properly now... The landscape renderer
doesn't work well on glide3 yet, I'm working on it. When finished
I will upload the real FxEngine 0.35, not beta anymore. I don't want
you too use buggy software, that's why.
09/11/1998
Do you wonder why FxEngine haven't been updated I say it's for good reasons.
I have been working with glide3 very much and have so much trouble using its
new features I think a article about it is just a must read!
The glide3 programmers reference have many bugs I have discovered. I have
found out some very strange bugs in it. It can of cource be explained with
buggy glide3 drivers.
Don't misunderstand me: The new glide3 seems very good but now as a start
we maybe have to live with some bugs until they have been fixed.
Also I have delved into BSP trees, it was harder than I thought...
A beta of version 0.35 is available for download!
Be aware that this version is very unstable and have a lot of bugs in the code.
The clipping code doesn't work, landscapes don't and a lot of other things.
So what do you get? A lot of bugs???
You get a version of FxEngine that demonstrates a engine running on top of glide3x,
a 1.5x performance increase, support for enviroment mapping and a working 3ds loader
that can load geometry data and materials from 3ds files.
Also added in this version some new functions for 2d bitmap rendering.
Also I have heard of a camera bug, I will fix it as soon as possible. A guy who is
calling himself doom5 is doing a port of FxEngine to linux, it will hopefully be finished
in a couple of days.
Glide3x is really a topic of itself, I downloaded the reference drivers from 3dfx and
they was VERY buggy, I recieved new drivers from 3dfx for a weak ago, and they worked
pretty good, not perfect but pretty good. I think that we have too wait for better
drivers from our card manufacturers before we get stable glide3 drivers.
Especially the voodoo rush drivers for glide3 seems not to work properly. FxeWinTest
(a demonstration program in FxEngine) runs fine on my v2 but crashes on a voodoo rush.
If anyone have a voodoo rush and feel for coding, please take a look at the sources and
tell me what's wrong. As I don't have a voodoo rush I can't test it on such a card. I
really want FxEngine to be a stable peace of software :)
I'm currently working on 3d clipping routines, the clipper is broken right now.
The clipping will be real 3d clipping, this is a MUST in glide3 with clip coordinates,
as glide3 is performing perspective projection the clipping can't be done in 2d.
08/14/1998
Version 0.31 of FxEngine is online!
I haven't had much time to code the last days but I have implemented
some 2d text routines. Very simple but very useful. You can zoom in/out
your text and make it translucent. You also can discard a choosen color
completely. Like a bluescreen effect used in the movies.
I have recieved a message from one of my readers that he wants a 3ds
loader for FxEngine and I'm currently working on one. The 3ds format
is probably the best format for a loader since there is many programs
that can convert to this format and of cource it is used by the
3d studio modeller too. When this loader is finished it will be more
easy to use FxEngine, you don't need to hardcode your objects...
08/10/1998
Version 0.3 of FxEngine at last...
I have coded like a svine and the sources have grown a bit. I have made
some assembly level optimizations of some math routines. I have implemented
landscape rendering. I had not thought about it until for a weak ago when I started
to implement it. I was just bored of the black background of my objects so I was
forced to do this...
One thing was true, I have implemented transparency in this version. I have rewritten
the manual a bit and rewritten the demonstration programs. Currently
working on enviroment mapping, animation routines and multiple camera support.
07/28/1998

Version 0.24 of FxEngine is here. I have implemented flat shading (although I
don't think you will have any use for it unless for speed reasons) and optimized the
ShadeObjects function. This single optimization made unbeliveable results.
FxeWinTest ran 3.8 times faster when the function was optimized! Also I optimized
the Projection/Render function which now is the main bottleneck for speed. These
optimizations made FxEngine render over 30000 polygons/second with voodoo2 at 800x600
with gouraud shading, trilinear filtering and three different RGB lightsources on a
P233 MMX and
I haven't optimized it very much yet. That is a nice 5 times speedup since last version.
I said that FxEngine should render at least
15-20 thousand polygons per second when finished. I have now changed it to at least
around 100k polygons/second. When I saw that a 3dengine could render
150k polygons/second on a voodoo1 with a P200 I saw that my engines speed must be very poor...
But that engine only used flat shading and 640*480 without texture mapping...
Anyway, more optimizations is coming!
I have also corrected the gouraud shading functionality, it should work perfect now. I
have also changed some of the datastructures to be more effective when used with FxEngine.
I have implemented new properties of a lightsource, except the position and r,g,b componponents
of a lightsource it can also affect objects in a given distance differently depending
on the value of a new datamember in the lightsource structure. This means that a lightsource
can give light on objects far away from it or only very close to it depending on this
new datamember. Also I have rewritten the demonstration program to have 10 objects
with various captions and variable lightsources. Use the L key to change lighting mode.
I think FxeWinTest is beginning to be quite cool!
07/26/1998
Version 0.23 of FxEngine. Now the 3d clipping should work rock solid! The 3d
clipping was quite a challange when you consider you need to find new
coordinates of the polygon when the polygon intersects with the near clipping
plane. (You have to clip to this plane as you must avoid divide by Zero)
You not only need to clip the polygons, you need to clip the textures
too if any texture is used on a polygon. I have worked with this single problem
for at least a couple of days now but now I think it is solved.
(After some resarch in one of Michael Abrash's great books, specifically
Graphics Programming Black Book - a MUST READ for performance graphics programmers
as ourselves)
I have optimized
a bit at the fundamental level too. I have also implemented a very simple form
of fogging. If you want your objects can now fade away with fog in any color.
Also I have began coding on some 2d text functions. It is very easy to implement
cool text effects with Glide. You only draws a rectangle polygon and maps a
texture on it that looks like a character. You can easily use transparent text
and zoom it in and out as you want. I must say that Glide is really a very good
API. It's only a pity that Glide is only supported by 3dfx cards. Now with the
new Banchee chip coming strong we at least have one more card that will support
Glide! You can of cource expect me to finish the text functions and now I will
work most on implementing Enviroment Mapping. I have actually done some code for
it already but it isn't really finished yet.
07/23/1998
Version 0.22 of FxEngine. I have added a cylinder creation function, it
doesn't really extend FxEngine but make it possible to test FxEngines
speed because cylinders have a LOT of polygons. When I tested out
FxEngine with the cylinders I directly noticed that currently FxEngines
speed is quite poor because on a P233 MMX with voodoo2 at 800x600 it can take no more
than around 6000 textured, gouraud shaded, z buffered polygons with three lightsources
at once without
starting to slow down and my goal
is at least around 15-20 thousand polygons per second on that machine.
I have also made a new polygon clipper and have made some performance tuning
(not very much). The backface culling works perfect now and the object clipper
works better than before. A great deal of work have been the clipping functions
as you see and now when the 3d cards is selling more and more and the cards take
over the rendering the clipping is going to be one of the the most important parts to
do well to make a good 3dengine. The polygon clipper is going to be improved,
it shall clip polygons that are only partly visible which will eliminate the
slow clipping on the 3dfx cards.
The improvements in FxEngine is now
most concentrated around clipping and enviromental mapping. Now you
can notice a speed decrease when a object is moved away from the
screen as the 3dfx card tries to clip the polygons. The 3dfx card is
INCREDIBLY slow at clipping and that's why it all slows down.
The lightning function must be totally rewritten as it's very slow.
And I don't even have mentioned all math functions that will be converted
to assembly language.
07/10/1998
Version 0.21 of FxEngine is out. A nice guy called Hugues Landry have
contributed with some matrix math. The matrix math functions is now
used in FxEngines object rotation and world to camera transformation
functions. Thanks you Hugues for this. I have also implemented some
new functions but most of them are transparent for the application
programmer. Mostly it is optimizations in the fxeRenderWorld function.
New is support for ambient light (I know - it was VERY EASY to implement
this) through the fxeAmbientlightLight function. The documentation have
been altered so you better read it! Some minor changes in the
datastructures, they should be some nicer now I hope. Currently
I'm working on a object loader function so you don't need to hardcode
every single object... You can expect the object loader to be finished
in version 0.3 of FxEngine.
07/07/1998
Version 0.2 of FxEngine is here, FxEngine now supports real world to
camera transformations making it possible to move around in your
universes! I have also been working on the ClipObject function but
it isn't finished yet. For the moment I'm concentrating on making
FxEngine bugfree and fast. A reader will perhaps contribute with some
matrix math which will make the overall performance better when
many polygons is involved. I have also made a new demo program showing
of the camera transformation functionality in FxEngine. The new demo
program is a win32 windowed executable, not console anymore. Don't
worry because no changes have to be made to FxEngine because of this,
the API is the same as before. Just remember to link the demo program
as a win32 windowed application or else it will not work. As mentioned above
FxEngine now have documentation making it easier to use it than before.
There is pretty much info in there! Since version 0.1 some bugfixes have
been made.
06/29/1998
The Second release of FxEngine is here, now FxEngine supports texture
mapping with trilinear filtering on a voodoo2 and bilinear filtering on
voodoo cards. Some bugfixes too. Also updated the demonstration program
to support FxEngine's new texture capabilities and now the demo should
work fine on voodoo cards too.
06/28/1998
The first release of FxEngine is online, this version supports a
unlimited amount of RBG lightsources, backface removal, object rotation
and translation along with gouraud shading. It isn't very advanced yet
but I think it's a good
way to learn 3d engine programming on the 3dfx. You can run FxEngine
in different modes depending on your hardware. You can run it on
voodoo using the lowest setting and on a voodoo2 using a higher setting.
The code is a mess right now but I will improve this, the main reason I have
put up FxEngine now is because I wanted to release something for you to
see, I think the RGB lightning is quite cool! That's all for now, MORE stuff
is coming.