Commit Graph

898 Commits

Author SHA1 Message Date
f8fde587a0 Removes unused dummy shader from decals rendering.
This was SVN commit r24828.
2021-02-04 00:00:55 +00:00
30fc281a4c Significantly reduces number of OpenGL state changes for terrain rendering.
Tested By: Freagarach, Langbart, Stan
Differential Revision: https://code.wildfiregames.com/D3512
This was SVN commit r24826.
2021-02-03 17:01:38 +00:00
55f6eae7c5 Removes unused dummy shader from terrain rendering.
This was SVN commit r24822.
2021-02-02 15:34:52 +00:00
065b03a3db Removes useless transparent pass before the water for lowest settings since the water is opaque there.
This was SVN commit r24756.
2021-01-21 22:38:11 +00:00
9df127f9d1 Removes shader code duplication to calculate LOS.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D3428
This was SVN commit r24732.
2021-01-20 18:46:32 +00:00
5cbf8f04ec Removes code duplications for binding shadows to shaders.
This was SVN commit r24710.
2021-01-19 19:19:04 +00:00
4c4da81cc4 Fix no pch build.
This was SVN commit r24664.
2021-01-17 15:40:10 +00:00
57389cb9cb Partly restores the requested functionality to hide skies removed in 78d4dd0109.
This was SVN commit r24662.
2021-01-17 13:28:37 +00:00
1cb4ee1634 Combines terrain and units ambient colors into the single color.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D3237
This was SVN commit r24661.
2021-01-17 13:10:00 +00:00
4a69e9117e Removes usages of GetRenderPath to checking for support of shaders.
This was SVN commit r24652.
2021-01-16 23:18:56 +00:00
78d4dd0109 Removes useless option to show sky
Differential Revision: https://code.wildfiregames.com/D3382
This was SVN commit r24651.
2021-01-16 21:16:31 +00:00
6282960991 Removes useless option for shadows on water
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D3368
This was SVN commit r24630.
2021-01-15 15:45:39 +00:00
a9c27b412b Removes CPU lighting after no FFP
Comments By: Stan
Differential Revision: https://code.wildfiregames.com/D3346
This was SVN commit r24599.
2021-01-13 21:03:55 +00:00
e5cbd3decd Removes unused GL texture properties after removed FFP.
This was SVN commit r24577.
2021-01-12 23:18:29 +00:00
f1a3b446f7 Removes the unused terrain rendering function after removed FFP.
This was SVN commit r24576.
2021-01-12 23:14:08 +00:00
8ae3c09dc0 Fix renderer crash in GCC 7.5.
The 'arena' allocator does not take memory alignment into account, which
can result in crashes at -O3 with gcc 7.5 (presumably because of SSE
instructions).

This accounts for alignment issues, fixing the issue.
Also do various cleanup in lib/allocators.

Reported by: Bellaz89, Freagarach
Comments by: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D3181
This was SVN commit r24517.
2021-01-06 14:56:17 +00:00
d28d17e96c Remove SSE detection duplication in Colors and ModelRenderer
- Rename macros to be more explicit
 - Move detection code to a separate file
 - Remove a lot of checks in ARB mode (ModelDef.cpp would check for sse
multiple times per frame)
 - Make explicit the SSE2 dependency for Windows

Comments by: @vladislavbelov @wraitii @OptimusShepard
Differential Revision: https://code.wildfiregames.com/D3212
This was SVN commit r24489.
2020-12-31 15:37:28 +00:00
4942cabab5 Fix most Clang 10 Warnings
Refs: #5550, #5294

Remove dead code from f71be3c764
Fix buggy code from ff50b0b74c
Comments by: @wraitii, @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D3177
This was SVN commit r24487.
2020-12-31 14:25:37 +00:00
dd0b56c8aa Replace DISCARD macro with ignore_result template.
Fixes eb7940b418.
As reported by Vladislav, there is possibly confusion on what exactly is
being ignored when there are multiple statements after DISCARD. Explicit
wrapping avoids that.

Differential Revision: https://code.wildfiregames.com/D3206
This was SVN commit r24397.
2020-12-15 09:03:44 +00:00
369c2e8801 Further header & precompiled cleanup, fix no-PCH builds.
GUIObjectBase is made a IGUIObject* to avoid including those headers
un-necessarily. Subsequent diffs ought to clean up the various of
pointers for that with a similar type with reference semantics.

Also:
- Add standard C and C++ headers (mostly cstring for memcpy, string and
vector) where needed.
- Swap out some includes for forward declarations
- Clean up un-necessary boost includes in precompiled and other headers.
- Clean up precompiled headers, including fewer things.
- Move ACPI to the windows-specific folder as it's included there only
and mostly specific to that platform.

Thanks Stan for the testing.

Differential Revision: https://code.wildfiregames.com/D3129
This was SVN commit r24352.
2020-12-09 14:39:14 +00:00
f44390f3fc Fix 3391542fec: AA / Sharpness not being correctly enabled at the start.
Reported by: OptimusShepard
Tested By: OptimusShepard, Stan
Differential Revision: https://code.wildfiregames.com/D3138
This was SVN commit r24318.
2020-12-03 12:19:44 +00:00
d2075bed5d Fix graphics issue with old AMD cards.
Reviewed by: @vladislavbelov
https://upload.jabberfr.org/hUkR3nTdfhbhHI92/0b5c64c3-136c-4744-a4ca-a70222a3cfaf.png

This was SVN commit r24292.
2020-11-29 16:26:28 +00:00
9ae084519f Fix most of the new vs2017 induced warnings.
Refs: https://code.wildfiregames.com/D3096
https://code.wildfiregames.com/D3103 #5862
Reviewed by: @wraitii
Comments by: @Angen
Differential Revision: https://code.wildfiregames.com/D3126
This was SVN commit r24268.
2020-11-26 22:28:50 +00:00
eb7940b418 Silence warnings about unused result.
Introduce a DISCARD macro to ignore the warn_unused_result attribute
used by Spidermonkey, and reuse it elsewhere.

Differential Revision: https://code.wildfiregames.com/D3147
This was SVN commit r24261.
2020-11-26 13:58:59 +00:00
3391542fec Fix rendering options failures following 8a1b3d6769
Two issues are fixed:
- Atlas on non-Mac crashed when started from within the game.
- MSAA options crashed if enabled on startup.

