Commit graph

1172 commits

Author SHA1 Message Date
Christoph Oelckers
5141fee8c0 - reverted the change of position where polyobjects get linked to the subsectors. 2017-03-13 21:17:25 +01:00
Christoph Oelckers
feb680a4eb - Removed the RSQRTSS code from GLSeg::Normal.
If we have to write compiler specific code for micro-optimizations I am out.
The Posix compatible version nullified most the advantage on MSVC by writing out the XMM register to memory and then reading back the float.
That's not worth the hassle for an optimization that brings a few microseconds at best.
2017-03-13 13:17:15 +01:00
alexey.lysiuk
fc8b697e33 Fixed compilation of POSIX targets
TODO: Need better way to detect SSE support
2017-03-13 12:51:06 +02:00
Christoph Oelckers
60fd79ce23 - some menu reorganization:
* dynamic lights also work in the true color software renderer and have been moved out of the OpenGL menu.
* created a separate software renderer menu and moved all relevant options there.
* delete non-applicable options when running in legacy mode.
* moved the OpenGL preferences menu one level up to eliminate a two-entry GL top level menu.
2017-03-13 01:17:46 +01:00
Christoph Oelckers
4965cdfd9a - removed some unused global variables. 2017-03-12 23:56:17 +01:00
Christoph Oelckers
d72623b9b5 - eliminated global in_area variable.
Removing this made me realize that calling the renderers' FakeFlat functions from the automap is inherently unsafe with the recent refactorings because there is absolutely no guarantee that the data may actually still be defined when the automap is being drawn.
So the best approach here is to give the automap its own FakeFlat function that runs independently of render data and assumptions of data preservation. This one can also be a lot simpler because it only needs the floor, not the ceiling info.
2017-03-12 23:13:07 +01:00
Christoph Oelckers
4c61048278 - moved gl_fixedcolormap into GLSceneDrawer.
This means that one of the most extensively used global variables is gone.
2017-03-12 21:57:39 +01:00
Christoph Oelckers
438b983ab1 - inlined the 4 remaining short functions of the Plane class and removed gl_geometric.cpp.
# Conflicts:
#	src/CMakeLists.txt

# Conflicts:
#	src/CMakeLists.txt
2017-03-12 20:11:57 +01:00
Christoph Oelckers
4cd0d3d454 - removed the Vector class in the GL renderer and replaced all its uses with FVector3.
- optimized the math to get a plane equation from a linedef. The original code used a generic algorithm that knew nothing about the fact that Doom walls are always perfectly vertical. With this knowledge the plane calculation can be reduced to a lot less code because retrieving the normal is trivial in this special case.
- use the SSE2 rsqrtss instruction to calculate a wall's length, because this is by far the most frequent use of square roots in the GL renderer. So far this is only active on x64, it may be activated on 32 bit later as well, but only after it has been decided if 32 bit builds should be x87 or SSE2.

# Conflicts:
#	src/gl/dynlights/gl_dynlight.cpp

