Commit Graph

3187 Commits (37e4ed8029a469e4f702e77295e02fdade548ee3)

Author SHA1 Message Date
krzys-h 05bc65a90b Add support for more buttonsX.png textures (for modders) 2018-05-10 11:12:45 +02:00
krzys-h 8095dc14f7 Add support for custom button= for View cameras 2018-05-10 11:12:22 +02:00
krzys-h ed397d2b0f Make sure aliens hatched from eggs are not selectable by default, closes #1054 2018-05-09 23:25:52 +02:00
krzys-h 319d8e6854 Fix delete() not returning sometimes, closes #1067 2018-05-09 23:12:26 +02:00
AbigailBuccaneer e481905a25 Do less state setting in gl14 and gl21 2018-05-09 21:03:08 +01:00
AbigailBuccaneer c9a8a242a0 Remove CGL14Device's support for display lists
Closes #1153.
2018-05-09 21:03:08 +01:00
AbigailBuccaneer f8ebc6ec21 Remove code for drawing dynamic vertex formats
It's unused, and it's a bad idea - it's important for authoring tools
and for performance that vertex formats are well-defined instead of
dynamically created.
2018-05-09 21:03:08 +01:00
AbigailBuccaneer 94b30c00a0 Remove code duplication in CGLxxDevice 2018-05-09 21:03:08 +01:00
krzys-h 10fc47476b Fix code style 2018-05-09 18:34:27 +02:00
krzys-h 85772376fa Merge ScoreboardSortType with main Scoreboard command 2018-05-09 18:33:27 +02:00
krzys-h 1ed3f4b215 Add EndMissionTeams immediateWin=true; make the teams on win screen sorted 2018-05-09 18:28:25 +02:00
AbigailBuccaneer c027b54add Don't create a color renderbuffer for shadow map
When rendering the shadow map offscreen using framebuffer objects, it's
not necessary to create a color renderbuffer. Currently
FramebufferParams only lets you choose between a renderbuffer and a
texture for both color and depth attachments. This changes that, and now
you can ask for a texture, a renderbuffer, or nothing.

This improves performance. On my computer, with an 8192x8192 shadow map,
this improves overall frame time by 8.0%.
2018-05-09 17:25:52 +01:00
krzys-h abe489e294 Add EndMissionTimeout 2018-05-09 17:47:21 +02:00
krzys-h 94a18e9648 Add version override to release script
NOT TESTED!
2018-05-09 17:23:46 +02:00
krzys_h 761694fa05
Merge pull request #1161 from AbigailBuccaneer/fix/1160
Fix -Wsuggest-override compile errors in tests
2018-05-09 17:10:44 +02:00
AbigailBuccaneer 807d6e40e3 Fix -Wsuggest-override compile errors in tests
Fixes #1160
2018-05-09 08:49:23 +01:00
krzys-h a3def6d683 Disallow firendly fire in ScoreboardKillRule 2018-05-08 23:57:13 +02:00
krzys-h 0baf9f8077 Don't commit code in a hurry like that... 2018-05-08 23:47:50 +02:00
krzys-h f03c3dbc10 Implement ScoreboardObjectRule 2018-05-08 23:44:23 +02:00
krzys-h 05bdd74bef Update data submodule 2018-05-08 20:27:11 +02:00
krzys-h dd40c4d4ee Make magnifyDamage=0 for fragile objects actually work
This fixes a bug in 36d2cf14b8
2018-05-08 19:54:25 +02:00
krzys-h db72a36315 Fix code style 2018-05-08 19:44:24 +02:00
Fiftytwo caf58c8ab8 Merge branch 'dev' of https://github.com/colobot/colobot into dev 2018-05-07 21:48:48 +02:00
krzys_h 5283865a5c
Merge pull request #1136 from colobot/dev-cbot-optimizations
Some CBot code optimizations
2018-05-07 20:53:52 +02:00
krzys_h 182c4c5cbf
Merge pull request #1154 from AbigailBuccaneer/shadow-shimmering
Fix shadow shimmering
2018-05-07 20:53:28 +02:00
krzys_h a54f65f71b
Merge pull request #1152 from AbigailBuccaneer/consistent-shadow-antialiasing
Improve shadow quality and performance in gl33
2018-05-07 20:53:21 +02:00
krzys_h 50ed675acd
Merge pull request #1150 from AbigailBuccaneer/debug-rendering
Add generic debug rendering functions
2018-05-07 20:53:12 +02:00
krzys_h f146d2885b
Merge pull request #1149 from AbigailBuccaneer/tighter-visibility-checking
Improve object visibility culling with tighter bounding spheres
2018-05-07 20:53:00 +02:00
krzys_h 44f2684c70
Merge pull request #1148 from AbigailBuccaneer/text-batching
Improve text rendering performance
2018-05-07 20:52:50 +02:00
krzys-h 6e273e7e33 Declare CBotVar::m_token as const 2018-05-07 20:51:44 +02:00
krzys_h 05fe7431c4
Merge pull request #1143 from AbigailBuccaneer/fix/1087-positional-sounds
Fix global sounds being positioned at camera
2018-05-07 20:43:03 +02:00
krzys_h b36d40a509
Merge pull request #1151 from melex750/dev-savegame
Fix saving/loading "NewScript" programs for factory bots
2018-05-07 20:42:51 +02:00
krzys_h b9e2edce6c
Merge pull request #1146 from colobot/dev-scene-camera
Implement viewpoint feature
2018-05-07 20:42:18 +02:00
krzys_h 099a906b17
Merge pull request #1129 from colobot/dev-scoreboard-sort
Add realtime scoreboard sorting
2018-05-07 20:42:02 +02:00
krzys_h 35640b8e3f
Merge branch 'dev' into dev-scoreboard-sort 2018-05-07 20:41:40 +02:00
krzys-h 36d2cf14b8 Make magnifyDamage influence fragile objects 2018-05-07 20:31:36 +02:00
krzys-h 1d09ee9b3c Fix transportable object damage rules
This makes the rules match the original Colobot like they were supposed to
2018-05-07 20:31:36 +02:00
krzys-h 6ccf32ec68 fixup! Fix code style in #1150 2018-05-07 20:28:31 +02:00
AbigailBuccaneer abeb7fceb2 Fix shadow shimmering
Shadow shimmering is a visual artefact where the outlines of shadow
mapped objects don't stay stable when the camera is moved or rotated.
The reason is that as the shadow map's origin moves, the objects
rendered to the shadow map have temporal aliasing around their edges.