The underlying issues where improper shutdown, and assuming the renderer
was initialised than it might not be (in particular, the post-processor
wasn't).

Tested by: Stan
Differential Revision: https://code.wildfiregames.com/D3131
This was SVN commit r24233.
2020-11-22 11:09:13 +00:00
8a1b3d6769 Allow registering hooks that trigger on config changes.
Rendering options use this capability to simplify their implementation.
This makes it easier to add new options.

Comments by: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D2293
This was SVN commit r24228.
2020-11-21 11:57:14 +00:00
f6348b9617 Clean up header includes, add new forward declarations.
This cleans up many un-necessary header includes, either simply
providing nothing or forward declarations in their place.

No major compilation time change here, though this does reduce depencies
in some headers.

Also fix up old MacOS STL-include fixes that are no longer relevant.

Differential Revision: https://code.wildfiregames.com/D3128
This was SVN commit r24227.
2020-11-21 11:20:29 +00:00
9937116f2b Adds MSAA to anti-aliasing techniques.
Tested By: Freagarach, OptimusShepard, Stan
Differential Revision: https://code.wildfiregames.com/D2812
This was SVN commit r24188.
2020-11-15 20:07:48 +00:00
ab5616b4c4 Mass rename CxPrivate to CmptPrivate.
As part of the SM45->52 migration, a ScriptInterface becomes a wrapper
around a JSCompartment, not a JSContext, thus we ought to store private
data for the compartment and not the context.
This is a mass rename of CxPrivate to CmptPrivate to match that before
the actual changes.

Part of the SM52 migration, stage: SM45 compatible

Patch by: Itms
Tested By: Freagarach
Refs #4893

Differential Revision: https://code.wildfiregames.com/D3089
This was SVN commit r24177.
2020-11-13 16:44:15 +00:00
9669b5f1a9 Removes additional depth texture copying and reusing existing refraction depth.
Tested By: Stan, wraitii
Differential Revision: https://code.wildfiregames.com/D3084
This was SVN commit r24160.
2020-11-11 18:46:52 +00:00
e038f7844b Fixes terrain overlays by removing fixed pipeline dependency.
Tested By: Freagarach, wraitii
Differential Revision: https://code.wildfiregames.com/D3074
This was SVN commit r24154.
2020-11-09 18:50:40 +00:00
61c6da91e8 Moves foam calculation into a separate function and fixes its lighting.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D3071
This was SVN commit r24145.
2020-11-08 22:17:58 +00:00
8c77c4b2b6 Refactors coordinates of SOverlayTexturedLine, replaces array of floats by array of CVector2D.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D3072
This was SVN commit r24144.
2020-11-08 14:47:25 +00:00
4b52e87934 Adds wireframe mode to overlays and replace the private m_TerrainRenderMode usages by related getter.
This was SVN commit r24143.
2020-11-08 11:31:32 +00:00
b7cbfecd19 Replacing losMap usages by existed and more consistent losTex.
losMap was introduces in fe21c5e023.

This was SVN commit r24130.
2020-11-04 22:55:34 +00:00
ad965e167d Moves simple water from fixed pipeline to shader pipelines (ARB/GLSL).
Commented By: Stan
Reported By: Freagarach
Tested By: Freagarach, Stan
Differential Revision: https://code.wildfiregames.com/D3059
This was SVN commit r24129.
2020-11-04 22:25:08 +00:00
2d54653bc3 Little cleanup of PatchRData by reordering includes and correctly formats some loops.
This was SVN commit r24126.
2020-11-04 15:53:33 +00:00
c64f8824d7 Fixes wireframe mode for terrain, continuing remove fixed pipeline dependencies.
Commented By: Stan, wraitii
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D3056
This was SVN commit r24125.
2020-11-04 15:52:26 +00:00
d7d02a4740 Moves terrain lighting calculation to GPU.
Reviewed By: wraitii
Tested By: OptimusShepard, Stan, wraitii
Differential Revision: https://code.wildfiregames.com/D3052
This was SVN commit r24124.
2020-11-04 12:54:17 +00:00
6e3db3d84c Removes remaining fixed program used in shader pipelines and adds check on FFP create.
Commented By: Stan
Differential Revision: https://code.wildfiregames.com/D3048
This was SVN commit r24121.
2020-11-03 18:59:27 +00:00
Angen
dcdc17b2dd Do not use GPUSkinning without glsl [Crash fix]
Disable GPUSkinning when glsl is disabled, because VertexAttribPointer
is not implemented on ARB/GLES and it is called by GPUSkinning.

Differential Revision: D2423
Reviewed by: vladislavbelov
Fixes: #5635

This was SVN commit r24101.
2020-10-13 16:48:04 +00:00
ff9a5fe8f9 Render waves for fancy water effects only if we have water on screen.
Waves were added in 9ce51f4357.

This was SVN commit r24047.
2020-09-16 18:43:58 +00:00
92cbf5ead0 Reduces memory usage for fancy water by merging two textures.
Two textures were added in 9ce51f4357.

Reviewed By: wraitii
Tested By: Angen, Freagarach
Differential Revision: https://code.wildfiregames.com/D2983
This was SVN commit r24046.
2020-09-16 18:03:51 +00:00
4f39e6675a Completely separates fixed and shader paths in sky rendering.
Removes usages of fixed pipeline functions in shader path.

Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2944
This was SVN commit r23954.
2020-08-09 15:21:06 +00:00
b664a1ae8e Moves GL calls of fixed pipeline under the same condition.
This was SVN commit r23953.
2020-08-09 13:01:58 +00:00
4c1847d3db Removes old matrices from sky rendering in shader path.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2943
This was SVN commit r23952.
2020-08-09 11:24:09 +00:00
26ae55cad0 Adds contrast-adaptiv-sharpening filter, also helps to partly remove FXAA texture blurring.
Patch By: OptimusShepard
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2642
This was SVN commit r23947.
2020-08-07 22:16:55 +00:00
f27e5ce139 Fix ODR violation for ShaderModelRendererInternals.
ShaderModelRendererInternals is defined twice, once by ModelRenderer.cpp
and once by HWLightingModelRenderer.cpp.
Having two different definitions in the global namespace is a violation
of the C++ One-Definition-Rule.

Patch by: StefanBruens
Reviewed By: wraitii, Vladislav
Differential Revision: https://code.wildfiregames.com/D2932
This was SVN commit r23941.
2020-08-06 11:33:26 +00:00
57bbd774f6 Makes FXAA working only for GLSL and disabled for ARB.
Also adds option dependency. FXAA was introduced in 113b1c49b9.

Patch By: OptimusShepard
Differential Revision: https://code.wildfiregames.com/D2780
This was SVN commit r23880.
2020-07-24 18:48:18 +00:00
6f70a901f8 Remove duplicated call in tile rendering for TerrainOverlay.
Patch By: vinhig
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D2811
This was SVN commit r23767.
2020-06-12 20:52:18 +00:00
fd8a47f5d9 Moves calculations of bounds for fixed shadows to a separate function.
Reduces complexity of the SetupFrame function. Fixed shadows were added
in 8e48e1b17e.

This was SVN commit r23766.
2020-06-12 20:09:08 +00:00
06bf3a8739 Adds GLSL shaders of overlay lines.
We were using ARB shaders in GLSL mode for overlay lines (unit
selection, ranges and so on).

Tested By: Freagarach, OptimusShepard, Stan
Differential Revision: https://code.wildfiregames.com/D2621
This was SVN commit r23765.
2020-06-12 15:39:44 +00:00
e9361705ae Refactor HWDetect and rendering options setup.
Remove duplication when setting graphic options by reading the configDB
directly.
Properly protect the ModIO config keys.

Approved By: linkmauve
Refs #5538

Differential Revision: https://code.wildfiregames.com/D1931
This was SVN commit r23747.
2020-06-07 13:16:57 +00:00
2e6aecb210 Fixes FXAA for maps with default effects, FXAA was introduced in 113b1c49b9.
Tested By: OptimusShepard, Stan
Differential Revision: https://code.wildfiregames.com/D2712
This was SVN commit r23617.
2020-05-02 22:34:29 +00:00
113b1c49b9 Adds anti-aliasing option with FXAA algorithm.
Differential Revision: https://code.wildfiregames.com/D2537
This was SVN commit r23484.
2020-02-05 21:53:10 +00:00
00989a6560 Uses fixed-function pipeline functions only in FFP mode.
Differential Revision: https://code.wildfiregames.com/D2619
This was SVN commit r23481.
2020-02-05 14:00:52 +00:00
36883f2832 Renames RenderTerrain to RenderTerrainFixed to follow its implementation.
RenderTerrainShader was added in d295dacb9b.

This was SVN commit r23479.
2020-02-04 23:16:30 +00:00
b42ebe99f5 Fixes commented block introduced in ecc7d2913e.
Noticed By: Stan
This was SVN commit r23463.
2020-01-29 23:44:14 +00:00
ecc7d2913e Moves GL error check after SwapBuffers to decrease a possible synchronization during rendering process.
Comments By: Stan, elexis
Differential Revision: https://code.wildfiregames.com/D2600
This was SVN commit r23462.
2020-01-29 22:03:44 +00:00
95b13cda13 Adds const to Material and CShaderProgram::Binding methods, removes a redundant variable from ModelRenderer
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2598
This was SVN commit r23445.
2020-01-26 21:32:12 +00:00
1750b0b34c Fixes GLES mode builds on Mesa and running on Intel Iris drivers.
Patch By: linkmauve
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2448
This was SVN commit r23410.
2020-01-17 21:13:51 +00:00
49415f8716 Splits debug display of frustums for an easier debugging of a culling and shadows
This was SVN commit r23395.
2020-01-14 23:51:29 +00:00
b6300eb417 Reorder rendering passes to decrease a possible driver synchronization
Hack inside the ShadowMap was added in b889826a3d and became outdated in
1866c2d3b7.

Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2541
This was SVN commit r23370.
2020-01-11 15:25:05 +00:00
8e48e1b17e Adds optional fixed shadows without swimming effect
Fixed shadows have fixed rendering distance. Also they don't have a
swimming (blinking) effect on camera movement/rotation.

Comments By: Stan
Differential Revision: https://code.wildfiregames.com/D2465
This was SVN commit r23333.
2020-01-05 22:44:39 +00:00
e1cf1e16b9 Unbind the correct texture slot in SkyManager
Wrong binding pair was introduced in 779a33ee30.

Patch By: linkmauve
Differential Revision: https://code.wildfiregames.com/D2487
This was SVN commit r23263.
2019-12-19 21:41:01 +00:00
b5bac2a2a2 Fixes overlay renderer on fixed render path, it was introduced in 14bfbbf9d4.
This was SVN commit r23247.
2019-12-16 18:45:03 +00:00
2fa18b1503 Replaces direct Camera member usage by appropriate method call (m_Orientation > GetOrientation()).
This was SVN commit r23234.
2019-12-14 12:56:47 +00:00
df329d1b81 Optimise out of frustum rendering of texture overlays.
Reviewed By: wraitii
Commented By: Stan
Differential Revision: https://code.wildfiregames.com/D1847
This was SVN commit r23229.
2019-12-10 23:13:37 +00:00
6110d108c1 Removes hard-coded clip planes from water shader.
Differential Revision: https://code.wildfiregames.com/D2443
This was SVN commit r23228.
2019-12-10 21:39:09 +00:00
Angen
f4562b87b6 Remove duplication of code from WaterManager
Use already defined function ReloadWaterNormalTextures with the same
code.
Fixes the TODO from 2d7d5b446d / aab15123f1

Differential Revision: https://code.wildfiregames.com/D2413
Reviewed By: @vladislavbelov
This was SVN commit r23219.
2019-12-07 15:32:47 +00:00
5d2c20beb0 Replace boost::unordered_map, boost::unordered_set with std::unordered_map, std::unordered_set to establish consistency.
Replace boost::hash_combine with a lib/hash.h hash_combine performing
the same statement.
Replace inconspicuous global boost hash_value specializations with
std::hash specializations.
No performance difference was observed in three simple MeshManager
measurements.

Remove unused TAG_MASK and h_tag in h_mgr.cpp following 0748c5a75e.
Replace typedef with using keyword and sort header includes.

Differential Revision: https://code.wildfiregames.com/D2441
Tested on: clang  9.0.0, gcc 9.2.0, Jenkins/vs2015, Jenkins/gcc6

This was SVN commit r23191.
2019-11-25 14:30:25 +00:00
75d9c6293b Adds projection type to CCamera to control usages of projection dependent properties.
Commented By: elexis
Differential Revision: https://code.wildfiregames.com/D2351
This was SVN commit r23036.
2019-10-03 18:51:40 +00:00
a19b14aeb7 Cleanup Camera related code and uses constant references where possible.
Commented By: elexis
Differential Revision: https://code.wildfiregames.com/D2350
This was SVN commit r23033.
2019-10-03 12:58:47 +00:00
987b36d53c Do not send Reflection and Refraction matrices to shader when not needed
Patch By: Angen
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1954
This was SVN commit r22971.
2019-09-22 14:56:22 +00:00
8f7729bfdb Fixes values of clip planes in PostProcManager.
Reviewed By: wraitii
Commented By: elexis
Differential Revision: https://code.wildfiregames.com/D2196
This was SVN commit r22940.
2019-09-20 07:54:44 +00:00
f1de8eb4ba Removes usages of duplication of Clamp function in gui, ps and renderer. Refs D1763.
This was SVN commit r22926.
2019-09-18 14:44:31 +00:00
b1de59de66 Fix algorithmic error in 9903fd8a6c (waves computation speedup), and delete unused code.
9903fd8a6c introduced a much faster (for a little precision cost)
algorithm to compute distance to shore. However a condition was
incorrectly inverted, which made the algorithm return less-than-sensible
results in many situations.

Further, there was some unused code left behind which is now removed.

Fixes #5580

Reported by: nani (shore bug), elexis (unused code)
Differential Revision: https://code.wildfiregames.com/D2249
This was SVN commit r22862.
2019-09-07 08:50:55 +00:00
4919a6185e Remove unused GUIUtil functions, unused GUI includes and some tails in GUIUtil.
HasSetting from 3dfa23cd25 is actually redundant with
IGUIObject::SettingExists.
GetSettingPointer from 8f4f8e240f is superseded by GetSetting reference
following 3dfa23cd25 and 040624acff.
Deregister copying SetSetting variants for CStr and CStrW following copy
removal in 040624acff.
The default template <typename T=int> from c2a71e41bf can be removed
following FallBackSprite/FallBackColor removal in 9985fcf5bd and
RecurseObject unification in d4d5187c9d.
Delete all unused GUI includes, refs D1478.
Remove GUIUtil friend class following something.

Differential Revision: https://code.wildfiregames.com/D2225
Tested on: gcc 9.1.0, Jenkins

This was SVN commit r22779.
2019-08-25 08:57:36 +00:00
486691b49a Moves and cleanups includes and public/private section of PostprocManager.
Reviewed By: elexis
This was SVN commit r22738.
2019-08-20 21:15:15 +00:00
43df94c246 Fix 2a485c5e3b Wind computation - switch to signed integers.
Silences a GCC 9 warning and the logic was faulty.

Reported by: elexis
Differential Revision: https://code.wildfiregames.com/D2180
This was SVN commit r22670.
2019-08-15 17:02:53 +00:00
2a485c5e3b Wind speed computation rework.
This reworks wind-speed computation to not use a blurred-heightmap
approach but rather a slightly more wind simulation approach. It fixes
issues near the edges of some maps.

Differential Revision: https://code.wildfiregames.com/D1721
This was SVN commit r22668.
2019-08-15 11:56:00 +00:00
69abe717e3 Fix no-pch build following renderer options refactoring 5c4d124d2a
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D2148
This was SVN commit r22612.
2019-08-04 20:08:06 +00:00
5c4d124d2a Refactor renderer options.
This moves the renderer options into their own class to:@
  - allow one to only include the rendering options, not the whole
renderer header, when one wants access to rendering options.
  - centralise rendering changes and their side-effects.
  - clean up code.

Tested by: historic_bruno, Freagarach
Commented by: historic_bruno
Differential Revision: https://code.wildfiregames.com/D1929
This was SVN commit r22610.
2019-08-04 08:28:30 +00:00
c4789fdcc7 Fix missing ShadowMap headers in previous, da4e601d8f.
Tested on: gcc, clang

This was SVN commit r22606.
2019-08-04 05:58:55 +00:00
da4e601d8f Move GetDefaultGuiMatrix to a separate file.
The function was located in the wrong file, because it is not logically
related to IGUIObject settings.
The separate file allows the various users to include it without
including the GUIRenderer.

This was SVN commit r22605.
2019-08-04 03:52:00 +00:00
8babfe2330 Refactors camera projections - makes projection functions of camera more clear.
Reviewed By: elexis
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2012
This was SVN commit r22404.
2019-06-26 22:54:05 +00:00
ec4d84c72f Removes unused and obsolete LightingModel.
It was introduced in d295dacb9b as a way to control behavior of shaders.
Its usage in shaders was completely removed in 05008d190e (before that
in b7888aea52).

Reviewed By: elexis
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2011
This was SVN commit r22403.
2019-06-26 22:30:23 +00:00
3e53d05298 Fixes includes and forward declarations in CPatchRData.
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1952
This was SVN commit r22371.
2019-06-12 20:03:22 +00:00
4b65cc0317 Fixes a typo introduced in cb048b4738 in shore calculations, found by Angen and fixes style notes by elexis.
Reviewed By: Angen
Differential Revision: https://code.wildfiregames.com/D1949
This was SVN commit r22334.
2019-06-03 20:19:18 +00:00
f4194df416 Removes unused variable from ModelRenderer introduced in 6bc33fe8bd. Found by Angen.
Patch By: Angen
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D1812
This was SVN commit r22333.
2019-06-03 20:06:01 +00:00
ddcdc643ba Further cleanup of MikkTSpace
- Move the * and & to the correct side,
- Add .0 and  0.f to clearly mark the types
- Pass pointers instead of arrays
- Add a newline after forward declaration
- Add spaces between operators
- Use c++ cast

Reviewed by: @vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1934
This was SVN commit r22323.
2019-05-30 23:03:01 +00:00
39720041f7 Cleanup MikktspaceWrapper.
Reviewed by: @Angen
Differential Revision: https://code.wildfiregames.com/D1872
This was SVN commit r22316.
2019-05-28 22:06:29 +00:00
01a8138780 Water GLSL shader improvements around reflections and whitespace fixes.
This improves refractions around entities close to the surface, such as
fishes, by handling depth better and by clipping the water plane a
little lower.

This uses the skybox for reflections when refractions are enabled but
reflections are disabled, making it possible to play with reflections
disabled without having super-ugly water (arguably a performance
improvement).

Differential Revision: https://code.wildfiregames.com/D359
This was SVN commit r22297.
2019-05-25 11:08:57 +00:00
7182de3b20 Removes unused variable. It was introduced in f0615df318, an interface to control
the variable was removed in 12e2428495. A usage was removed in
9376609ee8.
And since then the usage is useless because we use infinity sky model.

This was SVN commit r22154.
2019-04-02 18:49:12 +00:00
651cf8b364 Split CColor from Shapes.
Reviewed By: wraitii
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D1515
This was SVN commit r22051.
2019-01-13 15:38:41 +00:00
9376609ee8 Remove hardcoded SkyBox sizes and use the infinity sky. No we render
the skybox at the current camera location, so that the skybox appears
indefinitely far away. Refs #3458.

Reviewed By: wraitii
Tested By: elexis, Stan
Differential Revision: https://code.wildfiregames.com/D1683
This was SVN commit r22039.
2019-01-06 21:55:30 +00:00
d5668cfb99 Add an error message for crashes without required UV sets.
Reviewed By: Stan, wraitii
Differential Revision: https://code.wildfiregames.com/D433
This was SVN commit r22037.
2019-01-06 21:04:01 +00:00
38c096896b Disable back-face culling when rendering the Sides of the map, preventing a graphical artifact at the edge of water maps.
By rendering sides even when they are back-facing, the water shader is
on top of a mesh instead of emptiness and this solves an old
"edge-of-map" graphical issue.

Taken out from D359 with vlad's agreement. See screenshots there for
more information on the exact issue.

This was SVN commit r22007.
2019-01-02 15:32:19 +00:00
9903fd8a6c Clean up and speed up the water manager distance computations
The water manager computations for "fancy water effects" have always
been quite slow. I've updated one of the functions to be much faster,
and the other doesn't need to be called (apparently, since I removed
coastal foam, which tbh I don't remember doing).

This should all be redone entirely to be honest, as it's generally
terrible, but in the short-termâ„¢ this makes this function almost usable
in real-time.

Differential Revision: https://code.wildfiregames.com/D78
This was SVN commit r22006.
2019-01-02 15:23:02 +00:00
1e9c0f8378 Cleanup and simple refactor the SkyManager.
Differential Revision: https://code.wildfiregames.com/D1672
Reviewed By: Imarok
This was SVN commit r21952.
2018-12-26 13:13:52 +00:00
f7783fb4bb Fix biome-specific mappreviews in 7f602037ba for zipped mods, refs #4962.
Add TextureExists to avoid needless redundant hardcoding of the
filenames.
Remove mapBiome.Preview from gamedescription.js, obsolete following
8cde469501.

Differential Revision: https://code.wildfiregames.com/D1583
Accepted By: Vladislav
This was SVN commit r21859.
2018-08-05 21:50:00 +00:00
4c73614955 In preparation of renaming and grouping main.cpp shutdown variables:
Declare the g_GameRestarted hack from 12f0720f31 in main.cpp, because it
is main.cpp and Game.cpp who provide it's value.
Move the comment so that the connotation becomes clear when reading
main.cpp.

Remove the extern declaration introduced to the Renderer in fb035d08e3
that became obsolete with ed7c66eb82.

This was SVN commit r21816.
2018-05-08 09:24:16 +00:00
13e1702777 Add missing ScriptInterface includes to
JSInterface_L10n.cpp from d6db5a466d,
JSInterface_Renderer.cpp and JSInterface_GUITypes.cpp from 4b1297b328,
JSInterface_VisualReplay.cpp from b830233498,
JSInterface_Game.cpp from 5f8be8e0c6,
JSInterface_Simulation.cpp from 921c5515a6,
JSInterface_Debug.cpp from d6cb9c845b,
JSInterface_Main.cpp from 486aec18d4, refs #4772,
JSInterface_Mod.cpp where it was incorrectly removed in af03c72f76.

Refs D1470.
Sort includes alphabetically, add recent Coding Convention macro
comments.

This was SVN commit r21789.
2018-04-27 16:48:44 +00:00
7ecd1d2c34 Clean some forward declarations.
Remove unused (wrong copy&paste) includes from 86fcf0de8c in
JSInterface_ModIo.*, initially hinted at by leper.
Remove a forward declaration in JSInterface_Console.h that should have
become an include with 4b1297b328, because CxPrivate must be declared
before its reference too.
Remove a forward declaration in JSInterface_Mod.h from 64bfa089af that
should have been the include added in af03c72f76 which in turn omitted
to remove this forward declaration.
Remove a forward declaration in Renderer.h that became unused with
1ddd24bb8c.

Differential Revision: https://code.wildfiregames.com/D1470
Reviewed By: Itms
This was SVN commit r21788.
2018-04-27 16:06:42 +00:00
cb048b4738 A little cleanup of the PatchRData.cpp.
This was SVN commit r21612.
2018-03-24 11:20:57 +00:00
d7220c3ebb Remove debug lines
This was SVN commit r21499.
2018-03-10 22:45:31 +00:00
c9fe940401 Fix an oversight in cc67d54aeb
Reviewed by: Itms,
Tested by: Angen,
Differential: https://code.wildfiregames.com/D1372

This was SVN commit r21498.
2018-03-10 22:42:01 +00:00
cc67d54aeb Fix compiler warnings on VS 2015, refs #3439, refs #5069.
Patch By: Stan
Reviewed By: Itms, vladislavbelov
Differential Revision: https://code.wildfiregames.com/D1262
This was SVN commit r21480.
2018-03-10 09:58:53 +00:00
b8c488b63a Added multiples UVs to animated model
Reviewed By: wraitii, Stan
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D448
This was SVN commit r21291.
2018-02-20 21:33:02 +00:00
2c8b78ddaa Option to disable fog effects.
Fixes #4626
Patch By: dp304
This was SVN commit r20584.
2017-12-04 15:54:24 +00:00
247bde356c Reload water shaders too when changing shader settings.
Refs #4626
Patch By: dp304
This was SVN commit r20583.
2017-12-04 15:51:20 +00:00
99d486c1d7 Allow models using alpha-blending (transparent models) to be silhouette casters.
This change ahead of D965, where fauna become silhouette casters, and
several fauna animals are transparent models.

Reviewed By: wraitii
Patch By: temple
This was SVN commit r20569.
2017-12-03 10:14:16 +00:00
71a5ebe1c9 Adds a missed initialisation in 7e239f38a3.
This was SVN commit r20382.
2017-10-30 19:32:16 +00:00
7e239f38a3 Adds a wireframe mode to the water rendering.
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D769
This was SVN commit r20378.
2017-10-30 00:02:29 +00:00
455ab4b9e2 Fix some format specifiers in debug strings. Reviewed by leper.
Differential Revision: https://code.wildfiregames.com/D909
This was SVN commit r20190.
2017-09-16 15:28:01 +00:00
5c01b50ca4 Add FALLTHROUGH, which in the best case is just [[fallthrough]].
Note that this does not fix the warnings in AtlasObjectXML, someone
interested
in fixing those should check whether using ICU would be a nicer
solution.

Reviewed By: echotangoecho
Differential Revision: https://code.wildfiregames.com/D740
This was SVN commit r20095.
2017-09-01 20:04:53 +00:00
9defd11440 Pass ScriptInterface as a const ref where possible.
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D739
This was SVN commit r20028.
2017-08-24 00:32:42 +00:00
1ddd24bb8c Remove unused Renderer function from 12e2428495.
Refs #2137
Reviewed By: Vladislav
This was SVN commit r20019.
2017-08-21 17:05:45 +00:00
6f9bf55ac5 Change the shadow map quality without restarting the match.
Differential Revision: https://code.wildfiregames.com/D804
Refs #4351
Patch By: Vladislav
This was SVN commit r20011.
2017-08-21 01:10:56 +00:00
04f2209b50 Rename WaterUgly setting to WaterEffects in order to remove the invertedboolean workaround of the options page.
Differential Revision: https://code.wildfiregames.com/D815
Refs #3737
Tested By: Stan
This was SVN commit r20010.
2017-08-21 00:09:25 +00:00
8df36bace4 Shadow map quality option.
Differential Revision: https://code.wildfiregames.com/D745
Fixes #4351
Refs #743
Patch By: Vladislav
This was SVN commit r20001.
2017-08-19 12:46:05 +00:00
c67d79d9f3 Recompute water graphics when changing the water level and upon deserialization to fix a graphical (non-simulation) OOS on rejoin.
Differential Revision: https://code.wildfiregames.com/D638
Refs #4596
Contains a fix mentioned by leper.

This was SVN commit r19862.
2017-07-01 04:15:49 +00:00
be2b2faa77 Properly apply texture to the last quad of an overlay textured line. Reviewed by vladislavbelov.
Fix #4617.
Differential Revision: https://code.wildfiregames.com/D663
This was SVN commit r19833.
2017-06-26 13:04:21 +00:00
d5caf97185 Fix Valgrind complaints in CRenderer by properly intializing some members values introduced in ab30e0d4fb. Refs #3922, #4492. Patch by Sandarac. Reviewed by vladislavbelov.
Differential Revision: https://code.wildfiregames.com/D536
This was SVN commit r19800.
2017-06-18 14:52:54 +00:00
f794a14610 Declare variable when actually initialized.
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D417
This was SVN commit r19508.
2017-05-04 06:53:21 +00:00
6ee830068a Print the name of OpenGL errors when they occur.
Patch by vladislavbelov
Differential Revision: https://code.wildfiregames.com/D313
This was SVN commit r19496.
2017-05-01 07:19:39 +00:00
4523c50850 Fix a vertex shader data pielup in the actor editor. It was reloading the shaders far too often.
Patch by Echotangoecho.
Differential Revision: https://code.wildfiregames.com/D93
This was SVN commit r19346.
2017-03-25 07:44:31 +00:00
9f50bf3f1e Only dereference cmpWaterManager if it is non-null.
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D259
This was SVN commit r19340.
2017-03-24 21:32:49 +00:00
417c84870c Actually remove trailing tabs from source/.
This was SVN commit r18991.
2016-11-23 14:09:58 +00:00
6149dd3841 Actually remove trailing whitespace for non-header files as well.
This was SVN commit r18989.
2016-11-23 13:02:58 +00:00
944ba16eb4 End source files with a newline.
This was SVN commit r18988.
2016-11-23 11:27:54 +00:00
b18f74da44 Remove trailing whitespace and whitespace in empty lines of source/ except source/third_party/.
This was SVN commit r18987.
2016-11-23 11:18:37 +00:00
948d2a4635 Clear particle emitters when ending a game so they don't leak into new games. Patch by Vladislav, fixes #4111.
This was SVN commit r18936.
2016-11-14 17:16:59 +00:00
ead8436b3d Improve water rendering, partly based on a patch by aeonios, including:
-increase the size of the refraction and reflection texture
-blur the refraction map depending on depth

Fixes #3781

This was SVN commit r18443.
2016-06-26 16:54:58 +00:00
7c21a0cf8e Header cleanup: profile.h is no longer unnecessarily included in scriptinterface.h but rather in the required .cpp files
This was SVN commit r18417.
2016-06-21 10:33:11 +00:00
1a66f510d0 Use const T& for parameters of some types in script-exposed native functions
Using references matches the C++ coding style better and should improve
performance a bit in theory. It avoids 2 copies of T in case of the
functions registered with RegisterFunction (mainy used in the GUI). It
should also avoid one or two copies in case of
DEFINE_INTERFACE_METHOD_X, which is used in the simulation, but I
haven't bothered to count it there exactly.
It is now predefined which types have to be passed by const reference
and which are passed by value. Note that references can't be used as
out-parameters (to return multiple values to JS). This hasn't worked
before either and probably never will.

This was SVN commit r17696.
2016-01-23 15:17:56 +00:00
fb92761c92 Use explicit types instead of auto.
This was SVN commit r17642.
2016-01-13 00:42:55 +00:00
543472b77b Optimization of isBoxVisible + cleanup, fixes #3712
This was SVN commit r17561.
2015-12-28 16:27:31 +00:00
814cdd9524 Tie tangent generation with preferGLSL setting for convenience since that setting was not really useful. Fixes #2506 . Patch by fabio.
This was SVN commit r17325.
2015-11-29 15:44:22 +00:00
432df9b38e Use two range based for loops to fix two TODOs.
This was SVN commit r17303.
2015-11-28 08:27:42 +00:00
9357cce112 Math is hard
This was SVN commit r17242.
2015-11-12 17:32:33 +00:00
52443dfe80 Fix an erroneous ENSURE in PatchRData and move it where it will be very slightly clearer. Fixes #3598
This was SVN commit r17240.
2015-11-12 17:22:44 +00:00
558d43bac5 Replace some functor structs with lambdas, closures or range-based fors.
This was SVN commit r16923.
2015-08-19 03:33:04 +00:00
8bfe16cac8 Use in-place construction.
This was SVN commit r16894.
2015-07-29 23:44:17 +00:00
c5eb9b7bb7 Range-based for for VfsPath loops.
This was SVN commit r16893.
2015-07-29 23:44:12 +00:00
da48c8c26f Some const refs and one const function.
This was SVN commit r16882.
2015-07-27 01:08:25 +00:00
6581796103 New long-range pathfinder.
Based on Philip's work located at
http://git.wildfiregames.com/gitweb/?p=0ad.git;a=shortlog;h=refs/heads/projects/philip/pathfinder
Includes code by wraitii, sanderd17 and kanetaka.

An updated version of docs/pathfinder.pdf describing the changes in
detail will be committed ASAP.

Running update-workspaces is needed after this change.

Fixes #1756.
Fixes #930, #1259, #2908, #2960, #3097
Refs #1200, #1914, #1942, #2568, #2132, #2563

This was SVN commit r16751.
2015-06-12 18:58:24 +00:00
14bfbbf9d4 Allow sprites to have color multiplication, which allows player-colored bars. Patch by Vladislav. Fixes #3233
This was SVN commit r16715.
2015-06-04 12:16:52 +00:00
e638af5422 Clean up some unused variables and assignments.
This was SVN commit r16684.
2015-05-26 15:40:07 +00:00
0a44d24c96 Flip the overlay sprites face around to show the non-mirrored side. Now sprites are rendered correctly (which should have happened in d4794b5474).
This was SVN commit r16617.
2015-05-03 15:55:17 +00:00
b6bcfdbb2e Fixes missing newlines in debug_printf, patch by elexis, fixes #3056
This was SVN commit r16534.
2015-04-12 19:38:31 +00:00
b1c4e29ac8 Fixes inconsistencies in spelling of colour/color by preferring "color" (only wxWidgets remains with some API that requires "colour"), fixes #1029.
NOTE: requires update-workspaces and may require correction of some
modded actors/scenarios

This was SVN commit r16438.
2015-03-15 23:59:48 +00:00
caf89fa04e Rename ps/Overlay(.h|.cpp) to ps/Shapes(.h|.cpp), fixes a TODO located in graphics/Overlay.h.
The file name did not match the content.

Also little cleanup of some unnecessary includes.

This was SVN commit r16431.
2015-03-15 18:06:32 +00:00
aab15123f1 I hate myself.
This was SVN commit r16389.
2015-02-28 14:11:21 +00:00
2d7d5b446d Fix Atlas so that changing water type will actually change water type.
Fix the water shader so that object reflections are more visible. Looks
better.

This was SVN commit r16388.
2015-02-28 13:50:52 +00:00
21f3be7df5 Always select a texture unit before calling glEnable(GL_TEXTURE_2D).
Without this, some code will enable (and set other parameters for)
whatever random texture unit the previous stage had selected. This can
break any fixed-function rendering, since either it will not have
enabled the correct texture unit, or its correct setup will be
interfered with by another texture unit that shouldn't be enabled. (This
doesn't affect ARB/GLSL shader rendering, since they don't care about
the enabled state, but the GUI (and some debug things) are still FFP in
the default ARB mode.)

