Commit graph

75 commits

Author SHA1 Message Date
Christoph Oelckers
fc57180d7e - added necessary state to implement 3D light splitting using hardware clipping planes. 2016-01-30 23:01:11 +01:00
Christoph Oelckers
d037493ffe - fixed handling of FF_FADEWALLS on 3D floors. The problems with the old method became quite obvious in the demo map after the light list bug got fixed. 2016-01-29 17:13:14 +01:00
Christoph Oelckers
926e9fdac4 - fixed: For 2D-drawing of camera textures the render style was not set. 2016-01-07 22:20:57 +01:00
Christoph Oelckers
f2c890272f - FRenderState::Apply does not need to call ApplyColorMask. 2016-01-01 10:59:34 +01:00
Christopher Bruns
ac6e2f4979 Use gl_RenderState to manipulate OpenGL color mask for anaglyph modes, to avoid glGet... 2015-12-31 11:57:21 -05:00
Christopher Bruns
bcac352265 Merge branch 'master' of https://github.com/coelckers/gzdoom into stereo3d 2015-11-09 19:40:53 -05:00
Christoph Oelckers
ad6ce5a726 - added a NULL check to gl_enhanced_nightvision's handler so that it won't crash without an uninitialized GL renderer. 2015-11-09 13:49:17 +01:00
Christopher Bruns
789dca2ab3 Refactor stereo 3d projection matrix calculations to use VSMatrix. 2015-10-31 07:46:36 -04:00
Christopher Bruns
0874455faf Initial implementation of five 3D modes -- some bugs remain. 2015-10-30 20:51:35 -04:00
Christoph Oelckers
baa775b31c - fixed: Light level must be clamped before accessing the distfogtable. 2015-04-24 16:55:31 +02:00
Christoph Oelckers
052dda0fdd - made MD3 models reloadable. 2015-04-12 19:42:03 +02:00
Christoph Oelckers
45526c2769 - basics for using hardware clip planes to split translucent stuff by 3D floor planes. 2015-04-05 18:55:21 +02:00
Christoph Oelckers
45cf65afbd - moved the aspect ratio correction factor from the projection to the view matrix where it should have been from the start.
- removed the mCameraPos variable in FGLRenderer because it was only used in one place where it is just as easy to use the global viewx/y/z variables directly.
2014-12-29 22:42:19 +01:00
Christoph Oelckers
ec627d94dd - fixed: The depth clamp setting needs to be tracked per portal so that it can be properly restored afterward.
Regular skies need it off but SkyViewpoints need it on - and all others need to use the parent's setting.
So without engine side tracking we can end up rendering the sky with this setting off, resulting in omission of the fog layer.
2014-11-27 12:26:52 +01:00
Christoph Oelckers
e5cd90f323 - use separate vertex buffers per model to avoid large memory usage peaks. Also delete the geometry data for the models once it has been copied into the vertex buffer. 2014-10-24 11:43:25 +02:00
Christoph Oelckers
5302a10a7d - diable software lighting for textured automap.
* since it is designed for software-style light diminishing it doesn't work for 2D.
* additionally it left the lighting state in an unsuitable setting for further 2D rendering.
2014-10-23 09:19:30 +02:00
Christoph Oelckers
fd3128a164 - fixed: When changing enhanced nightvision mode the shaders need to have their fixed colormap state reset to ensure that the new settings get used.
- fixed: The shader code for handling special fixed colormaps did not use the color vertex attribute which was most evident with the 'shadow' render style on the spectre.
2014-10-05 09:40:36 +02:00
Christoph Oelckers
4682736585 - fixed: non-tiled mid textures on a fog boundary require some special clamping to be performed in the shader. 2014-09-21 11:08:17 +02:00
Christoph Oelckers
acf6c259d8 - changed the handling of alpha textures. The only special case they need is with palette-less textures and this can be handled far more easily and robustly with a predefined translation instead of passing another parameter through all the layers of the texture management code. This also fixes problems with paletted PNGs that get used as an alpha texture because the old method clobbered the image's palette. 2014-09-09 13:21:36 +02:00
Christoph Oelckers
4bb320a27c - route texture binding through the renderstate class for better control. Currently it's just a direct passthrough but this will change. 2014-09-09 12:00:42 +02:00
Christoph Oelckers
904cc2e158 - some code cleanup. 2014-08-23 18:54:24 +02:00
Christoph Oelckers
1050013017 major cleanup of the texture manager:
- use sampler objects to avoid creating up to 4 different system textures for one game texture just because of different clamping settings.
- avoids flushing all textures for change of texture filter mode.
- separate sprite and regular dimensions on the material level to have better control over which one gets used. It's now an explicit parameter of ValidateTexture. The main reason for this change is better handling of wall sprites which may not be subjected to such handling.
- create mipmaps based on use case, not texture type.
- allows removal of FCloneTexture hack for proper sharing of the same sprite for decals and other purposes.
- better precaching of skyboxes.
2014-08-22 23:50:38 +02:00
Christoph Oelckers
00d7707aef - allow reallocation of light buffer if more lights are needed.
- added a light preprocessing pass to the renderer so that a non-persistent buffer can be used with minimal mapping/unmapping. This only gets used if necessary because it adds some overhead to the renderer.
2014-08-19 14:18:21 +02:00
Christoph Oelckers
a63871d170 - at least for Intel GMA we need shaders without 'discard' to render non-transparent stuff. The performance penalty is rather hefty here. 2014-08-02 21:06:34 +02:00
Christoph Oelckers
7967082e60 - use the light buffer to handle dynamic lighting. 2014-08-01 20:59:39 +02:00
Christoph Oelckers
ef8f66c9a1 - removed the code for hardware alpha testing again because it didn't work anymore with how things are set up now.
- we need to check all GL versions when trying to get a context because some drivers only give us the version we request, leaving out newer features that are not exposed via extension.
- added some status info about uniform blocks.
2014-07-30 23:13:16 +02:00
Christoph Oelckers
c1d8f235c2 - renamed some stuff that clashed with gl function names. 2014-07-27 12:33:54 +02:00
Christoph Oelckers
bdf5bbd34e - make the shader timer part of the render state. 2014-07-26 20:56:10 +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
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
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
1f2f7616e1 - remove timing of matrix application method 2014-07-14 00:31:10 +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
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
92185f96eb - fixed overflow with storing a sprite's dynamic light color in a PalEntry. 2014-07-01 09:52:41 +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
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
ffcb6cb70a - added second vertex coordinate attribute for model interpolation. 2014-06-29 11:00:21 +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
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
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
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
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
9c659b948c - reactivated texture warping. 2014-05-12 15:13:07 +02:00