No description
Find a file
Randy Heit dca5f0e908 Added QF_SINE
- Squashed commit of the following:

commit bc45fe3263d34ef5f746f524687999c19bf7b779
Author: Randy Heit <rheit@users.noreply.github.com>
Date:   Sun Mar 1 18:51:05 2015 -0600

    wave scale -> wave speed

commit ff96388b128c724c1198757bfa52f1935a263356
Author: Randy Heit <rheit@users.noreply.github.com>
Date:   Sun Mar 1 18:45:32 2015 -0600

    More sine quake fixes

commit 2a89749a6fe6d271b9fbdc218779f680afcf4cb6
Merge: 719dfbe 5456074
Author: MajorCooke <paul.growney22@gmail.com>
Date:   Sat Feb 28 20:37:22 2015 -0600

    Added QF_WAVE to A_QuakeEx.
    - Changes the random quakes into a sine wave (see Shadow Warrior/Rise of the Triad reboots, Hard Reset, etc.)
    - Added 3 properties to control waves per second along each individual axis. Only works with QF_WAVE.
    - Intensity X/Y/Z property becomes the amplitude of the wave.
    - Stacks with regular quakes, allowing shaking along the camera which must be called using A_QuakeEx WITHOUT the flag, or the other quaking functions.
    - Uses the youngest quake's time for positioning.

commit 54560741581e8d15cc7060e8e068cf85e9a4b432
Author: MajorCooke <paul.growney22@gmail.com>
Date:   Sat Feb 28 20:21:19 2015 -0600

    Recommitted recommended changes by Randi, with some modifications. Now, we should be finished!

commit 6f4473013411686d88fc185bdc1cc58b1035b0f1
Author: MajorCooke <paul.growney22@gmail.com>
Date:   Sat Feb 28 12:52:57 2015 -0600

    Finish this revert.

commit 467e53f9400f588a2ada9b32e7634cb1f4ad5066
Author: MajorCooke <paul.growney22@gmail.com>
Date:   Sat Feb 28 12:46:02 2015 -0600

    Reverted back to what was working.

commit da9de56a67efda08036e481fd5fccd5392ce6810
Author: MajorCooke <paul.growney22@gmail.com>
Date:   Thu Feb 26 18:53:20 2015 -0600

    Forgot this bit, for testing.

commit c5093d9bb97caf8478cefc32abc56a036feeea58
Author: MajorCooke <paul.growney22@gmail.com>
Date:   Thu Feb 26 18:52:46 2015 -0600

    Some more progress, but...
    - This did not solve anything. In fact, it did the opposite -- completely broke wave quakes. Now they only happen whenever a random quake is in progress.
    - Left in the commented code on purpose so Randi can test it.

commit 7e526405d2127cbb279f66008c8f8e55a5d497f3
Author: MajorCooke <paul.growney22@gmail.com>
Date:   Wed Feb 25 17:50:42 2015 -0600

    - Use newest waveform timer, not oldest.

commit 1356443609dbc6c7f46e081d0846816dc0836124
Author: MajorCooke <paul.growney22@gmail.com>
Date:   Wed Feb 25 17:32:09 2015 -0600

    - Got regular quakes to multiply onto sine quakes, but the vice versa needs fixing too.

commit d95796c94c70cd0229d4a6d30f69e3a7568b9588
Author: MajorCooke <paul.growney22@gmail.com>
Date:   Wed Feb 25 16:46:21 2015 -0600

    - Last hurdle. Now just need to figure out how to properly scale up and down.

commit 4bc3458e689155ce72c09776604d9eb4fa73d8be
Author: MajorCooke <paul.growney22@gmail.com>
Date:   Tue Feb 24 23:18:03 2015 -0600

    - Fixed the quakes being unstackable.

commit b51012d6d4ea065bf7f6fc9c1a0472966491f7af
Author: MajorCooke <paul.growney22@gmail.com>
Date:   Mon Feb 23 23:48:34 2015 -0600

    QF_WAVE renamed from SINE.
    - Lots of ground covered, but still more to go.
    - Still need to figure out how to make the camera properly shudder.

commit 427e4893193470bbf45415ffec70a0b69b8cccfd
Author: MajorCooke <paul.growney22@gmail.com>
Date:   Sun Feb 22 16:52:30 2015 -0600

    - Begin the groundworks for QF_SINE.
    - Need to figure out how to rework and manipulate the sine wave to move faster, and to allow going below 0 without breaking it too much.