Fixes #2833 (in which the fancy water shader selected texture units 5/6,
which then got enabled, and remained enabled forever).

This was SVN commit r16372.
2015-02-21 21:40:10 +00:00
70219ab61f Fixes GLSL terrain decal flicker by initializing normal vectors, fixes #2064
This was SVN commit r16349.
2015-02-17 08:13:24 +00:00
e06a7b37d8 Convert debug_printf to take UTF-8 strings instead of wchar_t.
This fixes the problem where passing a non-ASCII string to
debug_printf(L"%hs", s) caused vswprintf_s to fail on Linux (because it
doesn't know what encoding the char* is meant to have). Now debug
messages will remain as UTF-8 until they reach the OS.

Fixes #3021.

This was SVN commit r16332.
2015-02-14 01:45:13 +00:00
143e199d45 Add a new function to update the water renderer textures when resizing the renderer window. Patch by pendingchaos.
This fixes #2692 though the same issue might appear in some other cases
(possibly Atlas) and those will have to be checked.

This was SVN commit r16315.
2015-02-10 19:41:29 +00:00
bb99c42aa5 Increase max VBO size back to 4MB.
Some meshes (e.g. pers_gardens_struct with gentangents enabled) have
>32K vertexes, and won't fit in a 2MB VBO. 0ef6c7555e had reduced them
from 4MB to 2MB. So just make the VBOs bigger again, and try not to
worry about the waste of memory.

Fixes #3026, #3042.

This was SVN commit r16309.
2015-02-08 23:39:02 +00:00
0ef6c7555e Optimise VBO updates.
Some drivers (at least the Intel drivers on Windows) are slow at
incrementally updating a VBO with hundreds of calls to glBufferSubData
every frame. Performance is significantly better if you use
glBufferData(NULL) to tell it to discard all the previous contents, and
then re-upload all the data at once.

Update CVertexBuffer so that GL_DYNAMIC_DRAW/GL_STREAM_DRAW buffers are
handled with the new mechanism. This requires the caller to hold onto
the backing store so it can be re-uploaded when necessary, and needs a
bit more signalling to indicate exactly what needs uploading.

I see an improvement from roughly 60 to 75 fps on Intel HD Graphics
3000, Windows, 1024x768, Siwa Oasis.

This was SVN commit r16241.
2015-01-28 00:48:00 +00:00
a8499e89eb Pad vertex data to power-of-two sizes.
This reduces the total number of different vertex sizes in the system,
allowing more data to share a single CVertexBuffer, therefore reducing
the amount of wasted space in each CVertexBuffer and reducing VRAM
usage.

This was SVN commit r16230.
2015-01-25 15:38:51 +00:00
4c1903500b Switch to std::shared_ptr and std::weak_ptr.
This was SVN commit r16227.
2015-01-25 03:10:58 +00:00
f350a24c73 Disable "assignment operator could not be generated" warning globally on Windows, since it's never useful.
This was SVN commit r16192.
2015-01-22 21:09:33 +00:00
e02d7ad949 Automatically replace %hs/%ls with %s in CLogger format strings.
Everything is char* now, so we don't need to mess around with different
string types.

Done with:

  ag -ls 'LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR)' source | xargs perl
-pi -e'1 while
s/(LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR).*)%[hl]s/$1%s/g'

