Commit graph

147 commits

Author SHA1 Message Date
Christoph Oelckers
bdf5bbd34e - make the shader timer part of the render state. 2014-07-26 20:56:10 +02:00
Christoph Oelckers
637aa9d77e - some adjustments to allow testing the different rendering methods. 2014-07-26 18:43:54 +02:00
Christoph Oelckers
6c9a818220 - allow different render modes if persistent buffers are not available (untested!) 2014-07-26 10:23:07 +02:00
Christoph Oelckers
e0b756e511 - fixed: The cubemapped skybox renderer did not set up the model matrix properly. 2014-07-17 10:04:20 +02:00
Christoph Oelckers
eb9d2d9917 - reactivate compatibility profile so that immediate mode drawing can be used on older hardware not supporting persistently mapped buffers.
- reactivate alpha testing per fixed function pipeline
- use the 'modern' way to define clip planes (GL_CLIP_DISTANCE). This is far more portable than the old glClipPlane method and a lot more robust than checking this in the fragment shader.
2014-07-17 02:37:18 +02:00
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