# Conflicts:
#	src/g_shared/a_dynlightdata.cpp
2017-03-12 19:59:45 +01:00
Christoph Oelckers
ef3421eee5 - moved dynamic lights out of the GL code into the common game code.
Since the true color software renderer also handles them there is no point keeping them on the GL side.
This also optimized how they are stored, because we no longer need to be aware of a base engine which doesn't have them.
2017-03-12 19:57:06 +01:00
Christoph Oelckers
e7330cfa03 - all main functions in gl_scene.cpp now belong to the new GLSceneDrawer class. 2017-03-12 12:51:26 +01:00
Christoph Oelckers
e4d7d9de8b - moved several more functions from FGLRenderer to GLSceneDrawer. 2017-03-12 12:03:54 +01:00
Christoph Oelckers
64183fc3cd - moved GL texture precaching to gl_texture.cpp. 2017-03-12 01:49:44 +01:00
Christoph Oelckers
9b33d1dd18 Merge branch 'scene_multithreaded' of https://github.com/raa-eruanna/qzdoom into 3.0_work
# Conflicts:
#	src/gl/scene/gl_clipper.cpp
#	src/gl/scene/gl_portal.cpp
#	src/gl/scene/gl_scene.cpp
#	src/swrenderer/scene/r_scene.cpp
2017-03-12 00:38:55 +01:00
Magnus Norddahl
c79051126e Fix ssao being applied to skybox portals 2017-03-12 00:22:58 +01:00
Christoph Oelckers
0aa0db637c - started adding a SceneDrawer class to the OpenGL renderer.
This will eventually hold all the global variables for the rendering.
2017-03-12 00:19:20 +01:00
Magnus Norddahl
0c9014b984 - move r_utility globals into r_viewpoint and r_viewwindow
- change r_utility functions to only work on FRenderViewpoint and FViewWindow
2017-03-11 23:28:07 +01:00
Christoph Oelckers
8e2ebe15fe - removed several unused variables from OpenGLFrameBuffer.
- removed the LastCamera logic in RenderView. This code predates the first GZDoom release and apparently was only added because back then R_SetupFrame was not fully compatible with the hardware renderer. Today it is not needed anymore.
2017-03-11 21:10:21 +01:00
Christoph Oelckers
9e70771da3 - Added a check to allow shader storage buffers on GL 4.3 Intel drivers. It doesn't work if GLSL version is set to 4.0 and the feature activated via extension. 2017-03-11 20:14:18 +01:00
Christoph Oelckers
9eae422dab Merge branch 'shadowmaps' of https://github.com/raa-eruanna/qzdoom into 3.0_work
# Conflicts:
#	src/CMakeLists.txt
#	wadsrc/static/language.enu
2017-03-11 19:55:43 +01:00
Christoph Oelckers
28aba3469d - missed 2 includes 2017-03-11 19:18:31 +01:00
Christoph Oelckers
921abc404d - fixed GCC warnings and errors
(Is there anyway to tone down GCC's warning level? It outputs too many false positives for potentially uninitialized variables in which the genuine errors get drowned.)
2017-03-11 19:02:35 +01:00
Rachael Alexanderson
81291e6892 - fixed: Clang on Linux compile 2017-03-11 11:01:30 -05:00
Magnus Norddahl
b407ea2164 Change gl_light_shadowmap to default to being off 2017-03-10 22:12:13 +01:00
Magnus Norddahl
59ec97d2d5 Fix shadow map acne and the attenuate flag 2017-03-10 22:08:55 +01:00
Christoph Oelckers
fec958cc0a - finally managed to get rid of the DWORD type.
This one was particularly nasty because Windows also defines a DWORD, but in Windows it is an unsigned long, not an unsigned int so changing types caused type conflicts and not all could be removed.
Those referring to the Windows type have to be kept, fortunately they are mostly in the Win32 directory, with a handful of exceptions elsewhere.
2017-03-10 19:46:22 +01:00
Magnus Norddahl
b660493051 Add menu option for disabling shadow maps and detecting if storage buffers are available or not 2017-03-10 19:10:40 +01:00
Magnus Norddahl
1e7ea1c7ff Fix crash HOM effect when vid_hw2d is off 2017-03-10 12:25:05 -05:00
Christoph Oelckers
4ed5b91b0f - added a few missing includes which were not triggered as error in a debug build. 2017-03-10 09:57:10 +01:00
Christoph Oelckers
bd7476fb8d - untangled r_defs.h from actor.h
Both files can now be included independently without causing problems.
This also required moving some inline functions into separate files and splitting off the GC definitions from dobject.h to ensure that r_defs does not need to pull in any part of the object hierarchy.
2017-03-10 02:22:42 +01:00
Christoph Oelckers
4de0f8b1fa - compile both poly and sw renderer as one unit, because due to the includes this gets really slow otherwise. Lumping these together saves 50 seconds per build on my system with a 3.4 GHz Core i7 and an SSD for storage, so on other systems it may be even more. 2017-03-10 00:43:36 +01:00
Christoph Oelckers
a4710bcdb0 - did a bit of header cleanup to reduce the dependency on dobject.h. 2017-03-09 23:30:42 +01:00
Christoph Oelckers
9b87a167d7 - replaced a large batch of DWORDs.
Most of those which still rely on ZDoom's own definition should be gone, unfortunately the code in files that include Windows headers is a gigantic mess with DWORDs being longs there intead of ints, so this needs to be done with care. DWORD should only remain where the Windows type is actually wanted.
2017-03-09 20:19:55 +01:00
Christoph Oelckers
a17685f3fd - removed some long longs, to reduce that type's use to the necessary minimum
.
2017-03-09 20:05:22 +01:00
Christoph Oelckers
d2beacfc5f - except for DWORD, all homegrown integer types are gone - a handful were left where they represent genuine Windows types. 2017-03-09 19:54:41 +01:00
Christoph Oelckers
c008ddaf66 - replaced homegrown SWORD, SBYTE and uint32_t types. 2017-03-09 19:31:45 +01:00
Christoph Oelckers
cc1241a4b8 Merge branch 'make-qzdoom-gzdoom-again' of https://github.com/raa-eruanna/qzdoom into 3.0_work
# Conflicts:
#	src/win32/win32gliface.h
#	src/win32/win32iface.h

This compiles but no guarantees otherwise.
2017-03-09 19:09:13 +01:00
Christoph Oelckers
e080f0cf89 - removed Windows.h include from gl_system.h and cleaned up that file. This means that most OpenGL sources can now be compiled without any Windows dependencies, which is significantly faster. 2017-03-09 13:19:51 +01:00
Christoph Oelckers
05919a2926 - remove Windows includes from gl_load.h
This is one of two places that unconditionally pulled in all Windows headers into the GL code.
We also do not need the cruft for defining the standard integer types. GZDoom is C++11 which means that stdint.h will be present. So the madness with the definitions should be avoided to ensure that the types are always the same.
2017-03-09 13:03:49 +01:00
Christoph Oelckers
03e1cbcfc0 - removed Windows types from several files which don't need them.
- split out the software renderer's video classes into their own file because they got included by all OpenGL sources.
2017-03-09 12:52:31 +01:00
Rachael Alexanderson
cc9a2e5121 Merge https://github.com/coelckers/gzdoom 2017-03-08 21:25:24 -05:00
Christoph Oelckers
ba0f5a3f94 - most WORD and SWORD are gone. 2017-03-08 18:55:55 +01:00
Christoph Oelckers
8ab562ef13 - the fourth. 2017-03-08 18:55:54 +01:00
Magnus Norddahl
b281a697ce Document the algorithm used for generating the 1D shadow maps 2017-03-08 14:12:59 +01:00
Magnus Norddahl
d09c3ad305 Move all GPU handling to gl_shadowmap and rename gl_lightbsp to gl_aabbtree 2017-03-08 13:31:19 +01:00
Magnus Norddahl
8687a9868a Rename Level2DShape to LevelAABBTree and add a bit of documentation to it 2017-03-08 12:40:45 +01:00
Rachael Alexanderson
527a172fcd Merge https://github.com/coelckers/gzdoom 2017-03-07 22:03:56 -05:00
Magnus Norddahl
850e61d1c9 Add shadow test to sprites 2017-03-08 00:34:08 +01:00
Christoph Oelckers
7a0c466b24 - fixed: For reflective floors, closed doors need to be considered an outer boundary, even if the floor below the door is reflective itself. 2017-03-07 18:59:48 +01:00
Magnus Norddahl
6df3b3fbca Changed the light collision structure uploaded to the GPU to be a binary tree using AABBs for the nodes instead of a BSP plane 2017-03-07 15:58:22 +01:00