Commit Graph

1172 Commits

Author SHA1 Message Date
Vladislav Belov 46af67b5bd Removes RenderPath
We can render the game only with shaders so we don't need to support
fixed function pipeline as a separate render path. We only need to know
when to warn a user.

Fixes #6244
2026-07-07 23:12:45 +02:00
Vladislav Belov 0538e95793 Makes GameView::GetCamera constant 2026-06-28 17:57:26 +02:00
Vladislav Belov e0d131854d Makes GameView returning reference on camera 2026-06-28 17:57:16 +02:00
Vladislav Belov 0cc07aa209 Removes legacy glEnable of GL_TEXTURE_2D
It needs to bo enabled only for fixed-function pipeline.

https://registry.khronos.org/OpenGL-Refpages/gl2.1/

> If enabled and no fragment shader is active, two-dimensional texturing is performed
2026-06-28 15:56:33 +02:00
Ralph Sennhauser 4967922447 Don't load WGL
Depend on SDL and wxWidgets doing the necessary work.

Also remove WGL from glad.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-28 09:49:26 +02:00
Ralph Sennhauser c5a9d18cfa Drop use of GLX and EGL
Only used for hw-report and only when using GLX which is for X11 only.
The usefulness of those reported properties is questionable and X11 is
becoming rarer.

This allows us to drop a direct dependency on X11 delegating the
handling to SDL and wxWidgets respectively GTK.

Further SDL3 wont expose supported video driver at compile time making
this step more meaningful.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-28 09:49:26 +02:00
Ralph Sennhauser 08cd7e9096 Drop vsync workaround for wxWidgets
wxWidgets already sets it's prefered mode.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-28 09:49:25 +02:00
Vladislav Belov 1709149740 Adds instancing to particles
We use instancing to provide dynamic data for particle only once and not
for each vertex.
2026-06-22 23:18:29 +02:00
vyordan ec8b420abc Move Script* classes to Script namespace
- Rename ScriptEngine, ScriptContext, ScriptInterface, ScriptRequest to
  Script::Engine, Script::Context, Script::Interface, Script::Request
- Remove 'Script' prefix from filenames:
  ScriptContext.* → Context.*
  ScriptInterface.* → Interface.*
  ScriptRequest.* → Request.*
  ScriptEngine.* → Engine.*
  ScriptConversions.* → Conversions.*
  ScriptExceptions.* → Exceptions.*
  ScriptForward.* → ForwardDeclarations.*
  ScriptStats.* → Stats.*
- Update all includes, forward declarations, and friend classes
- Use namespace Script { ... } in .cpp definitions to avoid repetitive
  Script:: prefix (keeping global callbacks outside)
- Rename internal implementation structs:
  ScriptInterface_impl → Interface_impl
  ScriptFunction → Function
- Update copyright year to 2026 in all touched files
- Suppress pre-existing cppcheck warnings (uninitvar, nullPointer, unknown
  macro) by adding them to suppressions-list.txt (these are not caused
  by this refactor)

