Commit Graph

769 Commits (master)

Author SHA1 Message Date
Webster Sheets 37deea46c5 Fix (and document) depth linearization 2021-03-27 00:32:41 -04:00
Karl F 9e44b09314 Happy new year!
HAPPY MERRY 2021!
2021-01-03 19:40:16 +01:00
Webster Sheets 5d5c18738a Fix minor issues
Fix error when savefiles directory doesn't exist
Fix persistent selection state in commodity market
Don't regenerate hyperspace cache until arrival
Fix mipmap generation to restore heat texture
2020-12-02 00:27:29 -05:00
Webster Sheets a41a011069 Better profiling and optimization
- Optimize GeomTree in Debug so the game isn't horribly slow
- Don't profile tight inner loops
- Report BeginFrame/EndFrame timings
2020-11-25 13:57:52 -05:00
Webster Sheets 1e5e1d3a62 Improve ModelViewer
- Split up the workspace better
- Add checkboxes to display model tags et. al.
- Add a tag name+location display
- Sane defaults for which animation is selected; remove the 'None' option
- Fix an issue with escape_pod.model having the wrong material name.
2020-11-15 16:05:06 -05:00
Webster Sheets 5c957eae97 Fix foward angle indicator
Now properly points to the front of the craft
Also added a proper screen-space depth linearization function to WorldView.cpp
2020-11-14 03:35:22 -05:00
Webster Sheets 4a7167cf17 Fix render target creation not resetting state 2020-11-03 14:04:41 -05:00
Webster Sheets e45dd8dbbb Support GL_NV_depth_buffer_float extension
Allows older cards without support for GL_ARB_clip_control to use the reverse-Z buffer
Introduced a ResetDepthRange function to allow SectorView to clean up after itself.
2020-11-03 14:04:41 -05:00
Andrew Copland ac68a2ed19 Rename View to PiGuiView to avoid filename conflict
Fixes a type shortening warning in HashRenderStateDesc

Filename should match internal class wherever possible

Fix copyright symbol and clang-format

Update copyright symbol to use UTF-8 \u00A9 symbol
Fix PerspectiveFrustum matrix constructor to work in reverse-Z order
Fix clang-format wanting to re-order an enum that's supposed to map to OpenGL enums
2020-10-22 16:39:01 -04:00
Webster Sheets d3fd88a9ec Add Graphics::ProjectToScreen
This is intended to replace Gui::Screen::Project in 90% of cases
It's a much better function to use especially in the case of a resizing screen.
Rewrite part of SystemView to take advantage of this function.

Fix directional indicators not screen-culling
2020-10-22 16:38:34 -04:00
Webster Sheets dea84d1de0 Use Reverse-Z depth buffer
Converts clip space from -1..1 to 0..1, and maps 1.0 to the near plane to symmetrize floating point precision
This means we can entirely drop the logZ hack and use the early-Z depth test.
Also add (and comment) several projection matrix functions.
2020-10-22 16:38:34 -04:00
Webster Sheets 647a8c8da5 Switch to using offscreen buffer as default RT
This is required for later postprocessing work
It also lays the groundwork for 32-bit reverse-Z depth buffer
2020-10-15 01:22:11 -04:00
Webster Sheets 4d3fcb5b84 Deprecate matrix4x4d renderer methods, add better Viewport handling 2020-09-07 15:31:15 -04:00
Webster Sheets 0d1cca4cd1 Remove matrix4x4ftod and its ilk
Replace all instances of the manual conversion with an explicit conversion constructor.
2020-09-07 15:31:15 -04:00
Webster Sheets e83dd6c887 Matrix state must(did!) die
Remove all OpenGL 2.x like methods from the renderer API, now the matrix state
is the responsibility of the caller via MatrixTicket / StateTicket.

Still TODO is improving the viewport state tracking, although that should be
rather simple to fix.
2020-09-07 15:31:15 -04:00
Webster Sheets 753b36a9b2 Apply clang-format changes 2020-08-31 22:03:42 -04:00
Webster Sheets 2d9531d3d7 Add more profiling points
Better profile the startup phase, add profiling to Sound.cpp
2020-08-31 21:06:04 -04:00
Webster Sheets 126b36419a Cleanup warnings and diagnostic pragmas
- Remove a number of unused variables
- Clean up a few assertions checking if an unsigned variable might be negative
- Consolidate miniz diagnostics into the miniz header
- Make sure lookup3.c doesn't throw unused variable warnings
2020-08-16 01:22:52 -04:00
Webster Sheets de88ea05b5 Final SectorView improvements
- Change view movement mode to XY-constrained planar movement
- Rename map movement axes, invert key bindings for consistency
- Fix axis colorations in Drawables::Axes3D
2020-06-23 18:56:33 -04:00
Webster Sheets 36e1e5394b Add better logging framework
- Shim Error, Warning and Output to the new log framework
- Add multiple non-error log levels, and a non-fatal error log level
- Use fmt::fmt to format args instead of snprintf, avoid using variadics
- Remove the (no-op) OpenGLDebugMsg function
2020-05-15 16:39:37 -04:00
Webster Sheets c06a2ac306 Further improvements to performance tracking
- PerfInfo window can be opened from options menu
- Performance window is available regardless of WITH_DEVKEYS
- Cleaned up some output messages
- Added a Perf::Stats instance to Galaxy
Might get merged with another more general instance depending upon usage patterns.
2020-05-15 16:36:40 -04:00
Webster Sheets 8076a7b767 Move several classes to core module
This is primarily to make tool development easier - right now the only
way to build a tool without linking all 90MB+ of pioneer binary into the
tool is to cherry-pick a set of cpp files and hope you have all the
symbols you need for what you're doing.

