Christoph Oelckers
dda73b531c
Merge branch 'master' of https://github.com/rheit/zdoom
...
# Conflicts:
# src/CMakeLists.txt
# src/p_setup.cpp
# src/r_defs.h
# src/version.h
This only updates to a compileable state. The new portals are not yet functional in the hardware renderer because they require some refactoring in the data management first.
2016-02-05 12:31:41 +01:00
Christoph Oelckers
b2158c5b96
- removed unneeded parameter.
2016-02-05 01:48:53 +01:00
Christoph Oelckers
c129cb3ca4
- reinstated software clipping by light volumes for walls.
...
It turned out that using hardware clipping planes exclusively to handle this cost more than it gained.
Now only the expensive or formerly impossible cases of intersecting light volumes or light volumes intersecting with the top and bottom of the wall polygon will use hardware clipping. The trivial cases will go back to software splitting.
2016-02-04 15:34:12 +01:00
Christoph Oelckers
0c8a817df4
- fixed wall clipping with 3D lights.
2016-02-04 01:12:18 +01:00
Christoph Oelckers
db766f9fe5
- fixed some warnings.
2016-02-03 13:03:38 +01:00
Christoph Oelckers
9453a8a7e6
- reuse the same vertex buffer data for all slices of a decal.
2016-02-01 21:50:55 +01:00
Christoph Oelckers
f11f86f05d
- added light plane clipping for decals as well.
2016-02-01 21:45:26 +01:00
Christoph Oelckers
faa08410de
- handle nocoloredspritelighting with 3D light splitter
2016-02-01 19:10:15 +01:00
Christoph Oelckers
2c55dcca27
- use hardware clipping to apply 3D lights to sprites. This solves all the problems with properly lighting models and billboarded sprites.
...
- add some restrictions for the checks that exclude sprites which are too close to the camera. Most importantly, for clipping the first frame of a projectile, do not solely clip against the projectile's speed but use the player's radius as a limiting factor to avoid too large distances.
2016-02-01 18:14:00 +01:00
Christoph Oelckers
1ad310e69b
- only draw visible 3D-lights.
2016-02-01 16:13:07 +01:00
Christoph Oelckers
67fc35e738
- some cleanup of wall processing code.
...
* removed SplitWall function
* split PutWall into PutWall and PutPortal because none of the portal cases needs the overhead for normal walls.
2016-02-01 01:49:49 +01:00
Christoph Oelckers
9305cd86a0
- remove the GLWallLightEntry type. Everything it contains can be retrieved from the existing lightlist just as easily, and this approach avoids a lot of memory allocations.
...
- removed the SplitWall profiling timer because all it measures now is an almost empty function.
2016-02-01 01:03:34 +01:00
Christoph Oelckers
53a389aafc
- fixed: for untextured walls, the texture must be disabled before rendering.
...
- fixed: untextured walls should never be passed to SplitWall.
- fixed: untextured walls should not be affected by dynamic lights (it's either fog boundaries or outsides of 3D fog volumes.)
2016-01-31 22:24:48 +01:00
Christoph Oelckers
9ce6a7932c
- implemented rendering of 3D lights with clip planes.
2016-01-31 22:04:20 +01:00
Christoph Oelckers
5448b335c6
- rewrote render loop for walls. Not working yet.
2016-01-31 21:10:59 +01:00
Christoph Oelckers
f86535407d
- forgot this.
2016-01-31 00:52:50 +01:00
Christoph Oelckers
1d9ab5c632
- clean out GLWall::SplitWall and instead of actually splitting the wall just attach a list of lights to it.
...
Actual handling will be in the rendering function because this doesn't need multiple vertex transfers to the GPU. All slices can be drawn from the same buffer with different uniform info being set.
2016-01-31 00:45:29 +01:00
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
4a9b2bf76d
- fixed: The stencil cap drawer did not properly advance the vertex pointer.
2016-01-30 01:08: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
238990c871
don't leave any gaps in the used clip planes.
2016-01-27 12:32:39 +01:00
Christoph Oelckers
47db3252f4
- it's really not necessary to waste two clip planes for reflective surfaces because only one can be active at any time.
2016-01-27 12:30:55 +01:00
Christoph Oelckers
3c16a23865
- when rendering mirrors, discard subsectors lying behind them.
2016-01-27 12:02:43 +01:00
Christoph Oelckers
5816049510
- made necessary adjustments for the coordinate refactoring in ZDoom.
2016-01-21 12:36:37 +01:00
Christoph Oelckers
2657c08831
- fixed: stacked sector portals were not added to the render list
2016-01-13 21:33:27 +01:00
Christoph Oelckers
65022b780a
- implemented 'copy portal to wall' linedef type.
2016-01-11 22:44:53 +01:00
Christoph Oelckers
196c9bc34d
- cleaned up the skybox type detection logic.
2016-01-11 20:29:24 +01:00
Christoph Oelckers
ef7bcb3a66
- implement Eternity-Style flat and horizon portals. Not tested yet due to lack of material to work with.
2016-01-11 15:07:58 +01:00
Christoph Oelckers
7d2bbbd351
- fixed rendering of two-sided polyobjects that have their upper or lower textures exposed.
2016-01-05 18:59:32 +01:00
Christoph Oelckers
cc10fe9bc3
- fixed: The stereo3D code accessed the global 'viewsector' variable at a place where it no longer contained a correct value.
...
- fixed: The same code did not exclude camera texture views from drawing the 2D overlay.
2016-01-04 00:45:44 +01:00
Christopher Bruns
95f4134630
Refactor stereo3d classes to use TArray instead of std::vector.
2015-12-31 09:36:37 -05:00
Christopher Bruns
8e237e6146
Merge branch 'master' of https://github.com/coelckers/gzdoom into stereo3d
2015-12-30 17:41:49 -05:00
Christoph Oelckers
c8810db5fe
- fixed: clipping swimmable against non-swimmable translucent 3D-floors was broken due to an incorrect flag check.
2015-12-24 16:34:00 +01:00
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
Christopher Bruns
10088544c3
Merge branch 'master' of https://github.com/coelckers/gzdoom into stereo3d
...
Conflicts:
src/win32/i_system.cpp
2015-12-09 18:34:20 -05: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
Christopher Bruns
151b47c3ae
Merge branch 'master' of https://github.com/coelckers/gzdoom into merge_down
...
Conflicts:
src/win32/i_system.cpp
2015-11-03 20:21:27 -05: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
Christopher Bruns
789dca2ab3
Refactor stereo 3d projection matrix calculations to use VSMatrix.
2015-10-31 07:46:36 -04:00
Christopher Bruns
89328e685c
Use eye->TearDown method to restore glColorMask.
...
Restore assert in i_system.cpp that was interfering with my debugging.
Restore scoped colorMask-ing in gl_portal.cpp and gl_drawinfo.cpp.
2015-10-30 21:48:42 -04:00
Christopher Bruns
b82d611936
Call EndDrawScene for each eye.
...
Actually use stereoscopic projection matrix.
2015-10-30 21:29: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
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
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
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
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
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
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
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
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
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
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
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
Christoph Oelckers
066e53ae4c
- fixed: sprites rendered as 'bright' should not be affected by dynamic lights.
2014-10-23 10:54:26 +02:00
Christoph Oelckers
9f1f17c306
- fixed: The PolyBSPs weren't fully initialized. Some GZDoom-only fields in the segs were skipped.
2014-10-14 08:54:08 +02:00
Christoph Oelckers
5d032f3fcf
- fixed: Since the engine can no longer change renderers on the fly, thanks to ZDoom's messed up video startup code, we have to abort with a fatal error if we can't create a GL context. Otherwise the user will never see a meaningful message.
2014-10-06 10:00:02 +02:00
Christoph Oelckers
3e2a17538b
- fixed: HUD weapons were affected by dynamic lights even when the CVARs said that they shouldn't.
2014-10-06 09:05:42 +02:00
Christoph Oelckers
48da2f87bb
- fixed: The light buffer index must not be reset between rendering a camera texture and the main scene.
...
Since rendering is asynchronous, the camera texture scene may not be finished once the main scene's lights get filled in. Unfortunately forcing a synchronization with glFinisg has bad side effects on performance the only remaining option is to use separate parts of the buffer for both scenes, which in extreme cases may increase the light buffer's size - but on modern hardware that shouldn't be a problem.
2014-09-21 21:01:11 +02:00
Christoph Oelckers
7359631a43
- fixed weapon drawing rules to account for the death camera.
2014-09-21 11:08:38 +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
43e2d704a3
- always use glPolygonOffset to render translucent geometry.
2014-09-20 09:04:36 +02:00
Christoph Oelckers
92dcf2e5ef
- fixed some of those supremely annoying and supremely pointless GCC/Clang compiler warnings.
2014-09-17 11:03:05 +02:00
Christoph Oelckers
a25ed3c807
- fixed: inverted rendering for fuzzy things with light powerup was switched off due to change of render style.
2014-09-15 12:15:19 +02:00
Christoph Oelckers
3c2f1952fd
Merge branch 'master' into v2.x
2014-09-12 21:01:55 +02:00
Christoph Oelckers
25951362fc
- fixed: When applying Boom's Transfer_Heights effect to a sector, gl_FakeFlat needs to remove all portals from the original sector planes that are being replaced in the sector copy.
2014-09-11 13:02:39 +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
62880f113b
- fix a render glitch with Back to Saturn X MAP06: Do not flood missing upper and lower textures with the backsector's flat if that backsector is malformed (i.e. has no area.)
2014-09-09 08:47:39 +02:00
Christoph Oelckers
9b8869e78d
Merge branch 'master' into v2.x
...
Conflicts:
src/gl/textures/gl_material.cpp
2014-09-09 01:30:11 +02:00
Christoph Oelckers
86d9c7ec8e
- add some compatibility settings to fix rendering glitches in BTSX_E1 MAP12.
2014-09-09 01:27:41 +02:00
Christoph Oelckers
b96dd6c421
- fixed: The missing fourth component of the texture coordinate must be filled with 1.0, not 0.0 before applying the texture matrix. Not doing so will cancel out the translation part of the matrix.
2014-09-02 10:31:48 +02:00
Christoph Oelckers
fa3a62e954
- fix a render glitch with Back to Saturn X MAP06: Do not flood missing upper and lower textures with the backsector's flat if that backsector is malformed (i.e. has no area.)
2014-08-31 23:01:53 +02:00
Christoph Oelckers
12160bd29c
- remove some obsolete code from decal rendering.
...
- avoid rebinding the same texture multiple times, as there's considerable overhead in the texture manager.
- check gl_sort_textures only once per scene, not per draw list.
2014-08-30 15:34:14 +02:00
Christoph Oelckers
6a3cd6378a
- found out that reading the CPU's real time clock costs a not insignificant amount of time so this is now only done when either the benchmark command is running or the rendertimes are shown.
2014-08-30 14:33:06 +02:00
Christoph Oelckers
49ec7beb8f
- separate draw lists for walls and flats. This makes the sorting much more efficient because draw types no longer need to be checked in the compare function. This is a lot more important than having perfect texture order.
2014-08-30 13:04:41 +02:00
Christoph Oelckers
a903cbe12e
- sorting draw items by light level no longer makes sense so remove all corresponding code from dicmp.
2014-08-24 13:10:45 +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
a2dc4afe3f
- screwed by the editor's autocompletion... (wrong GL flag was used...)
2014-08-19 14:25:47 +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
38796e7714
- removed some obsolete and useless GL calls.
2014-08-17 11:41:03 +02:00
Christoph Oelckers
b9ffb51d0c
- small but important optimization: Two-sided lines with both sides in the same sector don't really require vertex splitting for precise rendering.
2014-08-04 23:00:40 +02:00
Christoph Oelckers
19cfffebb3
- fixed: the WallTypes enum contained a value that no longer was valid. This was fixed orignally last week but it seems to have gotten lost.
2014-08-03 12:21:05 +02:00
Christoph Oelckers
c98e3ca99d
Merge branch 'master' into v2.x
2014-08-03 10:58:41 +02:00
Christoph Oelckers
b3e0d93385
- implemented rendering of wall sprites.
2014-08-03 10:57:58 +02:00
Christoph Oelckers
398d902e7e
- split off sprite clipping adjustment code into its own function.
2014-08-03 10:22:12 +02:00