2015-03-01 18:53:34 -06:00
bzip2 - Simplify CMake GCC and Clang checking. 2014-06-26 01:23:41 +02:00
docs - fixed: The player setup menu used the main menu's line spacing which 2010-01-03 10:04:56 +00:00
dumb - Various CMake fixes for two problems. 2014-12-10 21:11:26 +01:00
game-music-emu Fix compiling with provided VS 2005 projects 2014-07-21 22:31:05 -05:00
gdtoa - Miscellaneous CMakeLists.txt fixes. 2014-07-01 19:13:05 +02:00
jpeg-6b - Simplify CMake GCC and Clang checking. 2014-06-26 01:23:41 +02:00
launcher-templates - DYN_FLUIDSYNTH now defaults to ON. 2013-10-10 17:40:15 -07:00
lzma Fixed crash on opening 7z/LZMA archives, x64 only 2014-08-13 22:46:08 +03:00
output_sdl Fixed build of SDL output plug-in 2014-12-18 11:53:04 +02:00
specs - added udmf key midtex3dimpassible which causes the midtex to behave like a finite-height impassible line; practically this means the mid texture lets projectiles pass through it. 2014-09-28 17:17:19 +03:00
src Added QF_SINE 2015-03-01 18:53:34 -06:00
tools - Fixed: fixrtext isn't needed with Win64 builds. 2014-11-17 21:56:16 -05:00
wadsrc Added QF_SINE 2015-03-01 18:53:34 -06:00
zlib - Use release compiler flags for debug builds of third party libraries. 2013-10-12 00:24:04 -04:00
.gitignore Add more stuff to .gitignore 2014-01-21 19:48:46 -06:00
CleanDirectoryList.cmake - DYN_FLUIDSYNTH now defaults to ON. 2013-10-10 17:40:15 -07:00
CMakeLists.txt - Miscellaneous CMakeLists.txt fixes. 2014-07-01 19:13:05 +02:00
CreateLaunchers.cmake - DYN_FLUIDSYNTH now defaults to ON. 2013-10-10 17:40:15 -07:00
FindFluidSynth.cmake - Added FluidSynth support as snd_mididevice -5. Only tested with Linux. I will have 2010-08-15 19:54:59 +00:00
FindSDL2.cmake - Ported SDL backend to SDL 2.0. Still needs a little bit of polish, but it works. 2014-12-08 18:46:10 -05:00
strifehelp.acs - Fix strife linetype 11 again, courtesy of Gez. 2012-02-21 19:56:25 +00:00
zdoom.sln Used debug GME for debug ZDoom build with VC2005 solution 2014-07-28 21:04:30 -05:00
zdoom.vcproj new opl3 emulator 2014-11-23 00:36:22 +09:00

README: glDOOM

I never got around to do anything with respect to
a Linux glDOOM port except for assembling a Linux3Dfx
HOWTO (which, at that time, was a prerequisite
to get permission to publicly distribute the
already finished LinuxGlide port by Daryll Strauss).

Linux q2test (and soon LinuxQuake2) demonstrate that
Mesa with the MesaVoodoo driver is quite up to the
requirements for a glDOOM port. If anybody wants to
get into Linux glDOOM, please drop me a line.

There is a Win32 GLDOOM port in the works, by Jim Dose.
Quoting a recent posting by him:

"I haven't had as much time lately to really work on
the conversion. I currently have the renderer drawing
the walls and floors as texture spans as the are in
the software renderer. There's lighting on the walls,
but not the floors, and sprites are being drawn, but
not with the right texture. I figure that this is one
nights work to get the game looking "normal". I haven't
tested the game on less than a p200, so I'm not sure
how it will perform under the average machine, but I
don't expect it to be blindingly fast because of the
number of spans that have to be drawn each frame.
Rendering as polys is definitely the way to go.

The reason I chose to do spans first was because it
left the base renderer intact and I could concentrate
on ironing out any Windows compatibility problems.
Actually, the first version I had running was simply
a blit of the 320x200 game screen through Open GL.
Surprisingly, this actually was very playable, but
certainly wasn't taking any advantage of 3D acceleration.
Once the game was running, I started converting all
the span routines over."

