1
0
forked from 0ad/0ad
Commit Graph

95 Commits

Author SHA1 Message Date
62e589ab76 Adds renderer backend interface and dummy backend.
Comments By: phosit, Stan
Tested By: Langbart, phosit
Differential Revision: https://code.wildfiregames.com/D4636
This was SVN commit r26858.
2022-05-08 22:02:46 +00:00
3ed4eaf247 Removes ogl_WarnIfError from regular renderer code.
This was SVN commit r26850.
2022-05-02 21:52:21 +00:00
04bd96cee0 Moves uniform and texture binding to CDeviceCommandContext.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D4631
This was SVN commit r26848.
2022-05-02 20:57:22 +00:00
aba7a170d9 Moves vertex attribute binding to CDeviceCommandContext.
Tested By: Langbart, Stan
Differential Revision: https://code.wildfiregames.com/D4610
This was SVN commit r26815.
2022-04-23 20:11:14 +00:00
a57581471d Reduces the number of uniform changes in decals rendering and the number of render queries in models.
This was SVN commit r26688.
2022-03-20 16:08:19 +00:00
37b30901b3 Removes C++ code for conditional defines removed in f29d059617.
Differential Revision: https://code.wildfiregames.com/D4551
This was SVN commit r26661.
2022-03-15 22:13:22 +00:00
b4253d48cb Moves CShaderProgram to backend and handling via CDeviceCommandContext.
Differential Revision: https://code.wildfiregames.com/D4548
This was SVN commit r26652.
2022-03-14 22:16:14 +00:00
db7894ff6b Removes redundant binding slot retrieving from CShaderProgram.
This was SVN commit r26585.
2022-03-06 21:17:24 +00:00
cff79b421a Moves GL vertex and index buffer management to CDeviceCommandContext.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4493
This was SVN commit r26406.
2022-02-18 17:33:12 +00:00
4de89c3db1 Moves texture management to CDeviceCommandContext, adds quality options.
Comments By: nwtour, Stan
Tested By: nwtour, Stan
Differential Revision: https://code.wildfiregames.com/D4488
This was SVN commit r26365.
2022-02-13 19:30:28 +00:00
5adbe4f1a3 Moves blend state management to DeviceCommandContext. Fixes #6420
Tested By: Langbart
Comments By: Stan
Differential Revision: https://code.wildfiregames.com/D4441
This was SVN commit r26228.
2022-01-19 17:28:47 +00:00
87b5c233c5 Splits CRenderer part about scene to CSceneRenderer.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4412
This was SVN commit r26165.
2022-01-04 13:29:01 +00:00
4fba543488 Unifies providing SkyManager and WaterManager like other managers, refs b889826a3d.
This was SVN commit r26158.
2022-01-03 10:49:12 +00:00
92cf0c784c Removes Handle from ShaderProgram to use more high-level objects.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4403
This was SVN commit r26138.
2021-12-29 07:07:08 +00:00
3809457513 Replaces unclear PreferGLSL by direct renderer backend choice.
Commented By: Stan
Differential Revision: https://code.wildfiregames.com/D4363
This was SVN commit r26069.
2021-12-14 06:34:02 +00:00
fe81a6eec7 Refactors WaterManager to remove duplication of the current texture index calculation. Removes unused m_WaterCurrentTex from f2cae8cb9b.
This was SVN commit r26045.
2021-12-09 18:01:28 +00:00
3b417062bb Reduces the number of possible allocations for models with multiple UV sets during loading.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4247
This was SVN commit r25890.
2021-09-03 20:11:52 +00:00
0c23e595fa Include CStrInternStatic where necessary only.
This makes incremental recompilation faster when changing static
interned strings.

Differential Revision: https://code.wildfiregames.com/D3975
This was SVN commit r25457.
2021-05-18 11:09:54 +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
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
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
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
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
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
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
4c1903500b Switch to std::shared_ptr and std::weak_ptr.
This was SVN commit r16227.
2015-01-25 03:10:58 +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
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
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
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
e700937fd3 Fix non-SSE x86 builds
This was SVN commit r13934.
2013-10-03 18:22:10 +00:00
e24ce51029 Adds DynamicArena allocator that grows by fixed chunk size, fixes #2142.
Changes fixed size arenas to new dynamic arenas with reasonable chunk
sizes (may require tuning), refs #1842

This was SVN commit r13916.
2013-09-30 01:22:44 +00:00
c2583e42da Reduce memory allocations in the renderer
Use an arena allocator in ShaderModelRenderer::Render, to reduce
the allocation cost in STL containers.

Avoid unnecessary copying of std::vectors.

This was SVN commit r13911.
2013-09-29 14:48:11 +00:00
994ebd9836 Add a list of statically-constructed CStrIntern strings
Switch all the constant strings in graphics code to use the new
variables.
This avoids the cost of instantiating CStrInterns at runtime every
frame.

This was SVN commit r13906.
2013-09-29 13:19:52 +00:00
4e9570cd0f Fix unnecessary CShaderConditionalDefines copy, and inline some functions
This was SVN commit r13904.
2013-09-29 02:05:02 +00:00
555deea136 Fix conditional defines to not construct new CShaderDefines frequently
CShaderDefines is designed to be efficient to copy and compare, but not
to construct. Conditional defines were constructing new CShaderDefines
for many models every frame.

Precompute all the possible conditional combinations of CShaderDefines
when a material is first loaded, so they can be looked up at no cost
when rendering.

This was SVN commit r13902.
2013-09-29 00:30:58 +00:00
367c67d6ad GPU-skinned tangent-space effects for non-instanced units, plus a bit of cleanup.
This was SVN commit r12795.
2012-10-29 13:20:21 +00:00
11b1c59397 A minor change to water rendering on models.
This was SVN commit r12677.
2012-09-16 11:39:04 +00:00
779a33ee30 Water and waterfall shaders, materials and examples.
This was SVN commit r12643.
2012-09-08 18:56:13 +00:00
3efb235725 And re-enabling the stuff disabled for debugging 2
This was SVN commit r12632.
2012-09-04 17:30:01 +00:00
10101b138d And re-enabling the stuff disabled for debugging
This was SVN commit r12631.
2012-09-04 16:59:03 +00:00
8b10290f78 Disabling some LOD stuff to track down Deiz's bug (as a result, parallax also temporarily disabled)
This was SVN commit r12629.
2012-09-04 15:55:36 +00:00
1ba858bf6e More on that bug (warning: renderer temporarily slower)
This was SVN commit r12628.
2012-09-04 12:34:02 +00:00