Andrew Copland
3d0dff9900
Rewrite PointSprites class to actually use opengl point sprites
2016-07-17 17:34:36 +01:00
Andrew Copland
da1f8d4b90
Only set if uniform is valid.
2016-07-17 17:33:53 +01:00
Andrew Copland
ec94687a49
Add test to see if a uniform is valid.
2016-07-17 17:29:24 +01:00
Andrew Copland
93d7cc8351
Merge branch 'master' of https://github.com/pioneerspacesim/pioneer into gpu-gas-giant-textures
2016-06-21 21:35:52 +01:00
Andrew Copland
df6a61205c
Remove the occultedLight parameter and fixup the std::min casting issues
2016-06-18 12:19:31 +01:00
Andrew Copland
90750e25b3
Better comments to describe what and why were doing this.
2016-06-18 11:36:48 +01:00
Andrew Copland
420566dde3
Limit shadow count.
2016-06-18 11:01:50 +01:00
Andrew Copland
6b6c3c2432
Some things were not meant to be private...
2016-06-18 10:34:55 +01:00
Andrew Copland
94cc7a8e45
Generate shaders with fixed number of shadows/eclipses instead of passing into loop as a uniform.
2016-06-18 10:30:23 +01:00
Andrew Copland
e0a6db0722
Subtle bitwise logic bug, replaced |= with &= when testing if GPU job shaders compiled.
...
Add in a workaround for AMD R600 GPUs using MESA failing to compile shaders - use the DisableEclipse config flag as indicator.
Pack the data into the top 16-bits of the MaterialDescriptor::quality member.
2016-06-17 23:16:38 +01:00
Andrew Copland
200e40ce73
Check that the shader compiled and disable EnableGPUJobs if it has failed.
2016-06-11 22:51:29 +01:00
Andrew Copland
aadbfc4b54
HueShift the colours of non-Sol Gas/Ice Giants to add more variety.
2016-06-11 17:02:46 +01:00
Andrew Copland
221a069577
Updated makefiles
2016-06-11 15:47:06 +01:00
Andrew Copland
d193baa757
GPU jobs for generating gas giant textures.
2016-06-11 15:41:30 +01:00
Andrew Copland
9f72ce2c07
Calculate the inverse of the radius to avoid some divisions within the shaders.
2016-05-27 12:06:57 +01:00
Andrew Copland
9b8dc89c54
Complete usage of override and final keywords, remove near/far undef/define
2016-05-18 09:22:13 +01:00
Andrew Copland
c20d467c6f
Remove errant pragma optimize
2016-05-11 20:33:32 +01:00
Andrew Copland
3a6445a33d
Gather and draw sprites in batches using the explosions from a texture atlas.
2016-05-11 16:25:22 +01:00
Andrew Copland
900f2e3872
More flexible point sprite drawing method.
2016-05-10 14:53:44 +01:00
Andrew Copland
a30ae8a9ec
Sometimes there is no name, allow for that.
2016-05-01 11:30:04 +01:00
Andrew Copland
f43a614fcb
Inverted generateMipmaps test.
2016-04-30 13:43:31 +01:00
Andrew Copland
812e6f4c6a
Request the nicest texture compression and highest quality fragment shader accuracy
2016-04-29 08:54:01 +01:00
Andrew Copland
d9e93aa979
Set the active texture unit before binding and updating textures.
2016-04-29 08:53:24 +01:00
Andrew Copland
7135091fde
Only generate mipmaps for uncompressed textures.
2016-04-29 08:39:49 +01:00
Andrew Copland
c7ba7a519a
Make UpdateTexture, CreateTexture methods private. Remove unused parameter of GetOrCreateTexture.
2016-04-29 07:43:18 +01:00
Andrew Copland
73e280a6ae
Don't attempt to generate mipmaps for unpopulated textures.
2016-04-29 07:41:53 +01:00
Andrew Copland
b196174855
Last commit highlight poor placement of some render error checking.
2016-04-27 21:56:36 +01:00
Andrew Copland
2f6a80e171
Get the function name and line number for all render error checking
2016-04-27 21:46:15 +01:00
Andrew Copland
f12fbfbf06
Line, just function without prettiness.
2016-04-27 13:45:26 +01:00
Andrew Copland
d6ccbfedf2
Correct warning logic handling
2016-04-27 13:41:48 +01:00
Andrew Copland
54812d32db
Use CHECKERRORS macro everywhere applicable.
2016-04-27 13:36:12 +01:00
Andrew Copland
0b32988e52
Decorated function name in opengl warning output to aid debugging
2016-04-27 13:35:11 +01:00
Andrew Copland
79cc8bc224
Only fire on unique errors.
2016-04-27 12:43:51 +01:00
Andrew Copland
e7d1bf03dd
Fix the texture binding issues with BillboardMaterial and RingMaterial
2016-04-03 20:56:21 +01:00
Andrew Copland
5e2e234ec3
Add EFFECT_BILLBOARD_ATLAS, and make EFFECT_BILLBOARD draw without uv offsetting
2016-04-03 18:09:51 +01:00
Andrew Copland
d6f9137b39
BillboardMaterial is of course virtual, also add virtual and override keywords elsewhere.
2016-04-03 13:53:40 +01:00
Andrew Copland
89b43faedf
Linux makefile updated
2016-04-02 15:13:23 +01:00
Andrew Copland
eaaa7b6a72
New VertexArray format of just pos and normal
2016-04-02 14:57:33 +01:00
Andrew Copland
61613f3a19
New billboard (point sprite) material shader
2016-04-02 14:56:27 +01:00
Andrew Copland
06fb3b89d5
Add TextureBuilder::Normal which will not compress a texture if it isn't already compressed.
...
Use it for all normal maps, existing DDS normal maps will still be compressed.
2016-03-30 11:02:51 +01:00
Andrew Copland
2b0d0aaf74
Profile game startup with OpenGL error checking disabled.
2016-02-27 17:14:51 +00:00
Andrew Copland
b65c643695
Moved function bodies for inlining to work.
2016-02-21 12:05:15 +00:00
Andrew Copland
5034f76ae8
De-virtualising drawables and making Sphere3D more flexible.
2016-02-21 12:00:54 +00:00
Andrew Copland
b4cff2e54e
__inline and const
2016-02-21 11:59:34 +00:00
Andrew Copland
6b8aab335e
Additional profiling hooks
2016-02-21 11:59:03 +00:00
Andrew Copland
4adc6bc03c
Warn about possible cause of a GL_INVALID_OPERATION for Windows platform.
2016-02-11 19:34:37 +00:00
Andrew Copland
fea5ac26b2
MERRY HAPPY 2016
2016-01-29 11:31:54 +00:00
Andrew Copland
1153ea1676
Moved the static s_AttribBufferMap into RendererOGL class.
2016-01-21 11:04:43 +00:00
Andrew Copland
1c98f1047b
Create a simple map of VertexBuffer objects and re-use them for all DrawTriangles calls.
2016-01-20 22:28:15 +00:00
Andrew Copland
e65c4ede3a
Setup a TextureQuad from a VertexArray.
2016-01-19 21:57:00 +00:00
Andrew Copland
022814aa7d
Setting vertex buffer size checking
2016-01-19 10:47:51 +00:00
Andrew Copland
76a7b4fc1c
Somehow I missed these ctors earlier
2016-01-16 21:53:15 +00:00
Andrew Copland
422d75314f
Remove the default constructors arguments for the TextureDescriptor class
2016-01-16 21:05:45 +00:00
Andrew Copland
4ac50e26ea
Merge pull request #3585 from fluffyfreak/indicies-32bit
...
Convert geometry to use 32-bit indices
2016-01-16 17:16:58 +00:00
Andrew Copland
960fc0c380
TextureDescriptor usage updated to fix off-by-one initialisation problems caused by anisotropic filtering feature.
2016-01-16 14:03:25 +00:00
Andrew Copland
ae56c02e23
Store anisotropic filtering in the TextureDescriptor, UI etc don't need it.
2016-01-12 18:55:12 +00:00
Andrew Copland
afa47ce919
Enable toggling on/off of the Anisotropic filtering.
2016-01-11 21:58:20 +00:00
Andrew Copland
81cca46753
Enable anisotropic filtering of textures by default.
2016-01-11 21:12:00 +00:00
Andrew Copland
2b8f8fa336
Convert geometry to use 32-bit indices
2016-01-09 21:32:37 +00:00
John Bartholomew
03fe609f54
use the TextureBuilder::UI helper when creating a Drawables::TexturedQuad
...
This fixes a spurious warning about loading a non-power-of-two texture
(marker_dot.png), by fixing the parameters used for the texture builder.
In particular, TextureBuilder::UI sets extendPot=true which means the
TextureBuilder will automatically pad the texture.
Note that this extra padding is unnecessary on modern graphics chipsets,
but that's a separate bug (the logic in TextureBuilder should be checked
and probably improved to avoid padding textures when running on graphics
hardware that doesn't need it).
2015-12-09 22:43:44 +00:00
John Bartholomew
bf73b7efd8
add helper constructor to make a Drawables::TexturedQuad from an image file
2015-12-06 12:09:08 +00:00
John Bartholomew
3b677015d4
add helper method GetOriginalSize() to TextureDescriptor
2015-12-06 12:09:08 +00:00
John Bartholomew
f451b83783
cleanup -- remove unused declarations for Frustum::{Enable,Disable}
2015-12-06 12:09:08 +00:00
Andrew Copland
d5570df283
Added ability to set color from Hex (32-bit int) value. Sets RGBA.
...
Removed ability to set Color4ub from single Uint8.
2015-11-22 19:02:20 +00:00
Andrew Copland
c93bba0970
I forgot a file
2015-11-09 21:43:48 +00:00
Andrew Copland
58f7c4424e
Merge branch 'master' of https://github.com/pioneerspacesim/pioneer into cleaup-ogl
2015-11-09 21:10:46 +00:00
Andrew Copland
a47092fb8a
Confirm that types match the OpenGL definitions
2015-11-09 21:08:38 +00:00
Andrew Copland
6bcc4f4edd
Include directly not relatively.
2015-11-09 21:07:47 +00:00
Andrew Copland
9874bc0b4b
Remove all trace of OpenGL types from code base and isolate within graphics opengl
2015-11-09 20:49:44 +00:00
Andrew Copland
b615f02034
Remove unused width from line type
2015-11-09 18:49:04 +00:00
Andrew Copland
0141c35b81
Merge pull request #3515 from fluffyfreak/normals
...
Normal Mapping for objects (ships, stations etc)
2015-11-09 10:20:26 +00:00
Andrew Copland
38c82bc478
Fix instanced rendering and try to avoid this mistake in the future.
2015-11-05 22:16:05 +00:00
Andrew Copland
24a51581f8
Updated (optional) normal mapping based on work that Luomu did several years ago.
2015-11-05 21:00:52 +00:00
Andrew Copland
3a173ae991
Update gl_load_gen generated extension loader files to remove compatibility and force core only functions
2015-11-05 19:00:33 +00:00
Andrew Copland
0966a6c989
Present a clearer warning to the user if OpenGL fails to initialise.
2015-10-13 22:18:41 +01:00
Andrew Copland
d12ad7be0e
Merge branch 'master' of https://github.com/pioneerspacesim/pioneer into star-child
2015-10-10 12:47:08 +01:00
Andrew Copland
3ad9c5b925
Use stringf instead of sprintf
2015-10-09 14:59:58 +01:00
Andrew Copland
de33219161
A primitive include file handler for shaders.
2015-10-08 20:25:59 +01:00
Andrew Copland
c41cab9ef9
Reduce down the shader setup for the star program
2015-10-08 14:21:28 +01:00
Andrew Copland
b561bcc6b9
Use a heavily simplified shader for star rendering.
2015-10-08 08:56:50 +01:00
Andrew Copland
78a6822654
Fix GCC old-style-cast warning.
2015-09-08 08:23:58 +01:00
Andrew Copland
61fd42ed0f
Disable detail maps via the config file.
2015-09-06 20:31:27 +01:00
Andrew Copland
74859a406c
Merge branch 'master' of https://github.com/pioneerspacesim/pioneer into detail-textures
...
Conflicts:
data/shaders/opengl/geosphere_terrain.vert
src/GeoPatch.cpp
src/graphics/opengl/GeoSphereMaterial.cpp
2015-09-05 16:57:40 +01:00
Andrew Copland
3622654554
Eliminate the scaling of planets since we're using a logarithmic z-buffer for rendering.
2015-07-26 21:01:54 +01:00
Andrew Copland
10002014c5
Cleanup some of the warnings emitted during Linux builds.
2015-07-26 17:48:51 +01:00
Andrew Copland
88a6c9241b
Gather some stats on buffer creation
2015-07-18 14:33:23 +01:00
Andrew Copland
2e83c75e4d
RoundEdgedRect and Rect drawable classes, plus sanity check within VertexBuffer Populate method
2015-07-18 13:31:07 +01:00
John Bartholomew
c730b1fd9e
Label3D: don't try to render text with no glyphs
...
Fixes the crash reported in #3391 .
However, the underlying problem that Chinese text can't be rendered on a model's
label is still present. To fix that we'll need to generate SDF glyphs on demand
as we do for the normal flat 2D glyphs.
2015-06-07 17:37:55 +01:00
Andrew Copland
960f9c6ab9
Merge branch 'cppcheck' of github.com:fluffyfreak/pioneer into more-cppcheck
2015-04-25 11:49:32 +01:00
Andrew Copland
cbbdcd10b1
More cppcheck warning fixes
2015-04-25 11:48:41 +01:00
Andrew Copland
5357000b9e
use log1p instead
2015-04-23 21:12:56 +01:00
Andrew Copland
ae1d6b85bd
Return *this by reference from operator= overloads
2015-04-23 21:07:55 +01:00
Andrew Copland
4ee00126d5
Ask for a opengl 3.1 context again, but also add compatibility stuff to the glloadgen profile
2015-03-24 13:19:12 +00:00
Andrew Copland
f1fd3d92d5
Merge branch 'master' of https://github.com/pioneerspacesim/pioneer into instancing
2015-03-23 15:27:02 +00:00
Andrew Copland
e00e1e775d
fix linux compilation issues
2015-03-23 15:22:38 +00:00
Andrew Copland
33f4fbe091
Fix Vsync config option which must have broken with OpenGL 3 changes
2015-03-23 14:45:58 +00:00
Andrew Copland
a71beedfcb
Fix linux build issue
2015-03-23 14:45:30 +00:00
Andrew Copland
90e74b287a
Had to make instancing part of the material definition to get it through to the shader program, yuck, works though.
2015-03-23 14:14:15 +00:00
Andrew Copland
9835adb5f5
Add instance count to InstanceBuffer
2015-03-22 18:05:45 +00:00
Andrew Copland
be1f6e41ec
Switch to OpenGL 3.3, add InstanceBuffer classes and support methods, specify attribute layouts add GLSL extension.
2015-03-22 11:29:55 +00:00
Andrew Copland
c03d273940
Add patch tracking to the render stats. Will remove duplicates from Pi namespace soon.
2015-03-22 00:07:47 +00:00
Andrew Copland
a1f31102b0
WIP initial instancing commit
2015-03-21 23:53:21 +00:00
Andrew Copland
e4dac929db
Gather some rendering related stats per-frame.
2015-03-21 23:18:39 +00:00
Andrew Copland
bfb26761c4
Remove a lot of unnecessary profiling that just clutters up the results. Called thousands of time with 0% impact.
2015-03-20 23:23:34 +00:00
Andrew Copland
06b22e7a97
Remove the transposition of the normal matrix after we invert it. Already in the correct state!
2015-03-19 08:44:29 +00:00
Andrew Copland
d2e5f2db49
Change to using a mat3 for uNormalMatrix, fix up shaders.
...
Set multi.frag to use specular light colour instead of diffuse light colour.
Add helper functions to MathUtil to do more expensive Inverse calculations.
2015-03-18 22:37:06 +00:00
Andrew Copland
86cea5962e
If we're using the dummy renderer there won't be a window so just copy the value requested and avoid calling the SDL window methods.
2015-03-03 21:04:53 +00:00
Andrew Copland
2bad4a3fd5
Merge pull request #3341 from fluffyfreak/fix-GetLight-3340
...
Prevent issue #3340 assert
2015-01-31 11:43:51 +00:00
Andrew Copland
2bb16e66eb
Initialise the value of m_numLights to 0, reset to zero in the failure case of setting the lights.
2015-01-31 11:02:22 +00:00
Andrew Copland
233bc6118d
We need to be testing it's less than 4, i.e: 0...3, not less than 5, i.e: 0...4
2015-01-31 11:01:41 +00:00
Robert Norris
2fd0cc59fe
don't create a window and setup GL if the dummy renderer is in play
2015-01-30 15:54:07 +11:00
Robert Norris
bb1f6475eb
silence linux build warnings (and remove some dead code)
2015-01-25 21:33:26 +11:00
Andrew Copland
9638c6f0b1
Check we've got verts before drawing and regenerate the scanner properly.
2015-01-08 21:00:18 +00:00
Robert Norris
8b5c72155a
explicitly register wanted renderers from program startup
...
the idea here is to not have libgraphics depend directly on the
renderers, so individual renderers can be compiled in/out without link
failures
2015-01-07 07:54:45 +11:00
Robert Norris
818588e3ab
renderer SetDepthRange method to cover glDepthRange
2015-01-07 07:54:45 +11:00
Robert Norris
b750e6179b
move renderer error checks onto the renderer
2015-01-07 07:54:45 +11:00
Robert Norris
22d380426d
move GL screendump into GL renderer
2015-01-07 07:54:45 +11:00
Robert Norris
6a0423e813
move GL init and info dump into GL renderer
2015-01-07 07:54:45 +11:00
Robert Norris
825918d42b
separate renderer builds. full build failing right now
2015-01-07 07:54:45 +11:00
Robert Norris
84ef0d7746
dummy renderer for the modelcompiler
2015-01-07 07:54:45 +11:00
Andrew Copland
364af11c2f
Change Points to draw TRIANGLES instead of TRIANGLE_STRIP. Reset the VertexBuffer under a number of conditions. Don't not backface cull points.
2015-01-04 18:20:55 +00:00
Andrew Copland
2ff79c01fa
Remove all of the DrawLines and DrawPoints method calls.
2015-01-02 22:43:26 +00:00
Andrew Copland
2cc33907c2
Bug fix for Points SetData method, also drawing works better when you call the Draw method.
2015-01-02 20:46:54 +00:00
Andrew Copland
9935b16aec
GalacticView using Points, SpeedLines using Lines, WorldView constness, Bug Fix Drawables::Points
2015-01-02 17:36:49 +00:00
Andrew Copland
95421cd04a
Drawable Points
2015-01-02 16:49:07 +00:00
Robert Norris
9f95339a9d
MERRY HAPPY
2014-12-31 23:05:37 +11:00
Robert Norris
9bfc0b3517
silence compile warnings on linux
2014-12-31 23:00:14 +11:00
Simon Chopin
c966f82172
Require OpenGL 3.1 context when opening the SDL window
...
Since it appears we've settled for OpenGL 3.1 and not 3.2, ask SDL for
that.
2014-12-06 10:43:19 +01:00
Andrew Copland
4a6e5ba175
Fix makefile.am to use final naming.
2014-11-29 12:16:15 +00:00
Andrew Copland
1682f96b0b
Change the renderer name string.
2014-11-29 11:58:42 +00:00
Andrew Copland
a3d8985d11
Remove GLEW
2014-11-29 11:54:03 +00:00
Andrew Copland
40353db075
Add glLoadGen files generated with command line: lua LoadGen.lua -style=pointer_c -spec=gl -version=3.1 -profile=core core_3_x -stdext=gl_ubiquitous.txt -stdext=gl_core_post_3_3.txt -ext ARB_seamless_cube_map ARB_seamless_cubemap_per_texture
2014-11-29 11:53:10 +00:00
Andrew Copland
30b88db878
This was trampling m_program on MXE/Linux. Should fix 3251, 3262
2014-11-27 12:30:07 +00:00
Andrew Copland
a738282eb3
For OSX
2014-11-25 08:52:39 +00:00
Andrew Copland
5185dcfc4b
Merge pull request #3252 from fluffyfreak/JSONships
...
Json ship definitions
2014-11-24 11:29:56 +00:00
Andrew Copland
c6d76045eb
Merge pull request #3253 from fluffyfreak/badPrograms
...
Extra checking for program creation
2014-11-23 15:12:26 +00:00
Andrew Copland
1423aec0ee
There were unused.
2014-11-23 12:13:29 +00:00
Andrew Copland
1256ecaa22
Add program validation check
2014-11-21 15:59:57 +00:00
Andrew Copland
c8300ca0e2
Add a ProgramExcepetion struct to make it clear which one is firing
2014-11-21 14:07:19 +00:00
Andrew Copland
d40c74e50a
Just scoping for clarity
2014-11-21 13:31:06 +00:00
Andrew Copland
c8f11e103f
extra checking for program creation
2014-11-21 13:24:41 +00:00
Andrew Copland
2b1c2923f0
Change the call GLDebug PrintMessage uses so I can redirect it.
2014-11-20 22:44:32 +00:00
Andrew Copland
c0f20dc907
Flush the last of the errors - hopefully they're all invalid!
2014-11-15 14:33:37 +00:00
Andrew Copland
ed7f18c134
Not valid for OpenGL 3.X
2014-11-15 14:08:20 +00:00
Andrew Copland
3ec7f92a89
These asserts are not valid. You can happily change the buffer without first releasing it.
2014-11-15 14:08:04 +00:00
Andrew Copland
3470065f2e
Merge branch 'master' of https://github.com/pioneerspacesim/pioneer into GL33
2014-11-13 20:48:38 +00:00
Andrew Copland
a5d57692ab
Future line Material shader
2014-10-19 13:57:00 +01:00
Andrew Copland
0a823b7267
Fixed the line ending problems with exported shader listings
2014-10-19 13:56:45 +01:00
Andrew Copland
601c120df4
Update include guards to use _OGL_ instead of _GL2_
2014-10-19 13:56:20 +01:00
Andrew Copland
c54b5e353f
Allow for geometry shader type to be used.
2014-10-18 16:45:25 +01:00