This was SVN commit r16187.
2015-01-22 20:36:24 +00:00
38a8e2e0d6 Automatically convert most path.string().c_str() to path.string8()
Done with:

  ag -l 'LOG.*string\(\).c_str\(\)' source | xargs perl -pi -e'1 while
s/(LOG.*string)\(\)\.c_str\(\)/${1}8()/g'

This was SVN commit r16186.
2015-01-22 20:35:17 +00:00
49e2ecea63 Automatically convert all CLogger format strings from wchar_t* to char*.
Done with:

  ag -ls 'LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR)' source | xargs sed
-i 's/LOG\(MESSAGE\|MESSAGERENDER\|WARNING\|ERROR\)(L/LOG\1(/g'

This was SVN commit r16183.
2015-01-22 20:31:30 +00:00
7a48606471 GLES compatibility for particle shader
This needs to use the model-view matrix, not model-view-projection (the
transform uniform), else the axes won't be unit vectors and the particle
sizes will be wrong. But GLES doesn't have the pre-defined matrices, so
pass it in explicitly.

This was SVN commit r16165.
2015-01-19 21:44:53 +00:00
9407dbe45e Remove useless parameter from CFG_GET_VALUE.
This was SVN commit r15984.
2014-11-17 23:29:49 +00:00
199eb46d86 Fixes GLES build
This was SVN commit r15914.
2014-10-29 02:36:42 +00:00
7f1fd01174 Moves some includes out of Renderer.h to slightly optimize compilation
This was SVN commit r15912.
2014-10-28 03:57:22 +00:00
e3e86e2a29 Fixes init of post processing effects, so they can be cleanly enabled/disabled at runtime. Fixes #2890, refs #2672, #2893.
Updates descriptions on options screen and fixes comment in default.cfg
(smoothlos does not require preferglsl)