Fixes #7516
2026-06-20 17:43:00 +02:00
Vladislav Belov d23f9e1da3 Adds a storage check for resolve PBR shader
We need to check for storage support because we outpout result into a
storage. Note: it seems we might have a bug inside GL backend or inside
Mesa drivers which prevents us from running resolve on compute.
2026-06-20 13:29:14 +02:00
Vladislav Belov 7a19f38070 Allows floating point textures based on extension 2026-06-20 13:29:13 +02:00
Vladislav Belov f72c0c1c09 Enables fragment PBR resolve shader in PostProc 2026-06-20 13:29:11 +02:00
phosit 596c0c2ddd Split screenshot from main input handler
This enables the screenshot hotkeys in atlas.
2026-06-19 20:53:52 +02:00
Vladislav Belov 4259c78150 Removes unused Get/SetDepthTextureBits methods
Methods were added in f903b83674.
Methods became unused in 12e2428495.
2026-06-15 00:35:04 +02:00
Vladislav Belov 7607d6bdd8 Decouples acquire/present from SubmitScheduler
SubmitScheduler doesn't have to know anything about Acquire/Present as
its responsibility to schedule and submit command buffers to a queue.
2026-06-08 18:27:10 +02:00
Vladislav Belov 07e5ad5b23 Fixes acquire and submit semaphores syncronization
I forgot to finish CSubmitScheduler synchronization in
7c84c23114. Even ++m_FrameID was
forgotten. And it worked at the time. A proper synchronization is
described in renderer/backend/Vulkan/SwapChain.h.
2026-06-08 18:27:08 +02:00
Vladislav Belov 4d83aa28e5 Uses SwapChain instead of direct Device calls 2026-06-08 18:27:06 +02:00
Vladislav Belov cf4a4d8fd5 Adds SwapChain as an explicit DeviceObject
It allows us more flexibility on how we control swapchain. That includes
toggling V-Sync in real time.
2026-06-08 18:26:58 +02:00
Ralph Sennhauser 0c0552a428 Replace M_PI with C++ numbers
C++20 added π (pi) to the standard, replace the C macro globally.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2026-06-04 20:29:48 +02:00
Vladislav Belov 1250ca1dac Replaces FALLTHROUGH macro by attribute
It was forgotten during removing the FALLTHROUGH macro in
b41ca5ad78.
2026-05-22 23:25:31 +02:00
Vladislav Belov a0ecfbaa33 Skips UNIFORM buffers for GLES
Currently we don't support UNIFORM buffers for GLES.

Refs 54701868da
2026-05-22 23:14:30 +02:00
Vladislav Belov 18a16aa135 Moves all rendering to material passes
Now we should use material passes instead of context and defines to
select a needed shader. It allows us to reduce the number of
shader combinations we use and reduce memory consumption.
2026-05-10 23:57:20 +02:00
Vladislav Belov 9aee507e28 Adds wireframe techniques for particle and terrain 2026-05-10 23:57:12 +02:00
Vladislav Belov 75bd640bd8 Removes context of terrain shadows and silhouettes
We were unnecessary passing all combinations of our scene shader context
even if we don't need it as for shadows and silhouettes for terrain
rendering. Since we only need to draw a solid color.
2026-05-10 23:56:57 +02:00
Vladislav Belov 58d3527130 Adds profile table for renderer backend statistics 2026-05-10 19:26:16 +02:00
Vladislav Belov 2e87f6b5aa Adds renderer backend-specific statistics
Different backend have different metrics to watch and debug. So we need
a simple way to collect that.
2026-05-10 19:26:16 +02:00
Vladislav Belov a7967d4ad9 Adds PBR output texture to PostProc 2026-04-29 19:25:14 +02:00
Vladislav Belov 1a277269d3 Adds floating point textures to backends
R8G8B8A8_UNORM isn't enough to store HDR data as the scene can brighter
than 1.0 especially when looking into sun speculars.
2026-04-29 19:25:11 +02:00
Vladislav Belov c4fb0eed3a Adds slider to developer overlay
Also adds PBR config values. Refs #8535
2026-04-29 19:25:03 +02:00
Vladislav Belov 456e2a0b56 Removes dummy GL functions as replaced by core 2026-04-25 17:47:06 +02:00
Vladislav Belov dd9124ae99 Fixes Vulkan uniform buffer size after 9e371824c2
32 was accidentally added during debugging.
2026-04-25 11:55:12 +02:00
Vladislav Belov cb1fe07540 Removes GetDeviceCommandContext call from CFont
We need remove all occurences of GetDeviceCommandContext to be able to
add multithreading support in the future.
2026-04-10 23:53:23 +02:00
Vantha 1d3cdec48d Move cutscene mode to renderer
This patch splits "cutscene mode" (disabling silhouttes, territory
borders and other visual overlays) from the cinema manager component
and moves it to the renderer, since it doesn't influence the simulation
anyway. The mode can now be independently controlled by the GUI. This
is done so it can also be used for other narrative elements like speech
or dialogue in the future. Cutscene mode is still always enabled while
cinema paths are playing, though.
By design, this also fixes the issue that range overlays weren't hidden
during cutscene mode.
2026-03-03 11:25:52 +01:00
Vladislav Belov aae957ec7b Adds fixed orientation to particles
New features:

