Here is the code activating the fog in the background.
if foggy then
Fog (FOG_MODE, LINEAR);
Fog (FOG_COLOR, fog_colour(0)'Unchecked_Access);
Hint (FOG_HINT, FASTEST);
Fog (FOG_START, 1.0);
Fog (FOG_END, 0.4 * fairly_far);
~~~... read more
It's stunning how the inventors of GL addressed from the beginning, in 1991, subtle issues popping up when displaying 3D object in your own program 25 years later.
For instance, take this model:
It is a cross shaped (considered from above) object; texture has lots of transparency.
In the red rectangle you see the issue: the face in front was displayed before the face behind.
There is no bullet-proof rule for sorting faces, and GL has a per-screen-pixel depth buffer that allows displaying faces in an arbitrary order. So we don't want to introduce imperfect face sorting just for dealing with this kind of object.
Fortunately, the GL geniuses have invented a solution for that issue too:
Enable (ALPHA_TEST); AlphaFunc (GREATER, 0.05);
... read more
In revision #311, two important improvements to make the o2g translator more handy.
The texture loader in GL.IO was around 15 years old and supported only the Targa (.tga) format for textures, plus a few sub-formats of Windows bitmaps (.bmp).
In order to make things easy when dealing with various models, e.g. those imported from Blender, the old code for reading images has been wiped out and the loader is using now GID for the job, supporting JPEG or PNG in addition. For instance the Blender model below is using the JPEG format for textures.... read more
Basically, it is possible now to import a model saved in Blender as a Wavefront (.obj) model, and turn it into a GLOBE_3D object.
The translator is in ./tools/wavefront
The D3G tool now is able to translate all models correctly into .g3d objects, in addition to the special models corresponding to areas. This needs the presence of the file [level].map beside the [level].proc file.
The difference is visible in the main demo: now glass or various previously missing objects are visible.
The translation of the following model (a cathedral) was pretty incomplete without latest improvement in D3G:
Screenshots before (diffuse only):
after (diffuse + specular):
On a 16th April 2008, a first release was set on SourceForge, packaged in a Zip file, with full sources, GL bindings, and a pre-compiled demo (Windows, Linux).