This was SVN commit r15905.
2014-10-27 00:53:31 +00:00
5d9d9a67bf Allow enabling the post processing filters during a game.
Includes numerous code updates, also updated the copyright for
cd5de73f3a.

Patch by dan@sstrev.com, fixes #2672.

This was SVN commit r15843.
2014-10-05 20:50:10 +00:00
ea2db5386b Fixes water rendering and crashes on GPUs without FBO support, fixes #2667
This was SVN commit r15814.
2014-09-27 01:32:03 +00:00
fee304d789 Fixes crash from 41b98a6f12 where a VBChunk* was released but not set to NULL
This was SVN commit r15721.
2014-09-09 04:13:50 +00:00
41b98a6f12 Fixes incorrect reuse of a member variable in WaterManager, caused a crash when starting a new map in Atlas after loading a water map. Fixes #2784.
Fixes likely mem leaks from not cleaning up vertex buffer allocations

This was SVN commit r15715.
2014-09-07 23:49:24 +00:00
a4df483f60 Forgot to make a variable unused.
This was SVN commit r15631.
2014-08-13 14:52:38 +00:00
0b385384aa Fix terrain overlay rendering after water.
This was SVN commit r15628.
2014-08-12 15:58:03 +00:00
403b3b68af Fix some errors in WaterManager.
This was SVN commit r15620.
2014-08-06 15:24:38 +00:00
5ae040ea54 Fix non-PCH build.
This was SVN commit r15618.
2014-08-06 13:23:02 +00:00
4028cd425e Actually fix bugs on ATI cards. Switch reflection and refractions to use POT textures in an attempt to improve compatibility.
This was SVN commit r15598.
2014-08-02 12:54:45 +00:00
e50147fd96 Metaprogramming 9ce51f4357.
Change something on water shaders to see if it works better on ATI
cards.