* Relative position
* Relative and absolute fixed axis
* Local space
* Axis along velocity vector
2026-02-20 22:46:49 +01:00
Vladislav Belov 0432b86de7 Removes ARB (legacy OpenGL) backend
ARB is a legacy backend which uses old assembly shaders. It makes
writing shaders more complex. According to the stats
https://feedback.wildfiregames.com we small amount of players with
ARB.

Fixes #8533
2026-02-20 22:07:38 +01:00
phosit df18e22277 Remove Script::CreateArray
It's better to construct a js-array from a `JS::RootedValueVector`.
Because it is more strongly typed and the index doesn't has to be
specified when appending an element.
Some usages are replaced with `JS::RootedValueArray`.

Fixes: #8702
2026-02-08 19:27:50 +01:00
Vladislav Belov cce01f4d6c Fixes compilation after #8621
Fixes #8685
2026-01-25 16:29:16 +01:00
Chrzanof 5daae13525 Pass device command context by reference in DebugRenderer
Improve the DebugRenderer API by passing the IDeviceCommandContext
as a reference instead of calling g_Renderer.

Fixes: #6650
2026-01-24 11:54:01 +01:00
Vladislav Belov f43e98da09 Fixes uninitialized GPUSkinning in Atlas
Currently CRenderingOptions are initialized only once on the application
start. It means changed m_GPUSkinning wasn't reset on the switch to Atlas.

Fixes #8596
2025-12-27 21:02:48 +01:00
Vladislav Belov c0ea17f06e Replaces choosedDeviceIt by chosenDeviceIt 2025-11-11 01:51:16 +01:00
Vladislav Belov 485200342d Disables Vulkan devices sorting by default
Currently we always choose the best device. But it's not always
desirable. A more safe approach is to use the default device (with
index 0). The only downside of that is if a user didn't adjust
settings then the game might run on an integrated GPU instead of a
discrete one. In the future it'll be solved by selecting GPU in
options: #8529

Fixes #8455
2025-11-11 01:50:58 +01:00
Vladislav Belov c4bc6c9627 Adds an option to destroy Vulkan old swapchain before
Now it's possible to destroy the old swapchain before creating a new
one. It might make the swapchain creation a bit slower but with a
lower memory peak.
2025-11-10 00:06:52 +01:00
Vladislav Belov 8a64182ca2 Waits Vulkan device idle also on window resize
Fixes the case when a swapchain was recreated on resize rather than
by VK_ERROR_OUT_OF_DATE_KHR.
2025-11-10 00:06:51 +01:00
Vladislav Belov de36c75023 Deletes Vulkan resources on swapchain recreation
The change tries to minimize a memory peak during a window resizing.

Refs #6864
2025-11-10 00:06:41 +01:00
Vladislav Belov 8b1b1d28f8 Fixes missing Vulkan application version
Missing after dc830ccf55.
2025-11-09 12:58:16 +01:00
Vladislav Belov e8d9a8db67 Adds Vulkan timestamp limits to report 2025-10-16 00:36:02 +02:00
Vladislav Belov f2752f7230 Removes ARBShader capability 2025-10-14 13:04:16 +02:00
Vladislav Belov 893f192eaa Makes TextRenderer allocates using LinearAllocator
Also replaces DynamicArena for model and terrain rendering by
LinearAllocator.
2025-10-12 00:53:12 +02:00
Vladislav Belov 3ffb5ec5a0 Removes USE_FOG define and switches to a shader parameter.
Refs #8385
2025-10-11 08:11:35 +02:00
Vladislav Belov 199f4cb666 Fixes uninitialized water textures.
Fixes #8052
2025-10-05 14:13:49 +02:00