Christoph Oelckers
6b9d6787d9
- move models into their own draw list to avoid frequent buffer changes.
...
- same for SKYHACK walls. Although rare, they would get in the way of optimizing the draw calls if not being separated out.
2014-07-15 21:16:59 +02:00
Christoph Oelckers
b8bcbe819b
- removed texture based dynamic lighting. For GL 3.x the shader approach is always better.
...
- fixed: sky fog was not unset.
2014-07-15 20:49:21 +02:00
Christoph Oelckers
fb6b4238ed
- fixed: glProgramUniform is only present from GL 4.1 or a specific extension so it may not be used on systems not supporting it.
2014-07-15 02:48:59 +02:00
Christoph Oelckers
fc0cf4f998
- GZDoom now runs on an OpenGL core profile. :)
...
It's probably still necessary to replace GLEW with another loader library. GLEW is pretty much broken on core OpenGL without some hacky workarounds...
2014-07-15 02:26:23 +02:00
Christoph Oelckers
6046b11b4f
- all shaders now compile in core profile.
2014-07-15 01:05:53 +02:00
Christoph Oelckers
eedc5a69be
- replaced builtin position vertex attribute.
2014-07-15 01:02:48 +02:00
Christoph Oelckers
1b7f5a2e6a
- replaced builtin texture coordinate vertex attribute.
2014-07-15 00:59:01 +02:00
Christoph Oelckers
5a322742c3
- remove use of builtin and deprecated color vertex attribute.
2014-07-15 00:37:13 +02:00
Christoph Oelckers
ed8a21fd86
- replaced deprecated alpha testing with shader code.
2014-07-14 21:14:43 +02:00
Christoph Oelckers
84a49e37ee
- handle normals for spheremapped mirror surfaces using non-deprecated features.
...
- move all WGL references out of global header files so that global wgl header include is no longer necessary
2014-07-14 19:54:07 +02:00
Christoph Oelckers
ed5ee4e8d1
- removed some obsolete init stuff and some deprecated constants.
2014-07-14 18:48:46 +02:00
Christoph Oelckers
1f2f7616e1
- remove timing of matrix application method
2014-07-14 00:31:10 +02:00
Christoph Oelckers
150135a07d
- reinstate drawcall timing.
2014-07-13 23:14:28 +02:00
Christoph Oelckers
ce3653f6e1
- remove all uses of builtin matrices.
2014-07-13 23:13:40 +02:00
Christoph Oelckers
2214c0ac06
- remove all uses of builtin matrix manipulation. Only glLoadMatrix for view and projection matrix are left.
2014-07-13 22:37:34 +02:00
Christoph Oelckers
dbb05c5f33
- remove use of builtin texture matrices.
...
- make matrix class single precision.
2014-07-13 20:41:20 +02:00
Christoph Oelckers
9230a20f18
- added some checks to the wall rendering code that will allow to disable the clip planes in many cases, even when a plane mirror portal is active. This also solves the precision issue with using world coordinates for clip checks.
2014-07-13 17:15:17 +02:00
Christoph Oelckers
00fcf4bc06
- for some reason using world coordinates for clipping in the shader is somewhat imprecise so the clip plane heights have to be adjusted a bit for it.
2014-07-13 13:25:42 +02:00
Christoph Oelckers
d868f60f6c
- since the clip planes for plane mirrors did not work anymore I reimplemented them using shader based logic. It still needs to be seen if this affects performance on older hardware.
2014-07-13 12:14:12 +02:00
Christoph Oelckers
7cbffc7c14
- test code removal.
2014-07-10 10:35:02 +02:00
Christoph Oelckers
a936629cec
- use default fragment shader for burn and stencil shader, with the time consuming parts disabled by a #define, to avoid code duplication.
2014-07-10 10:33:07 +02:00
Christoph Oelckers
92185f96eb
- fixed overflow with storing a sprite's dynamic light color in a PalEntry.
2014-07-01 09:52:41 +02:00
Christoph Oelckers
9a6bc64381
- use vertex array objects to manage vertex buffers.
2014-07-01 00:51:02 +02:00
Christoph Oelckers
5ee626459d
- use model vertex buffer to render voxels.
2014-06-30 18:57:24 +02:00
Christoph Oelckers
f710518903
- use a uniform array to store vertex data to render dynamic stuff on GL 3.x hardware without the ARB_buffer_storage extension.
...
Due to the way the engine works it needs to render a lot of small primitives with frequent state changes.
But due to the performance of buffer uploads it is impossible to upload each primitive's vertices to a buffer separately because buffer uploads nearly always stall the GPU.
On the other hand, in order to reduce the amount of buffer uploads all the necessary state changes would have to be saved in an array until they can finally be used. This method also imposed an unacceptable overhead.
Fortunately, uploading uniform arrays is very fast and doesn't cause GPU stalls, so now the engine puts the vertex data per primitive into a uniform array and uses a static vertex buffer to index the array in the vertex shader.
This method offers the same performance as immediate mode but only uses core profile features.
2014-06-30 18:10:55 +02:00
Christoph Oelckers
6efefd9b7f
- use vertex buffer to render MD3 models.
2014-06-30 18:02:52 +02:00
Christoph Oelckers
54297acde4
- removed obsolete gl_lightbuffer code.
...
This never worked properly and by now far better options are available to solve the problem of dynamic light data uploads.
2014-06-30 13:30:10 +02:00
Christoph Oelckers
9c5cec0056
- draw wipes with buffers
...
Only two things left that still use immediate mode directly: MD3 models and voxels.
2014-06-30 10:05:15 +02:00
Christoph Oelckers
1efc2938b7
- implement model vertex buffer and draw MD2 models using it instead of using the GLCommands from the model.
2014-06-29 23:24:16 +02:00
Christoph Oelckers
9d1dbf4eab
- fixed: FBufferedUniform1f didn'T work because it used an int as its buffered value.
2014-06-29 14:08:44 +02:00
Christoph Oelckers
ffcb6cb70a
- added second vertex coordinate attribute for model interpolation.
2014-06-29 11:00:21 +02:00
Christoph Oelckers
e2e71e072e
removed error suppression code from shader compilation.
...
With GL 2.x support the engine still had something to fall back on, with that removed it needs to abort.
2014-06-23 09:26:29 +02:00
Christoph Oelckers
1f0c69a0e9
- some cleanup after GL 2.x code removal
...
- reinstated burn warp with shader based code.
2014-06-21 16:41:45 +02:00
Christoph Oelckers
2925c96b59
removed all GL 2.x code.
...
After thinking about it for a day or so I believe it's the best option to remove all compatibility code because it's a major obstacle for a transition to a core profile.
2014-06-21 15:50:32 +02:00
Christoph Oelckers
d5dceb6874
- changed alpha texture handling to avoid using the deprecated GL_ALPHA8 texture format unless we have a compatibility context of an older GL version.
2014-06-21 12:52:19 +02:00
Christoph Oelckers
ca76c2525e
- more vertex buffer stuff for models, still not tested.
2014-06-19 22:24:33 +02:00
Christoph Oelckers
5944894138
- create vertex buffer data for MD2/DMD models.
2014-06-19 17:06:26 +02:00
Christoph Oelckers
3e9b9c280b
- initialize model data at engine start, not at level start.
2014-06-19 15:22:00 +02:00
Christoph Oelckers
412d6499d9
- removed the voxel vertex buffer because it needs to be gone before implementing a model vertex buffer.
2014-06-19 14:46:55 +02:00
Christoph Oelckers
03916d75de
- cleaned up MD3 rendering and merged RenderFrame and RenderFrameInterpolated into one function.
2014-06-19 13:58:49 +02:00
Christoph Oelckers
59522f7065
- simplified MD2 drawing code as preparation for a buffer based implementation.
2014-06-19 13:37:30 +02:00
Christoph Oelckers
965a2a2d79
definition for model vertex buffer.
2014-06-15 21:56:37 +02:00
Christoph Oelckers
e6f14b055a
- use buffer based rendering for dynamic light pass and horizon portals.
2014-06-15 20:28:23 +02:00
Christoph Oelckers
1aaa1b7bad
- removed gl_usevbo CVAR because with recent code changes it has become useless. If GL_ARB_buffer_storage is present, buffers will always be used.
2014-06-15 12:12:24 +02:00
Christoph Oelckers
ea332383a8
- convert skybox rendering to use the buffer interface.
2014-06-15 11:50:54 +02:00
Christoph Oelckers
6b038a5dae
- fixed: GLPortal::DrawPortalStencil must apply the render state before drawing anything.
2014-06-15 10:30:03 +02:00
Christoph Oelckers
2abf1644a4
- fixed: Plane height changes only updated the first buffered vertex for the respective plane.
2014-06-15 10:18:46 +02:00
Christoph Oelckers
1b91a8f88c
- removed old immediate mode path for generating stencils.
2014-06-15 10:15:44 +02:00
Christoph Oelckers
3644073bbd
- use a software buffer for immediate mode rendering. This allows using the regular buffer code to collect data for both render modes and allows removal of a lot of duplicated code.
2014-06-15 01:14:41 +02:00
Christoph Oelckers
5b302ed3a6
- added benchmarking calls for glDrawArrays to see how well issunig draw calls performs on different hardware.
2014-06-14 15:16:33 +02:00
Christoph Oelckers
0ce6b40672
- fixed compile error in gl_skydome.cpp
...
- disable GL_ARB_buffer_storage when a -glversion parameter less than 4.0 is given. According to the spec this extension requires 4.0 so if emulating something lower it should not be used.
2014-06-14 14:58:17 +02:00
Christoph Oelckers
5e22c82e79
- use buffer for rendering the sky on all GL versions since the differences for making GL2.0 work are rather small.
2014-06-14 10:38:30 +02:00
Christoph Oelckers
8d9a90cd22
- rewrote sky dome rendering to use a static vertex buffer if not on OpenGL 2.x.
2014-06-14 01:24:28 +02:00
Christoph Oelckers
2ad47935ef
Merge branch 'master' into Glew_Version_For_Real
2014-06-01 12:43:17 +02:00
alexey.lysiuk
a26fbc74f0
Fix compilation errors in latest texture-related changes
...
GCC and Clang complain about non-POD type passed to variadic function.
2014-06-01 10:27:16 +03:00
Christoph Oelckers
d925279bef
- fixed texture name handling in GL related texture classes for recent changes in ZDoom to eliminate the 8 character name limit.
2014-06-01 00:04:28 +02:00
Christoph Oelckers
c39318f406
- use vertex buffer and reuse of data for stencil drawing. A stencil needs to be drawn multiple times with the same polygons so this is a good place to optimize.
2014-05-31 09:32:17 +02:00
Christoph Oelckers
a1ec6ab1ba
- fixed some Linux warnings.
2014-05-24 16:53:57 +02:00
Christoph Oelckers
e813ddf251
- fixed bad comparison.
2014-05-24 16:47:34 +02:00
Christoph Oelckers
54425ee2ef
- fixed: Desaturation factor was applied incorrectly.
...
- Also fixed some very strange thing in the shader's desaturate function. For unknown reasons using the 'mix' function there did not work.
- fixed: The fog boundary special shader could not be used.
2014-05-21 13:40:46 +02:00
Christoph Oelckers
0cf37f2e51
- fixed problem with selecting special shaders.
2014-05-21 12:36:29 +02:00
Christoph Oelckers
f5ea31b518
- use vertex buffer for all the common 2D rendering functions.
2014-05-21 00:36:04 +02:00
Christoph Oelckers
09ba62fbef
- put all the common part of buffer based drawing into a separate method of the vertex buffer.
2014-05-20 22:37:38 +02:00
Christoph Oelckers
23fbd69963
- 4 more places where immediate mode drawing has been substituted with a buffer-based alternative.
2014-05-20 22:20:15 +02:00
Christoph Oelckers
6e6be8ed5b
Merge branch 'master' into Glew_Version_For_Real
2014-05-18 12:47:48 +02:00
Christoph Oelckers
03d4f23a6e
- made adjustments to the texture loading code to account for the recent changes to handle long texture names.
2014-05-15 19:27:22 +02:00
Christoph Oelckers
60f0ab5f1b
- fixed Linux warning with type cast.
2014-05-13 12:00:11 +02:00
Christoph Oelckers
579eff5b96
- add vertex buffer based rendering for decals.
2014-05-12 22:46:30 +02:00
Christoph Oelckers
cf45f2d718
- added missing shader files.
2014-05-12 22:24:26 +02:00
Christoph Oelckers
b514a815f4
- enable use of vertex buffer for sprite rendering.
2014-05-12 20:23:54 +02:00
Christoph Oelckers
9c659b948c
- reactivated texture warping.
2014-05-12 15:13:07 +02:00
Christoph Oelckers
55d4c89753
- fixed: fog density calculation for fixed function was not correct.
2014-05-12 14:58:37 +02:00
Christoph Oelckers
4d005bdfa0
shader rework
...
All those special shaders have been merged together.
Mostly working but the non-shader lighting seems a bit broken.
2014-05-12 14:45:41 +02:00
Christoph Oelckers
98cc7eeb99
pass softlightlevel through render state.
2014-05-12 00:13:19 +02:00
Christoph Oelckers
b9a6fe80a4
Do not use the shader to handle STYLEF_RedIsAlpha.
...
Turns out that the name doesn't accurately describe what it does.
It is correct for images that come with their own palette or are true color.
But for images using the game palette it doesn't use the red channel to determine translucency but the palette index! Ugh...
This means it cannot be done with a simple operation in the shader because it won't get a proper source image. The only solution is to create a separate texture.
2014-05-11 23:56:53 +02:00
Christoph Oelckers
506798f134
allow brightmaps and fullbright objects in fog. The reasons why they were disabled no longer exist.
2014-05-11 23:12:28 +02:00
Christoph Oelckers
c47c7421a3
- route all glColor calls through render state.
...
- add sector links to dynamic lights.
2014-05-11 22:57:42 +02:00
Christoph Oelckers
978ace241c
- removed all code that mixes together the different lighting methods. Now everything goes through the 3 different light parameters in the render state.
...
- removed cm parameter from many functions.
2014-05-11 21:47:54 +02:00
Christoph Oelckers
887d35d559
- remove colormap from texture generation parameters. The one remaining special case, alpha texture on old hardware is now handled by the currently set texture mode at the time of use.
...
- use the cleaned up decal lighting code from the first GLEW branch.
2014-05-11 19:44:19 +02:00
Christoph Oelckers
7793bbbcc9
Further cleanup of lighting code.
...
- remove thing color from lighting calculations.
- implement alpha textures and inverse sprites for infrared as texture modes. This still requires some handling for the alpha texture mode for non-shader rendering because there is no way in the fixed pipeline to do it. The inverted texture effect can be done with a texture combiner.
- fixed: ThingColor for sprites was set in the wrong place. It must be in the Process function, not in the lighting calculation.
- added functions for isolated calculation of sprites' dynlight color.
2014-05-11 17:56:38 +02:00
Christoph Oelckers
607be91c48
- bad copy.
2014-05-11 16:54:11 +02:00
Christoph Oelckers
8ae97bc3e1
-looks like we still need this...
2014-05-11 16:51:33 +02:00
Christoph Oelckers
52056a05bd
- changed handling of DynLight in shader to serve as a global dynamic light color for all lighting modes.
2014-05-11 16:49:17 +02:00
Christoph Oelckers
53f4cd0108
- added objectcolor uniform. This will be used to hold the thingcolor for shader based rendering.
2014-05-11 16:06:25 +02:00
Christoph Oelckers
f3a9cb0cfa
remove special texture creation for fullscreen colormaps.
...
On GL 3.x+ this isn't needed at all and on older hardware it causes performance issues, in particular with hires textures due to impossibility of precaching.
In addition it forces some really awkward handling of lighting for things that have their own color, like stenciled sprites or particles.
With this special case gone it will be possible to handle this case in a saner manner than it is right now.
As compensation for older hardware a fullscreen blend will be drawn over the entire screen. This won't be 100% accurate but it's preferable to keeping the current method.
2014-05-11 14:46:37 +02:00
Christoph Oelckers
5947584bff
Merge branch 'master' into Glew_Version_For_Real
2014-05-11 13:29:37 +02:00
Christoph Oelckers
cd6d653b59
- fixed: the delayed state changer for the alpha function called glBlendFunc instead of glAlphaFunc.
2014-05-11 13:29:06 +02:00
Christoph Oelckers
09f4071436
Ok, it had to be done: Removed shader support for pre GLSL 1.3/GL 3.0 hardware. The compromises needed to accomodate these are just too bad and would block any attempt at streamlining the code.
2014-05-11 13:27:51 +02:00
Christoph Oelckers
92b9814460
Merge branch 'master' into Glew_Version_For_Real
2014-05-11 09:17:46 +02:00
Christoph Oelckers
a42cde0837
- removed #include of glxew.h because it's not used.
...
- removed some unused functions from gl_interface.cpp which were causing problems when compiling on Linux.
2014-05-11 09:17:18 +02:00
Christoph Oelckers
f7404d20fb
- add vertex buffer based drawing for all walls and flats.
2014-05-11 01:23:27 +02:00
Christoph Oelckers
7d3beb665b
- rewrote vertex buffer code to require GL_ARB_BUFFER_STORAGE extension.
...
This means it won't work anymore on anything that doesn't support OpenGL 4.0, but I don't think this is a problem. On older NVidia cards performance gains could not be seen and on older AMDs using the vertex buffer was even worse as long as it got mixed with immediate mode rendering.
2014-05-10 21:47:07 +02:00
Christoph Oelckers
b09405a8bd
- changed rendering of glowing walls so that it doesn't require an additional vertex attribute, just pass the floor and ceiling planes as uniforms.
2014-05-10 17:09:43 +02:00
Christoph Oelckers
64d991b9b3
Merge branch 'master' into Glew_Version_For_Real
2014-05-10 15:29:06 +02:00
Christoph Oelckers
1d4ea9f162
- removed the __asm nop breakpoints for debugging. They not only do not work on non-MSVC but also not on 64 bit.
2014-05-08 09:48:39 +02:00
Christoph Oelckers
314225f1b0
- don't depend on stdint.h because older MSVC versions do not have it.
2014-05-01 12:30:56 +02:00
Christoph Oelckers
94b06900cb
- got rid of a lot of stuff that's no longer required with GLEW.
...
- replaced GLUs texture scaling with our own function. This is only used to scale down textures larger than what the hardware can handle so we do not need a dependency to an essentially deprecated library for it.
2014-04-15 11:59:41 +02:00
Christoph Oelckers
69af73d9b9
- alternative configuration using GLEW to get extension functions. This requires GL 2.0, though so it won't be promoted to the mainline for the time being.
...
- removed all pre GL 2.0 support.
2014-04-06 14:35:44 +02:00
Christoph Oelckers
47406a3406
- I don't think it's a good idea to put a 64 MB lookup table into the static data segment, if it's for a piece of code most people will never use...
2014-04-03 23:02:43 +02:00
Gaerzi
0aba6e09f3
Disambiguate which abs type we want.
2014-04-03 20:14:38 +02:00