Commit Graph
73 Commits
Author SHA1 Message Date
asarium 9da5cc17a3 Add type safe handle for graphics buffers
This converts the previous plain-int type for a buffer handle to an
instance of our ID class which provides type safety.
2020-10-25 12:16:05 +01:00
plieblang 3dbe27e772 Clean up map::iterator usage 2019-05-24 13:43:04 -07:00
asarium ad1ede7b74 Add new options system
This is a system for storing arbitrary data in the config file and then
easily retrieving it later on. This has full Lua support for exposing
the available options in a custom UI and changing the values of the
options. This ported some of the existing command line options over to
the new system which is opt-in for the moment by using a mod_table flag.
2019-03-02 14:02:21 +01:00
asarium eeed22b91a Enable misc-unused-parameters
clang-tidy was used for fixing the warnings. It is not clear if this is
actually an improvement so this may still be disabled later.
2018-04-25 11:57:55 +02:00
asarium 48873185ce Another batch of misc- checks 2018-04-25 11:13:20 +02:00
asarium f8d0a9bc7d Remove most remaining OpenGL header includes 2017-08-18 17:53:23 +02:00
asarium 833df59d0e Remove GLSL version checks that are always true
These checks were from a time when we supported lower OpenGL version
than 3.2. Since we don't do that anymore and show an error if the
drivers don't support that, these conditions always evaluated to true
and could be removed.
2017-02-02 22:35:03 +01:00
asarium 3fcb731621 Refactor shader handling
This fixes a few of the bad design descisions of previous shader
iterations. This uses a dedicated class for managing the resources and
uniform locations of a shader program.

Uniforms are also stored in this object which makes a lot more sense
than storing them in the OpenGL state where they had to be reset every
time a new shader was used.

There are still a lot of possible enhancments to make, e.g. by using
uniform blocks and buffers instead of standard uniforms which would make
uniform location handling easier.