This was SVN commit r15594.
2014-08-01 10:15:29 +00:00
9ce51f4357 Commit coastal waves when activating fancy effects, and incidentally completely change how this effect work. Refs #48.
This was SVN commit r15576.
2014-07-28 10:14:00 +00:00
17634d7507 Move the minimap to only use the shader pipeline. Should make it OpenGL ES compatible (untested).
This was SVN commit r15533.
2014-07-14 17:15:22 +00:00
8b45f453e5 Fix non-PCH build.
This was SVN commit r15498.
2014-07-06 16:35:41 +00:00
5571f7a7f9 Fix "Wind Angle" parameter not working properly. Add a precomputed "wind strength" variable so that waves look smaller behind islands. Some tweaks. Refs #48 as usual.
This was SVN commit r15492.
2014-07-05 10:20:30 +00:00
9d4665248b Check water FBOs creation correctly to detect some errors. Use two depth textures since I have a hunch the issues people encounter are caused by my using only one.
This was SVN commit r15488.
2014-07-04 10:14:35 +00:00
991d5bbd63 Fix random maps for my water changes. Fix the replay mode after I had broken it. Fix an occasional crash (that might have crashed Atlas, need someone to check).
Improve debugging slightly in case of framebuffer errors. Fix a few
style issues.

This was SVN commit r15486.
2014-07-04 09:03:21 +00:00
326290463e Further WIP water improvements. Add 3 different textures for different looks. Update some oasis maps for that. Streamline water settings (some removed, some added). Update Atlas for those (needs to be tested). Fix an issue with HQ water effects.
Please report any issue and/or crash. Those will get fixed in commits to
come. Refs #48.