Comment: for merging Linuxdoom with Win32, this is
probably the best source for getting the Win32
environment done - before more significant changes
occur.

"One problem with drawing spans is that the engine
doesn't calculate the texture coordinates with
fractional accuracy, so the bilinear filtering works
vertically, but not horizontally on the walls. I may
try to fix this, but since I plan to use polys for
the final version, it's not really high priority.
Also, spans don't really allow for looking up and
down."

Comment: true looking up/down vs. Heretic-style
y-shearing seems to require either a strange kind
of transofrmation matrix (he probably does not use
the OpenGL transformation at all), or rendering
all the spans as textured rectangular slices
instead of using glDrawBitmap. No, polys are the
way to go.
   
"When I tackle the conversion to polys, one big problem
I'll encounter is drawing floors. Since the world is
stored in a 2D bsp tree, there is no information on
the shape of the floors. In fact the floors can be
concave and may include holes (typically, most renderers
break concave polys down into a collection of convex
polys or triangles). In software, the floors are actually
drawn using an algorithm that's similar to a flood fill
(except that a list of open spans is kept instead of a
buffer of pixels).  This makes drawing the floors as
polys fairly difficult."

A polygon based approach will require significant changes
to the data structures used in the refresh module. I
recommend either separating a libref_soft.so first (a
Quake2 like approach), and creating libref_gl afterwards,
or abandoning the software rendering entirely.

John Carmack wrote once upon a time:
"... the U64 DOOM engine is much more what I would consider
The Right Thing now -- it turns the subsector boundaries
into polygons for the floors and ceilings ahead of time,
then for rendering it walks the BSP front to back, doing
visibility determination of subsectors by the one dimensional
occlusion buffer and clipping sprites into subsectors, then
it goes backwards through the visible subsectors, drawing
floors, ceilings, walls, then sorted internal sprite fragments.
It's a ton simpler and a ton faster, although it does suffer
some overdraw when a high subsector overlooks a low one (but
that is more than made up for by the simplicity of everything
else)."

Well, IMO compiling a separate list of floor/ceiling polygons
after having read the WAD file, and thus introducing this as
a completely separate data structure to the current code base
might be the easiest thing to do. Jim Dose writes:

"One method I may use to draw the floors as polys was suggested
by Billy Zelsnack of Rebel Boat Rocker when we were working
at 3D Realms together a few years ago. Basically, Billy was
designing an engine that dealt with the world in a 2D portal
format similar to the one that Build used, except that it had
true looking up and down (no shearing). Since floors were
basically implicit and could be concave, Billy drew them as
if the walls extended downwards to infinity, but fixed the
texture coordinates to appear that they were on the plane of
the floor. The effect was that you could look up and down and
there were no gaps or overdraw. It's a fairly clever method
and allows you to store the world in a simpler data format.
Had perspective texture mapping been fast enough back then,
both Build and Doom could have done this in software."

Perhaps the above is sufficient to get you started.
Other Issues:

1. Occlusion
DOOM uses a per-column lookup (top/bottom index) to do HLHSR.
This works fine with span based rendering (well, getting
horizontal spans of floors/ceilings into the picture is a
separate story). It isn't really mindboggling with polygon
based rendering. GLDOOM should abandon that.

2. Precalculated Visibility
DOOM has the data used by Quake's PVS - in REJECT.
During Quake development, lots of replacements for the
occlusion buffer were tried, and PVS turned out to be best.
I suggest usind the REJECT as PVS.

There have been special effects using a utility named RMB.
REJECT is a lump meant for enemy AI LoS calculation - a
nonstandard REJECT will not work as a PVS, and introduce
rendering errors. I suggest looking for a PVS lump in the
WAD, and using REJECT if none is found. That way, it might
be feasible to eat the cake and keep it.

3. Mipmaps
DOOM does not have mipmapping. As we have 8bit palettized
textures, OpenGL mipmapping might not give the desired
results. Plus, composing textures from patches at runtime
would require runtime mipmapping. Precalculated mipmaps
in the WAD?

4. Sprites
Partly transparent textures and sprites impose another
problem related to mipmapping. Without alpha channel,
this could give strange results. Precalculated, valid
sprite mipmaps (w/o alpha)?