Another optimization that I will investigate is reducing the amount or
different compiled shaders by turning some of the current compile-time
defines into bool uniforms.
2016-08-29 12:38:38 +02:00
SamuelCho ba826df963 Removed a bunch of unused rendering code. 2016-08-28 18:47:34 -07:00
asarium 1f1d6ceecf Remove extensions that are included in OpenGL Core 2016-08-20 21:43:48 +02:00
SamuelCho 2022f6a792 Replaced GLAD loader with 4.1 Core specification. Removed traces of fixed function rendering code. 2016-08-19 02:12:47 -07:00
SamuelCho a481999a24 OpenGL Core support. Introduction of material based draw system. Rewrote geometry batcher. 2016-08-17 00:13:19 -07:00
asarium c40ede030a Another batch of 64-bit warning fixes. 2016-08-11 22:19:50 +02:00
m!m 22c0255277 Fix a bunch of 64-bit MSVC warnings (#709)
* Fix a bunch of 64-bit warnings

* Fix Linux compilation error

* Fix Mac error

* Fix some issues

* Fix more GCC warnings

* Remote unwanted change

* Remove accidentally readded file

* Fix wrong limit check

* Use BEAM_INDEX macro for getting beam object index

* Fix 32-bit warning

* Use BEAM_INDEX instead of pointer arithmetic
2016-08-09 11:08:54 -07:00
asarium 16be3b7cc5 Add support for TrueType fonts
This allows to use standard TrueType Fonts for text rendering in FSO. It uses the NanoVG library which provides the ability of drawing 2D shapes. This library is used for most 2D operations now and can also be used directly by using the PathRenderer class.
2016-08-02 10:57:28 +02:00
SamuelCho dd73d8fb63 New lighting model based off of Blinn-Phong and Fresnel-Shlick. Introduced -reflect maps. New gloss parameters for specular power. High dynamic range rendering. Improved bloom pass. 2016-07-05 23:15:08 -07:00
Echelon9 e4c98e8527 Remove final DirectX Shader Model concepts. OpenGL GLSL version supported by the driver can be directly queried, rather than a layer of abstraction through SM2, SM3 and SM4. Allows Use_GLSL to be removed following refactoring. 2016-01-03 16:33:04 -05:00
The E e0defd287a Renaming vm_vec_crossprod to vm_vec_cross 2015-12-01 20:36:34 +01:00
asarium a6e93c7d46 Fix another braces warning 2015-08-19 11:26:30 +02:00
asarium fc3166ac52 Fix suggest braces around initialization of subobject warning 2015-08-19 11:26:30 +02:00
Echelon9 c5493bb480 Scripted sort and uniq on (internal) project includes. Improves search time and as a by product removed a number of duplicative includes. 2015-06-22 20:24:30 +10:00
niffiwan 3859d16640 Fix Coverity 1298258: Uninitialized scalar var
Also fixes 1298256, 1298254, 1298253

For vertex vars use default value-initialisation to zero the struct
http://en.cppreference.com/w/cpp/language/value_initialization

Note that parts of vertex don't seem used in relevant codepaths, e.g.
the colours. A zero init approach should be safer should code change in
future.
2015-05-16 12:44:56 +10:00
SamuelCho 90c8025588 Code cleanup before the big soft shadows and deferred lighting merge into master. 2015-05-08 21:55:28 -07:00
SamuelCho 520b89408e Fixed warnings related to graphics code additions. 2015-05-08 21:21:20 -07:00
Swifty c620372357 Soft shadows, deferred lighting, and various major graphics optimizations. 2015-05-02 14:35:37 -07:00
Echelon9 2859e74ac9 Address clang warning: extra ';' after member function definition [-Wextra-semi]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10901 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
Echelon9 fb33fe020b Resolve a series of Xcode (LLVM compiler) warnings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9735 387891d4-d844-0410-90c0-e4c51a9137d3
2013-08-06 22:55:14 +10:00
The_E c6397750e0 Fix for Mantis 2861: Make sure we switch off shader-based effect rendering if the GPU can't handle it
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9718 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
Zacam 0502b4d648 Revert of 9410. Apparently not ready for prime time, what with older compilers that don't seem to understand C++0x types (and complaints about upgrades to enable it), and it apparently (under said compilers) isn't any faster than stdext::hash_set anyway. 2012-12-10 08:23:19 +00:00
Zacam 5f998ff345 Mantis 2746: Fix for geometry batcher, from Valathil. Update for Mac by Echelon9. 2012-12-09 02:59:02 +00:00
Zacam 212eee3b31 Warning resolution: grbatch.cpp(806) : warning C4018: '<' : signed/unsigned mismatch; solved by setting 'Batch_buffer_size' from 'int' to 'size_t' 2012-11-17 23:12:17 +00:00
chief1983 4e5d3e2e57 Fix all the 'no newline at end of file' warnings I saw thrown by gcc on FreeBSD. 2012-11-02 17:30:17 +00:00
Goober5000 22dc84b6e1 MSVC6 compatibility 2012-09-30 21:08:05 +00:00
Swifty 6ba0da6020 go_even_faster: Improved rendering performance of particles by sending vertex data via buffer object. 2012-08-11 21:01:13 +00:00
Echelon9 68faf910cd GCC warning: suggest brackets (parentheses) around '&&' within '||' 2012-05-27 14:38:53 +00:00
Valathil 5fcc1c513e Add a random offset to the thruster distortion to make thruster clusters look better. 2012-02-03 15:27:24 +00:00
Echelon9 cb0326a38e Convert the geometry map batcher lookup functions to use size_t, in line with the STL types 2011-10-16 05:22:34 +00:00
Echelon9 41919ee15b Clarify some aspects of the geometry map and distortion map batchers, as well as clarifying and making consistent the function calling conventions throughout the code. 2011-10-16 05:08:33 +00:00
The_E 05f3578109 PVS Studio fix: V547, <variable> >= 0 check on size_t variable 2011-09-24 14:26:04 +00:00
Echelon9 2db013e321 Documentation: Code cleanup of grbatch.cpp and work to prepare for 64bit with size_t 2011-09-21 14:37:36 +00:00
IssMneur 0717ad3d13 PVS-Studio fix: V512 A call of the 'memcpy' function will lead to overflow of the buffer '& x'. (pstypes.h:131) 2011-09-08 05:39:53 +00:00
The_E c14d9213d2 Change batch_render_* to use iterators 2011-09-04 08:19:21 +00:00
Valathil da6727d9d1 Let's try this again. Adding Framebuffer distortion thrusters and explosions. 2011-08-22 17:57:01 +00:00
Zacam 583f5c976f Revert 7498: You should also test without optional command lines present, yellow disco screens of death in-mission are bad. 2011-08-21 04:04:45 +00:00
Valathil 89da5f6fdc Added thruster heat distortions and explosion framebuffer effects 2011-08-20 23:31:07 +00:00
Swifty fe605149c4 Soft sphere sprite rendering for particles, explosions, shockwaves, and thrusters. 2011-08-20 22:14:52 +00:00
The_E 20346118c6 Another sprite rendering fix from Valathil 2011-08-05 21:39:14 +00:00
The_E 154f90823c Another sprite rendering fix from Valathil 2011-08-04 21:46:21 +00:00
Zacam 75043ff5b1 go_faster from Antipodes 6. Everybody, say "Thank you, taylor!" 2010-10-18 18:32:37 +00:00
The_E a5c10c3ce9 Several minor touchups. 2010-08-31 12:42:39 +00:00