This was SVN commit r15484.
2014-07-03 20:07:15 +00:00
eb7955599a Optimise silhouette rendering.
Do some intersection tests on the CPU so that the silhouette render
passes only have to draw models/patches that might actually contribute
to silhouettes, saving the CPU and GPU cost of rendering more objects
than necessary.

This was SVN commit r15483.
2014-07-03 01:00:25 +00:00
30e851ab90 Forward-declare CShaderProgramPtr, to avoid pulling in more headers than necessary and to hypothetically reduce build times by a minuscule amount.
This was SVN commit r15481.
2014-07-02 22:36:45 +00:00
f8d53d9a1d Clean up of the last commit.
This was SVN commit r15474.
2014-07-01 16:15:03 +00:00
ab30e0d4fb Change the water texture to a new, bigger one, created in Blender (thanks to Enrique). Change settings so that they are more logical, yet allow reverting back to an even lower quality setting. Add a WIP high setting (with foam) which isn't finished yet.
Change the shader itself so that the effects look nicer and are more
consistent across settings.
Rework the water mesh generation (simpler system). Fix a few issues.

May work oddly with Atlas since I haven't been able to compile yet.

Refs #1875 (maybe fix), Fixes #2077 (I'll assume it does), Fixes #2114
(assumption again), refs #48.

