Commit graph

279 commits

Author SHA1 Message Date
Christoph Oelckers
37ea94abf3 - fixed: translucent walls did not set up their dynamic lights in the GL4 render path. 2015-12-11 22:26:10 +01:00
Christoph Oelckers
f9cbaef1df - fixed: Boom's Transfer_Heights did not work for upper parts in sectors with a sky ceiling.
This incorrect check has been in the code for 12 years, unfortunately I have no idea anymore why it was added.
2015-11-30 00:11:30 +01:00
Christoph Oelckers
b00b49c111 - fixed skybox picking in GL renderer. 2015-11-25 11:57:53 +01: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
Christoph Oelckers
16cb4407a4 - disabled 'isVisibleToPlayerClass' check for dynamic lights affecting sprites.
Calling this function in the inner loop of a time critical rendering function apparently wreaks havoc with the CPU instruction cache - even though the function doesn't do anything substantial.
This needs some more in-depth investigation why just having that call can increase sprite rendering time by a factor of 10 and more if there's many lights in view.
2015-11-03 23:55:16 +01:00
Christoph Oelckers
abf11f1a12 - print an error message if GL_ARB_sampler_objects cannot be found.
GZDoom requires this extension and all supported hardware has drivers implementing it but there still seem to be people out there who stuck to some older, obsolete drivers that don't.
2015-07-13 09:49:02 +02:00
Christoph Oelckers
065b7f9ad2 - fixed: The CollectSectorStack functions had a local sector_t variable used by gl_FakeFlat which caused a stack overflow. Using the global one defined at the top of the file is ok here. 2015-05-29 12:03:50 +02:00
Christoph Oelckers
a59824cd88 - fixed: MD2 vertex indices were signed shorts but should be unsigned.
- fixed a few warnings from Visual C++ 2015.
2015-05-07 11:36:31 +02:00
Christoph Oelckers
f273b6c46d - fix uninitialized variable. 2015-04-27 21:25:16 +02:00
Christoph Oelckers
baa775b31c - fixed: Light level must be clamped before accessing the distfogtable. 2015-04-24 16:55:31 +02:00
Christoph Oelckers
df6ffe6418 - adjustments for recent ZDoom changes. 2015-04-16 22:50:26 +02:00
Christoph Oelckers
052dda0fdd - made MD3 models reloadable. 2015-04-12 19:42:03 +02:00
Christoph Oelckers
feeebf5265 - rework MD2 code for reloading/precaching of geometry data. 2015-04-12 18:26:52 +02:00
Christoph Oelckers
cf7cb4f00f - use hardware clip planes to split translucent walls and sprites by 3D floor planes.
This method has the advantage that it also works for models, xy-billboarded sprites and walls that require complex splitting of the polygon. The old method using actual polygon splitting only works for strictly vertical data that could be trivially split in two.
2015-04-05 19:00:35 +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
bead3e046b - fixed weapon positioning again, after finding out that the first fix just worked around the actual problem: The entire coordinate calculation must be done in floating point with no integer math at all. Due to roundoff errors the stored int values needed for wall and flat placement significantly lack precision and with the high scaling factor that needs to be used for weapon HUD sprites these can easily become several pixels. After fixing this the border around sprite textures could be reverted to one pixel again.
- fixed: The 'may not be expanded' state should be stored in the texture and reused later. This also needs to revalidate the material if it decides that expansion should be disallowed.
2015-04-04 17:50:22 +02:00
Christoph Oelckers
91eafed5d3 - fixed coordinate calculations for trimmed sprites which were quite a bit broken. 2015-04-04 13:37:55 +02:00
Christoph Oelckers
67334bfa2b - calculate weapon positions fully in floating point to avoid roundoff errors.
- In order to get reliable results the empty border around scaled sprites must be the same scale as the sprite (i.e. 2 pixels for 2x scale and 4 pixels for 4x scale.)
2015-04-04 12:35:10 +02:00
Christoph Oelckers
48e21f6759 - consider MBF sky transfers when checking for skybox precaching. 2015-04-01 12:08:42 +02:00
Christoph Oelckers
1e9a6e667e - GL code adjustments for reworked precaching. 2015-04-01 11:59:41 +02:00
Christoph Oelckers
7701d54b1f - fixed: associated dynamic lights took the sprite/frame info from the actor's current state instead of from the actor's current sprite and frame, which may differ in case some placeholder sprite is used in the state. 2015-03-15 12:24:28 +01:00
Christoph Oelckers
fad3a54100 - fixed positioning for sky textures that are less than 128 pixels tall. 2015-03-15 12:10:22 +01:00
Christoph Oelckers
a5a53c51e6 - fixed: The flat drawing code assumed that the first element of the light list originated from the sector itself. This had been true formerly but in some situations it no longer is. 2015-02-10 21:52:19 +01:00
Christoph Oelckers
00639121c0 - added the missed parts of camera roll in gl_scene.cpp. 2015-02-10 20:34:10 +01:00
Christoph Oelckers
8a9692c29f - fixed: The code which decided whether to clamp two sided middle textures used the texture size instead of the render size for the specific linedef, meaning that any per-sidedef scaling was ignored. 2015-02-10 20:16:25 +01:00
Christoph Oelckers
a578ff5d06 - fixed a problem with some older AMD drivers: Normally calling glBindBufferBase should imply a call to glBindBuffer, but on these drivers it was never done, which resulted in the light uniform buffer never being created... 2015-01-24 13:13:54 +01:00
Christoph Oelckers
d4d041d5fc - fixed: FMaterial::ValidateTexture must determine whether to expand sprites before actually constructing the FMaterial object. 2015-01-08 18:44:55 +01:00
Christoph Oelckers
a8398e70b0 - fixed: The brightfog flag in the GL related map settings was never initialized.
- fixed: brightfog should not disable colored lighting for the weapon sprite.
2014-12-31 23:01:06 +01:00
Christoph Oelckers
4f08b20df5 - consider pixel stretching when rendering models. For non-voxels an aspect ratio of 1:1 must always be assumed while voxels need to be stretched so that 1 voxel unit == 1 map unit. 2014-12-31 12:53:29 +01:00
Christoph Oelckers
e6d59ec429 - fixed: with aspect ratio compensation in the view matrix it is necessary to adjust the view pitch for this because the playsim does not know anything about pixel ratio. 2014-12-31 12:04:55 +01:00
Christoph Oelckers
315827015c - made aspect ratio correction factor configurable through MAPINFO. 2014-12-29 23:52:20 +01: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
045725de15 - use strncpy instead of sprintf tp init static char array to ensure that all elements get initialized. 2014-12-29 16:35:30 +01:00
Christoph Oelckers
fbfe0f1e7a - fixed: y-clamped textures with negative scale need to shift their texture coordinates into the proper [0..1] range. 2014-12-26 11:53:38 +01:00
Christoph Oelckers
c66a211200 - fixed: The sky renderer must not only alter the light mode but also reset the software light level to a 'disabled' value. 2014-12-25 22:45:40 +01:00
Christoph Oelckers
ffa069205f - fixed: For fullbright sprites, a weapon's extra light must be ignored because it can be negative. 2014-12-25 18:30:34 +01:00
Christoph Oelckers
0bc2c0094a - fixed: For cubemapped skies with one texture for all 4 sides the texture was never set before rendering. 2014-12-19 16:35:34 +01:00
Christoph Oelckers
717c82ee4a - On Intel, we have to disable shader storage buffers because their complier contains a bug disallowing unsized arrays. 2014-12-01 09:58:23 +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
eb753a0b7c - fixed: We also should use the proper 'copied' info for the non-inverted planes. 2014-11-27 10:49:03 +01:00
Christoph Oelckers
99d81621f9 - fixed: The 'copied' information of a 3D floor plane should only apply to that particular plane, but never the opposite one of the same 3D floor. 2014-11-27 10:46:28 +01:00
alexey.lysiuk
60d78bcdf6 - implemented hqNx image scaling algorithms using MMX and SSE2 intrinsics 2014-11-27 10:58:34 +02:00
Christoph Oelckers
a7f4185981 - now that we don't have to care anymore about SVN-related merging problems, let's save the 3 global variables of the GL renderer unconditionally, even if the software renderer is running. 2014-11-16 09:08:47 +01:00
Christoph Oelckers
b0a6c94fa4 - fixed: the translucency flag for the flags renderer was inconsistent between the light pass and the render pass on GL 3.x hardware, resulting in bad buffer indices being sent to the shader. 2014-11-09 12:10:33 +01:00
Christoph Oelckers
3e50db9bf0 - fixed: When setting the object color for a shaded decal, the alpha channel must be forced to be 255. The decal's AlphaColor contains the palette index in those bits. 2014-10-26 15:11:04 +01:00
Christoph Oelckers
3c7664a460 - we don't really need a bBrightmap in a texture. All it did was duplicate some functionality of bMasked.
- renamed bBrightmapDisablesFullbright flag.
2014-10-26 08:41:52 +01:00
Christoph Oelckers
5a91fd0ad4 - fixed: DMD models didn't load their triangle data.
- fixed: MD2 models didn't handle the triangles' byte order.
2014-10-24 13:03:26 +02:00
Christoph Oelckers
f8016bef86 - fixed: voxels didn't set their index count. 2014-10-24 11:52:45 +02: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
bca47bb9bc - removed debug code.
- fixed: planes that are created by splitting translucent 3D-floors may never be rendered.
2014-10-23 17:35:58 +02:00