Commit graph

219 commits

Author SHA1 Message Date
Christoph Oelckers
7a692b1557 - added DTA_LegacyRenderStyle so that STYLE_* constants can be passed directly to the Draw functions.
- fixed the optional parameter in Shape2D.Clear.
2018-07-14 22:58:24 +02:00
Christoph Oelckers
33ee0f3c27 Merge branch 'master' into modern
# Conflicts:
#	src/gl/renderer/gl_renderer.cpp
#	src/gl/renderer/gl_renderer.h
#	src/gl/renderer/gl_renderstate.h
#	src/gl/system/gl_framebuffer.cpp
#	src/gl/system/gl_framebuffer.h
2018-07-14 13:18:34 +02:00
Christoph Oelckers
7817e6a7b2 - moved the texture binding code back to the OpenGL specific parts.
turns out that this cannot be consolidated with Vulkan because the semantics are far too different here.
2018-07-14 13:05:49 +02:00
Christoph Oelckers
124fe63d00 Merge branch 'master' into modern 2018-07-14 10:24:41 +02:00
Marisa Kirisame
2d0fb4ed2e Adds 2D shape (triangle array) drawer, usable from ZScript. Handles most drawtexture parameters excluding those related to scaling, at the moment. 2018-07-13 20:24:06 +02:00
Christoph Oelckers
532fba5c26 - moved the Stereo3D EyePose to their own file in hwrenderer/. 2018-06-24 10:47:42 +02:00
Christoph Oelckers
b106f72741 - don't route calls to FMaterial::FlushAll through the framebuffer interface. 2018-06-20 22:18:31 +02:00
Christoph Oelckers
babe55819e - fullscreen toggle and some cleanup. Not fully working yet. 2018-06-17 22:11:35 +02:00
Christoph Oelckers
b65b83edb3 - removed the hard screen resolution switch that still was present on Windows and cleaned up the entire video backend code from the remaining support code for this.
Like Linux and macOS this will only support borderless fullscreen in the active desktop resolution now, which is what modern systems need.
The list of discrete resolutions has been removed as it makes no sense anymore with a fixed video mode - all the other scaling options remain active, though.
2018-06-17 20:08:35 +02:00
Christoph Oelckers
e9e1911fa5 - made the scene scale and offset calculations inline functions of DFrameBuffer.
These got repeated quite often.
2018-06-17 12:23:29 +02:00
Christoph Oelckers
4937848123 - refactoring of fixed colormap stuff to have it better organized and to reduce the number of uniforms in the main shader.
This removes 3 uniforms, consisting of 9 floats. Those were merged into other values that never get used at the same time.
It also moves the costly setup of the fixed colormap out of the render state into the 2D processing code.
Since 3D forces use of render buffers now, it is no longer necessary to draw the entire scene with the colormap active, meaning it can be handled more efficiently.
2018-06-16 22:40:44 +02:00
Christoph Oelckers
9ff7e5a4ef - force render buffers to be active.
For modern hardware the fallback path really makes no sense and this allows to simplify some things quite a bit.
2018-06-16 09:37:01 +02:00
Christoph Oelckers
8ab68264c1 - removal of all code to handle OpenGL 2. From this commit on the main build of GZDoom will be OpenGL 3.3 or higher.
# Conflicts:
#	src/gl/renderer/gl_renderer.cpp
#	src/gl/shaders/gl_shader.cpp
#	src/gl/system/gl_framebuffer.cpp
#	src/gl_load/gl_interface.cpp
2018-06-15 21:45:05 +02:00
Christoph Oelckers
3401876476 - use FShaderProgram through an abstract interface and remove all dependencies on the GL renderer from the shader definition source files. 2018-06-13 22:08:55 +02:00
Christoph Oelckers
ce50b0e46b - read sampler bindings from the shader instead of tagging along a large amount of support data.
Works for most shaders, except SSAO.
2018-06-13 17:44:49 +02:00
Christoph Oelckers
59827cd601 - use layout binding qualifiers on uniform buffers when GLSL version >= 4.2
This has no performance benefits but allows checking shader generation correctness without having to implement Vulkan first.
2018-06-13 13:16:07 +02:00
Christoph Oelckers
4ddd9dde79 Use IUniformBuffer 2018-06-12 17:55:34 +02:00
Christoph Oelckers
3385e28611 Make it compile 2018-06-12 10:58:32 +02:00
Magnus Norddahl
f03c02df43 - fix gamepic render buffer issues 2018-06-03 13:59:40 +02:00
Christoph Oelckers
1656bbf9ec - route the BlurScene call in the menu through DFrameBuffer.
Game code should never ever call the renderer directly. This must be done through the video interface so that it can also work with other framebuffers later.
2018-05-18 00:22:57 +02:00
Christoph Oelckers
b197bfc964 - avoid checking for vr_enable_quadbuffered directly.
This option only exists on Windows, so on the other platforms it should not be in the menu and not affect the setup of the VR mode.
2018-05-18 00:12:45 +02:00
Christoph Oelckers
44dd48c7fa - moved the palette stuff and some remaining scaling code from OpenGLFrameBuffer to DFrameBuffer and fixed GetFlashedPalette 2018-05-16 22:10:24 +02:00
Christoph Oelckers
c2a7a4bf30 - moved viewport code to DFrameBuffer. 2018-05-12 17:23:56 +02:00
Christoph Oelckers
de15b589c0 - moved the screen blending code out of the renderer.
This is better be made part of the 2D interface.
That would have been done long ago if it hadn't been for the totally incompatible way this was handled by the purely paletted software renderer.
Now with that out of the way there is no point keeping this code this deeply embedded in the renderer.
2018-05-05 11:20:37 +02:00
Christoph Oelckers
67cb6e63b5 - cleanup of the 2D interface.
Lots of this was still laid out for DirectDraw. This removes most of Begin2D so that it can be done more cleanlz.
Note that this commit renders weapon sprites and screen blends incorrectly. Those will be fixed in an upcoming commit.
2018-04-29 20:15:19 +02:00
Christoph Oelckers
06d20e13b8 - cleaned up the gamma correction code.
This had accumulated quite a bit of cruft by now and parts of it should be in non OpenGL code.
2018-04-29 13:45:53 +02:00
Christoph Oelckers
cc926dec1e - removed gl dependencies from gl_sky.cpp by moving some data into other places. 2018-04-28 00:18:49 +02:00
Christoph Oelckers
bbea6e7e3c Begin2D doesn't need a return type anymore
This was to tell the caller that software 2D was in use, but that doesn't exist anymore
2018-04-27 09:58:19 +02:00
Christoph Oelckers
dd524b046e - GLWall is mostly clean, except some smaller things in gl_sky.cpp 2018-04-27 00:22:00 +02:00
Christoph Oelckers
306b630de2 - merged the remains of gl_texture.cpp into hw_cvars.cpp.
- eliminated hqresize.cpp's dependency on GL headers.
- cleaned up the logic for CreateTexBuffer so that hqresize.cpp does not need to check for software warped textures anymore.
2018-04-25 21:02:50 +02:00
Christoph Oelckers
bc8f47444f - texture precaching also moved to hwrenderer/. 2018-04-25 00:07:46 +02:00
Christoph Oelckers
0675315b41 - made FHardwareTexture inherit from an abstract interface to remove all GL dependencies from gl_material.cpp. 2018-04-24 23:06:34 +02:00
Christoph Oelckers
c37ff22a05 - removed the intermediate FGLTexture class.
This wasn't serving any real purpose anymore, and all its remaining functionality could be moved to FHardwareTexture
2018-04-24 20:41:52 +02:00
Magnus Norddahl
c4768441b4 - Fix playersprite offset being wrong in softpoly
- Remove DFrameBuffer::GetCanvas as it always returned null
2018-04-08 15:49:06 +02:00
alexey.lysiuk
018f5b8d05 Removed deleted virtual functions
They led to link errors with the current Apple's toolchain
2018-04-08 13:55:46 +03:00
Christoph Oelckers
b12a6fded9 - added the code for legacy shaders.
- force texture filtering for 2D to off when in software rendering.
2018-04-08 12:11:51 +02:00
Christoph Oelckers
1897073b60 -fixed: When performing a restart the SW scene drawer's resources should be reset because they are outside the control of higher level containers. 2018-04-08 08:03:46 +02:00
Christoph Oelckers
df4f435952 - merged vid_renderer, swtruecolor and r_polyrender into one CVAR to reduce menu clutter.
- with renderers freely switchable, some shortcuts in the 3D floor code had to be removed, because now the hardware renderer can get FF_THISINSIDE-flagged 3D floors.
- changed handling of attenuated lights in the legacy renderer to be adjusted when being rendered instead of when being spawned. For the software renderer the light needs to retain its original values.
2018-04-07 23:30:28 +02:00
Magnus Norddahl
fde87c40d2 - fix crash when in software truecolor mode - the pitch is in pixels, not bytes 2018-04-07 19:56:54 +02:00
Christoph Oelckers
211a7f2569 - made the screen blend work for the software renderer.
It may use the same calculations as the hardware renderer but must use the 2D drawer for display.
It should be investigated if the hardware renderer can do this as well.
2018-04-07 10:53:20 +02:00
Christoph Oelckers
b34d7f9e08 - added a software scene drawer to the GL renderer.
It still looks like shit and only works on the modern render path but at least the basics are working.
2018-04-07 10:20:59 +02:00
Christoph Oelckers
d474b849a5 - removed the remaining calls from the FRenderer interface from the main game code.
This does not work with a setup where the same backend is driving both renderers.
Most of this is now routed through 'screen', and the decision between renderers has to be made inside the actual render functions.
The software renderer is still driven by a thin opaque interface to keep it mostly an isolated module.
2018-04-04 00:21:25 +02:00
Christoph Oelckers
fcc33f0a09 - moved around more stuff from the FRenderer interface. 2018-04-03 22:50:47 +02:00
Christoph Oelckers
853903bb7e - removed the border refresh counter.
This was just a relic of DirectDraw as main backend and is no longer needed.
2018-04-03 00:50:40 +02:00
Christoph Oelckers
a9d5533603 - integrated GL parts of translation handling into the main module.
Now that this doesn't have to share assets with HW2D it could be simplified a lot.
2018-04-01 00:59:49 +02:00
Christoph Oelckers
a001a5304d - removed the old software renderer framebuffers for Windows
This cannot be refactored with the old code still present and done properly both renderers should share what they can.
2018-03-30 23:18:25 +02:00
Christoph Oelckers
ec8804cfd8 - added missing virtual destructor to DFrameBuffer.
Previously it inherited this from DCanvas but now both classes are no longer related.
2018-03-30 22:03:50 +02:00
Christoph Oelckers
811d96e07e D3D 2D code refactored but not tested yet. 2018-03-29 23:21:25 +02:00
Christoph Oelckers
a40e085a46 - 2D drawer implementation complete for hardware renderer.
This also replaces DTA_ColormapStyle with proper implementations of its components. As implemented it was a very awkward mixture of various effects that already existed in a separate form. As a result of its implementation it required additional but completely redundant shader support which could be removed now. As a side effect of this change a new DTA_Desaturate option was added.
2018-03-29 16:21:21 +02:00
Christoph Oelckers
70b6754299 - implemented the 2D drawer for the hardware renderer. Not tested yet. 2018-03-28 21:38:00 +02:00