This was SVN commit r15473.
2014-07-01 16:05:05 +00:00
c626cf66f9 Fix build-osx-libs properly for mavericks after learning some Bash.
Fix a long-standing typo in TerrainRenderer for water rendering that
apparently had no effect.
Don't compress the water textures to make it look better. They will be
changed anyhow.

This was SVN commit r15461.
2014-06-28 08:54:59 +00:00
b1b96a89d6 Fix culling for shadows and reflections.
Previously we had a single culling frustum based on the main camera, and
any object outside the frustum would never get rendered, even if it
should actually contribute to shadows or reflections/refractions. This
caused ugly pop-in effects in the shadows and reflections while
scrolling.

Extend the renderer to support multiple cull groups, each with a
separate frustum and with separate lists of submitted objects, so that
shadows and reflections will render the correctly culled sets of
objects.

Update the shadow map generation to compute the (hopefully) correct
bounds and matrices for this new scheme.

Include terrain patches in the shadow bounds, so hills can cast shadows
correctly.

Remove the code that tried to render objects slightly outside the camera
frustum in order to reduce the pop-in effect, since that was a
workaround for the lack of a proper fix.

Remove the model/patch filtering code, which was used to cull objects
that were in the normal camera frustum but should be excluded from
reflections/refractions, since that's redundant now too.

Inline DistanceToPlane to save a few hundred usecs per frame inside
CCmpUnitRenderer::RenderSubmit.

Fixes #504, #579.

This was SVN commit r15445.
2014-06-25 01:11:10 +00:00
fe3315376c Add BoundingSphere, SOverlaySphere.
BoundingSphere is similar to a bounding box, but more spherical.

SOverlaySphere is useful for visualising BoundingSphere (it's quite
inefficient and should only be used for debug functionality).

Normalise the camera frustum clipping planes, so that IsSphereVisible
gives the correct result.

This was SVN commit r15261.
2014-06-01 18:05:46 +00:00
85a1f880ab Fix compatibility with LLVM libc++ (used on OS X).
libc++ vector asserts that allocator::value_type is correct, so we have
to pass in the correct types.

This was SVN commit r15231.
2014-05-26 16:48:28 +00:00
6407b593d6 Make displayFrustum controllable from scripts.
This was SVN commit r15225.
2014-05-26 13:42:32 +00:00
683170ea19 Enable/disable GenTangents when enabling/disabling PreferGLSL. Fixes #2505.
This was SVN commit r15061.
2014-04-28 22:30:27 +00:00
9a809c3131 Revert overlay resizing (forgot about translations) and minor fixes to my last changes.
This was SVN commit r15010.
2014-04-26 19:52:56 +00:00