Over time, "generic" functionality like compression, math, etc. will be
moved to the core module so tools can link against one library without
incurring lengthy link and compile times.
2020-05-15 16:36:14 -04:00
Edoardo Morandi a786ca8782 Address some issues 2020-04-29 11:33:00 +02:00
Edoardo Morandi 5fc0f96437 Address some issues 2020-04-28 21:56:33 +02:00
Edoardo Morandi e6b9cd8d71 Remove many warnings 2020-04-25 01:31:42 +02:00
Webster Sheets 0c67f400c9 Clean up header dependencies
A lot of source files were depending on utils.h being included by other headers
Cleaned up code that was depending on Input.h being included in Pi.h
2020-03-27 16:45:17 -04:00
Webster Sheets 8990fbeb96 Add Input::SetCapturingMouse()
Moved mouse capture functionality from the renderer to Input
Temporarily patched ModelViewer, pending a major refactor to make it compatible with the input class.
2020-03-24 13:03:23 -04:00
Webster Sheets f2956c5efc Add Texture VRAM size tracking
Only works for DDS textures at the moment, needs better calculations for auto-generated mipmap sizes
Added six new stats to track the number and memory usage of textures in the cache
2020-03-13 14:06:52 -04:00
Webster Sheets 8d6a84d70c Expose read-only access to the texture cache
Required for a few things, most notably debug tooling to visualize the cache
2020-03-13 14:06:52 -04:00
Webster Sheets 99388c8c52 Formatting updates to TextureGL.cpp 2020-03-13 14:06:52 -04:00
Webster Sheets cb1b100728 Properly handle DDS mipmaps below 16x16
- Get rid of MIN_COMPRESSED_TEXTURE_DIMENSION
- Still a little work needed to handle non-power-of-two textures
- Also updated Texture::BuildMipmaps() to only regenerate mipmaps without valid data.
- Some work still needed to properly calculate mip levels for uncompressed textures when creating the texture
2020-03-13 14:06:52 -04:00
Webster Sheets 43159624a3 Update pigui image code for new TextureBuilder changes.
Use an explicit return constructor to appease VS
2020-03-13 14:06:49 -04:00
Andrew Copland d29cdd1437 Add basic texture array support
Add TextureBuilder overloads for array textures
2020-03-13 14:06:37 -04:00
Webster Sheets 6431134310 ImGui performance display, new PerfStats impl
- Rewrote the Ctrl+i performance display using ImGui
- Added a new generic performance counter implementation using atomics
- Added physics- and frame-time display to performance info
- Rewrote Graphics::Stats to use the new PerfStats impl internally
2020-02-24 16:55:26 -05:00
Karl F 436db08636 Happy new decade!
May you live long and prosper!
2020-01-01 10:47:46 +01:00
Webster Sheets 2e8376523e Promote FrameId to wrapper and fix crash, remove unused test (#4745)
* Make FrameId a wrapper over an int, fix crashes

- Cleanup some of the tests, use <cstddef>.
- Fixed a crash in Frame::DeleteCameraFrame()
- Made CameraContext::GetCamFrame() return the invalid frame index when there
  is no camera frame
- Fixed a typo related to autosave
2019-11-26 09:26:59 +01:00
John Bartholomew 98e7ccaa83 Fix Graphics::OGL::InstanceBuffer::m_data unique_ptr type.
Found by valgrind.
Must match array with array.
2019-11-17 21:02:50 +00:00
John Bartholomew 81b0ae22dd Fix hash of uninitialized (padding) bytes in RendererOGL::CreateRenderState
Read of uninitialized memory found by valgrind.
Directly hashing the bytes that make up some arbitrary
not-specially-constructed struct tends to result in feeding uninitialised
bytes with arbitrary values into the hash function due to padding of
the struct.
2019-11-17 20:56:03 +00:00
Andrew Copland f2a0fd8ed0 Don't profile a function that is deliberately ignored during profiling 2019-11-17 11:39:21 +00:00
mike-f1 e6403fc1ad Decouple includes; Remove some unused variable; Fix an equation in Space.cpp 2019-10-20 11:19:45 +02:00
Andrew Copland 2a14158c85 Profile face generation 2019-10-13 17:18:16 +01:00
Andrew Copland 8249c5c61b HACK, old SGM files have trailing '\0' de-serialised sometimes. Pop it off if it's there. 2019-07-21 13:41:38 +01:00
mike-f1 d3acb0497a Decouple 'AtmosphereParameters' from SystemBody, thus from graphics* and terrain* 2019-05-27 19:47:21 +02:00
mike-f1 75956b9fd0 Decouple includes of Sfx.* and trade dependency from Ship with dependency from ModelBody
Forward declare Space in Ship.h; Make things compiling again

Decouple WorldView.h; Some other decouple here and there

Decouple Renderer no more included in RenderState; Model not including directly its childs
2019-05-21 17:50:50 +02:00
Webster Sheets 2e0115a01a Remove the (unmaintained) Autotools build method. (#4511)
* Remove the autotools build system.
2019-05-18 15:35:06 +02:00
Andrew Copland 4afa5b3c10 Detail mapping is mandatory! 2019-03-03 11:40:58 +00:00
mike-f1 9a3d0cb28b clang formatting 2019-02-15 22:55:16 +01:00
mike-f1 1de66bf587 Include decouple, second round 2019-02-15 21:57:17 +01:00
Webster Sheets 5cdaefad6a Run clang-format over the entire code base.
Fix hidden header-inclusion-order dependency errors.
Update .clang-format for v7.0.1.
2019-01-05 17:09:05 -05:00
orbea e83b0c04ea Fix modelcompiler crash when opengl.txt doesn't exist.
This crash is reproduced during the build when ran with sandbox.

Further fixes https://github.com/pioneerspacesim/pioneer/issues/4506
2019-01-03 17:25:35 -08:00