The solution is to only move the shadow map in texel-sized increments.
Because the shadow map's projection is orthographic, moving the shadow
map origin in texel increments ensures that objects that aren't moving
don't show any temporal aliasing, as the position of the samples of the
object in worldspace stay the same.
2018-05-04 10:56:37 +01:00
AbigailBuccaneer 0d6fffd91f Improve shadow quality and performance in gl33
If CONFIG_QUALITY_SHADOWS is defined (which it always is) then the
fragment shader code that samples the shadow map will take five samples
in a cross shape around the point to be sampled, to apply antialiasing.

Currently, the offset of these samples is hardcoded to 0.00025× the
shadow map resolution. This is very inconsistent: if the shadow map
resolution is 128×128, then these samples are 0.032 texels apart, which
is a waste of four texture samples, and essentially means that no
antialiasing is applied. If the shadow map resolution is 8192×8192, then
these samples are 2.048 texels apart, which causes visual artefacts
around shadow edges, instead of giving smoother shadows.

The correct thing to do is to always sample exactly one texel away from
the original position. This is easy in GLSL 3.30, as it includes a
textureOffset function which offsets a texture fetch by an exact number
of texels. This is faster than manually calculating an offset ourselves,
it fixes visual artefacts at high resolutions, and it properly applies
antialiasing at low resolutions.
2018-05-02 16:30:45 +01:00
krzys-h 38a34829af Fix code style in #1150 2018-05-01 21:27:49 +02:00
melex750 a918fcabb4 Fix save/load NewScript programs for factory bots
Fixes #797
2018-04-30 13:43:03 -04:00
AbigailBuccaneer 6f6cfb136a Batch draw calls from CText to improve performance
This significantly speeds up text rendering. On my computer, looking at
the program editor with a full screen of text, this commit takes the
framerate from under 30 to 60 (hitting vsync).

Performance could be further improved in the gl33 renderer by using
instancing or glPrimitiveRestartIndex instead of glMultiDrawArrays, but
that would be a more invasive change.

All of the interface rendering could use a unified quad batching system,
instead of it being limited to CText, but that would require some
refactoring in CText as it currently draws using a different coordinate
space to the rest of the interface.

Fixes #1104.
2018-04-30 10:18:51 +01:00
AbigailBuccaneer c445d7d9a9 Add generic debug rendering functions
Currently the engine can draw debug spheres to show crash sphere
positions. This extends this to draw arbitrary spheres and cuboids,
transformed arbitrarily. With these in place it's now very quick and
easy to create a debug visualisation - for example, it's a one-line code
change to render the bounding box or sphere of every EngineObject.
2018-04-29 23:41:53 +01:00
AbigailBuccaneer 282a793a13 Improve object vis with tighter bounding spheres
This commit improves rendering performance by doing a better job of
checking whether an object is visible via its bounding sphere or not.

The engine maintains a bounding box for each EngineBaseObject that's
exactly large enough to fit every vertex. From this, it computes a
bounding sphere, and only draws objects if the sphere is within the view
frustum. Previously, the bounding sphere was always centered on the
EngineBaseObject's origin, even for models where the bounding box center
is significantly offset from the origin. Now, the bounding sphere is
always the tightest sphere which fits the bounding box.
2018-04-29 19:35:02 +01:00
AbigailBuccaneer c49c815ea5 Set uniforms less often during text rendering
We now call SetWindowCoordinates and SetInterfaceCoordinates once per
string, rather than once or twice per character.
2018-04-27 10:43:26 +01:00
krzys_h fdf67b8217
Merge pull request #1123 from B-CE/i18n
French translation update 1.11
2018-04-24 14:17:43 +02:00
krzys_h db90fcd2ef
Merge pull request #1118 from nextghost/dev
Czech translation
2018-04-24 14:17:23 +02:00
krzys_h 64ab5e3308
Merge pull request #1053 from colobot/dev-a-thing
added a thing
2018-04-24 14:13:42 +02:00
krzys_h 8b86a1f222
Merge pull request #1142 from AbigailBuccaneer/Wmissing-declarations
Compile with -Wmissing-declarations
2018-04-24 14:12:43 +02:00