Christoph Oelckers
9e51a2f63c
- added Build's NPOT emulation to the backend.
...
For GZDoom this is completely disabled, of course, because the Doom engine does not need it, but in order to have the same backend code in both engines it needs to be present.
2020-06-08 23:37:20 +02:00
Christoph Oelckers
b06af634e2
- added a flash component to the colormap shader.
...
Its main purpose is for RR's lightning flash in Raze but this looks very useful for manipulating fullscreen colormaps. Currently not exposed, though.
2020-06-07 09:16:56 +02:00
Christoph Oelckers
f8dcb09ff0
- moved postprocessing shaders to their own folder.
2020-04-26 21:22:57 +02:00
Christoph Oelckers
7c46dace03
- this still doesn't work on Vulkan. :(
2020-04-19 10:57:44 +02:00
Christoph Oelckers
8381092cce
- major shader rework
...
* handle brightmaps in the main shader instead of keeping separate instances around.
* added detail and glow layers from Raze.
* fixed material setup which could not guarantee that everything was initialized correctly.
* for warped textures, warp all layers. With this brightmaps finally work on warped textures.
Note: Vulkan reports a "device lost" error with this which still needs to be investigated.
2020-04-19 10:57:43 +02:00
Christoph Oelckers
738b9ceb08
- fixed incompletely changed shader.
...
It was still using a variable from the first revision that no longer exists.
2019-12-21 21:07:00 +01:00
Christoph Oelckers
bb8db9422f
- scaled down the texture colorization feature for easier usability.
...
It makes little sense exposing every minute detail of this through UDMF.
Setting it up that way is far too complicated. Using virtual textures that map to a real texture plus a colorization record should be far easier to use by mappers.
This also doesn't piggyback on the Doom64 color feature anymore and is completely separate, despite some redundancies.
This is still missing the texture definition part, though.
2019-12-20 22:25:10 +01:00
Christoph Oelckers
3209d4ed23
- added a few more texture coloring options to the shader.
...
Aside from adding an additive component it can now also do:
- desaturation (not limited to the range of 0..1 so it can also be used for oversaturation by applying a negative number or negative saturation by going above 1.0.
- invert the texture
- apply a blend, including 3 special mode taken from EDuke32.
Currently only the implementation is done, it is not exposed to UDMF yet.
2019-12-20 16:05:00 +01:00
alexey.lysiuk
b6ada166fc
- fixed compilation of FXAA shader by macOS OpenGL
...
Compile Shader 'shaders/glsl/fxaa.fp':
ERROR: 0:250: '' : syntax error: incorrect preprocessor directive
ERROR: 0:250: '' : syntax error: unexpected tokens following #if preprocessor directive - expected a newline
ERROR: 0:265: '' : syntax error: incorrect preprocessor directive
ERROR: 0:265: '' : syntax error: unexpected tokens following #if preprocessor directive - expected a newline
ERROR: 0:266: '' : Macro Redefined lumaM
ERROR: 0:301: '' : syntax error: incorrect preprocessor directive
ERROR: 0:301: '' : syntax error: unexpected tokens following #if preprocessor directive - expected a newline
ERROR: 0:599: '' : syntax error: incorrect preprocessor directive
ERROR: 0:599: '' : syntax error: unexpected tokens following #if preprocessor directive - expected a newline
https://forum.zdoom.org/viewtopic.php?t=65003
2019-06-11 08:20:24 +03:00
alexey.lysiuk
addcad8ac0
- disabled discard in FXAA shader with Vulkan backend
...
Discard caused graphical corruptions on AMD hardware with Vulkan backend enabled
https://forum.zdoom.org/viewtopic.php?t=64230
2019-06-04 11:32:00 +03:00
alexey.lysiuk
da2d0e47e6
- removed array length() function from shadowmap shader
...
Array's length() function is not yet supported by SPIRV-cross and MoltenVK
Its usage was replaced by explicit nodes count value passed as uniform
2019-05-24 14:29:37 +03:00
Magnus Norddahl
f3cb5e09e4
- SIMPLE is never ever defined for main.fp
2019-05-13 22:38:16 +02:00
Magnus Norddahl
bab5862383
- fix some vulkan warnings
2019-05-13 21:15:10 +02:00
Magnus Norddahl
5f12191c05
- fix validation error for shader input not declared by main.vp
2019-05-12 23:15:49 +02:00
Magnus Norddahl
e75ab8ed09
- fix wrong fog color used for ssao when using multisampling
2019-05-05 23:23:47 +02:00
Magnus Norddahl
1973001834
- use the exact sRGB->linear transfer function in HDR mode as the 2.2 gamma approximation is visibly inaccurate in this case
2019-05-01 00:55:31 +02:00
Magnus Norddahl
d63513ec14
- fix normal vectors on models
2019-04-17 20:42:00 +02:00
Magnus Norddahl
15dae4cfe6
- rewrite depthblur.fp to workaround what seemed to be a bug in the NVidia driver
2019-04-16 16:17:23 +02:00
Magnus Norddahl
9d29a460de
- simplify depthblur.fp into a single function
2019-04-16 08:59:29 +02:00
Magnus Norddahl
67490d13cb
- add gl_ssao_debug mode showing the depth
2019-04-16 05:29:32 +02:00
Magnus Norddahl
558760c090
- fix the gl_ssao_debug cvar
2019-04-16 03:32:54 +02:00
Magnus Norddahl
db4310ca6b
- prevent excessively bright pixels as this is actually visible on a HDR monitor
2019-04-11 03:34:34 +02:00
Magnus Norddahl
c28e56f9e8
- workaround buggy preprocessor in old AMD OpenGL drivers
2019-04-07 19:42:32 +02:00
Magnus Norddahl
2d8516b2ca
- make shaderClipDistance optional
2019-03-25 19:44:46 +01:00
Magnus Norddahl
cce96ca87a
- implement shadow maps
2019-03-15 07:54:34 +01:00
Magnus Norddahl
dca0b75038
- change the images to be upside down until presentation to increase compatibility with shaders designed for OpenGL
...
- clamp scissors fully to avoid NVidia's awful drivers locking up the entire system if they end up out of bounds
- perform buffer clears as part of the render pass. this puts some restrictions on how FRenderState.Clear can be used
- add an offset uniform to the present shaders so the vulkan target can flip the image during presentation
2019-03-12 23:53:20 +01:00
Magnus Norddahl
0620041228
- remove screenquadscale.vp
2019-03-12 16:24:55 +01:00
alexey.lysiuk
02ed758447
Merge branch 'master' into vulkan2
...
# Conflicts:
# src/posix/cocoa/i_video.mm
2019-03-09 16:45:49 +02:00
Christoph Oelckers
99c8ba1288
- use uAddColor instead of uObjectColor2 for the ending color of a special colormap range.
...
Unlike uObjectColor2, this is more global state. uObjectColor2 is part of gradient calculation which may later be offloaded to a secondary buffer which already resulted in only conditionally setting it, resulting in broken special colormap application for the software renderer.
2019-03-09 12:12:33 +01:00
Magnus Norddahl
b313f91ab0
- add layout location decl to all postprocess shaders
2019-03-05 18:55:31 +01:00
Magnus Norddahl
56afcd210b
- fix: gl_PointSize is required in Vulkan when drawing points
...
- fix: add depthstencil attachment when stencil is active while depth is not
2019-03-03 23:30:36 +01:00
Magnus Norddahl
f8aa48d053
- fix blinking caused by uninitialized clipping planes
2019-03-02 14:16:11 +01:00
Magnus Norddahl
05a6896d4f
- Pass vertex color and normal via uniform buffer when the attribute isn't available
2019-03-02 01:56:08 +01:00
Magnus Norddahl
d4118a755c
- load all the shaders and use the right one for each renderpass
2019-03-01 02:40:02 +01:00
Magnus Norddahl
2e0b34ca72
- hook up enough of renderstate to enable all of main.vp and main.fp
2019-02-28 00:26:49 +01:00
Magnus Norddahl
fe67a2c24f
- fix enough bugs to finally get some visuals
2019-02-26 20:19:54 +01:00
Magnus Norddahl
52460d53d9
- compile main.vp and main.fp for vulkan
2019-02-22 11:30:48 +01:00
Magnus Norddahl
f10ded756e
- split shadowmap AABB tree into two parts. one for static and one for dynamic
...
- upload only the dynamic AABB subtree using glBufferSubData
- change internal raytracing stack limit from 16 to 32
- update shadowmap AABB tree after R_SetupFrame for proper frame interpolation
2019-01-04 15:51:59 +01:00
Kevin Caccamo
9622ca7517
Add additive color before applying object colors
...
Based on what I saw in this video (https://youtu.be/Yx1tflavea8 ), the
additive colors are applied before the object colors
2018-12-26 16:58:27 +01:00
Kevin Caccamo
33723e8904
Implement additive colour on walls and sprites
...
Also, don't modify the alpha channel when adding the additive colour.
2018-12-26 16:58:27 +01:00
Kevin Caccamo
758cd77e55
Rename ColorAdd to AddColor, and use it ingame
...
Rename ColorAdd to AddColor
Add AddColor to FRenderState
Tweak SpecialColors array in ZScript to include the additive color
Add uAddColor to the shader compiler
Add uAddColor to the texel
2018-12-26 16:58:27 +01:00
Magnus Norddahl
0c4602507e
- remove shadow acne when dynlights perfectly align with planes
2018-12-23 15:13:38 +01:00
Magnus Norddahl
bc648015c7
- vWorldNormal is not normalized but R_DoomColormap requires this
2018-12-19 11:07:39 +01:00
Magnus Norddahl
f1fe9a0286
- fix vanilla light mode angle calculation
2018-12-15 10:02:57 +01:00
Magnus Norddahl
3af6ae4b37
- add vanilla lightmode that behaves exactly as Doom's original light did
2018-12-15 07:11:28 +01:00
Magnus Norddahl
96df21e3dc
- fix typo
2018-11-20 13:54:18 +01:00
Magnus Norddahl
216191c86d
- interpolate the normal for models
2018-11-20 13:41:27 +01:00
Christoph Oelckers
f2dcff4386
- more options for Doom 64 style gradients on walls:
...
* Colors can npw be defined per sidedef, not only per sector.
* Gradients can be selectively disabled or vertically flipped per wall tier.
* Gradients can be clamped to their respective tier, i.e top and bottom of the tier, not the front sector defines where it starts.
The per-wall colors are implemented for hardware and softpoly renderer only, but not for the classic software renderer, because its code is far too scattered to do this efficiently.
2018-11-11 16:04:36 +01:00
Christoph Oelckers
1768508c80
- first adjustments to decal code.
...
- moved texture mode constants to a global header and consolidated with the variants of the 2D drawer.
2018-10-21 08:14:48 +02:00
Christoph Oelckers
9253118bdc
- removed the quad drawer class
...
This isn't needed anymore.
2018-10-20 11:59:12 +02:00
Magnus Norddahl
4ac43dac36
- fix distance attenuation for PBR materials
2018-10-17 09:03:18 +02:00
Rachael Alexanderson
3d81be1517
- always enforce a minimum distance for fog when fogmode is set to standard. without this, it was possible for the GPU to error out and stop rendering pixels for certain screen blocks
2018-10-09 04:45:23 -04:00
Magnus Norddahl
8ea74770fd
- fix artifact in PCF filter when the texture coordinate wraps
2018-10-05 21:30:16 +02:00
Magnus Norddahl
6135e867a9
- remove shadow acne from PCF shadowmap filter and add three quality levels
2018-10-05 04:36:11 +02:00
Magnus Norddahl
cd520a6528
- fix the nearest shadow map filter to have no shadow acne and replace linear with nearest in the menu
2018-10-04 15:33:07 +02:00
Magnus Norddahl
d65d462268
- add some comments to shadowmap.fp
2018-10-04 01:29:25 +02:00
Magnus Norddahl
36946a47fe
- fix diagonal linear shadow map artifact
2018-10-04 00:46:17 +02:00
Christoph Oelckers
797f88a6c8
- some tweaking of shadowmap filter setting to allow changing the PCF filter's number of samplings.
2018-10-03 13:45:54 +02:00
Christoph Oelckers
c8852b8fea
- enabled the linear shadowmap filter.
...
Although this doesn't look as good as the PCF version it is a lot less calculation intensive and therefore more suitable for weaker hardware.
It also tends to bleed through walls a lot less.
2018-09-29 13:23:40 +02:00
Christoph Oelckers
86c7e87767
Merge branch 'master' of https://github.com/coelckers/gzdoom
2018-09-29 12:59:11 +02:00
Magnus Norddahl
3b8b312fae
- clamp the software light to never get brighter than the initial light level
2018-09-23 17:58:17 +02:00
Christoph Oelckers
bc1e659c7b
Revert "- reworked fog uniforms to move the global fog mode setting to the viewpoint buffer."
...
This reverts commit 8b26b6dd1e
.
This was causing problems with light mode 2 because some edge cases were no longer handled properly.
2018-09-16 22:38:20 +02:00
Christoph Oelckers
8b26b6dd1e
- reworked fog uniforms to move the global fog mode setting to the viewpoint buffer.
2018-09-06 19:14:30 +02:00
Christoph Oelckers
5e39890118
- use a uniform buffer for per-scene data like rotation matrices.
2018-09-02 18:40:36 +02:00
Magnus Norddahl
d121fa21bf
- add gl_dither for toggling dithered output on and off
2018-08-08 21:58:23 +02:00
Magnus Norddahl
31addbc859
- use a texture for the dither matrix
2018-08-08 00:54:12 +02:00
Rachael Alexanderson
07c9db682d
- change 'halfstep' in the dither shader to a #define
2018-08-07 17:06:05 -04:00
Rachael Alexanderson
1cfed9de45
- expand the dither matrix from 4x4 to 8x8
2018-08-06 23:00:20 -04:00
Rachael Alexanderson
0cfe79d85d
- further math tweaks
2018-08-06 21:51:23 -04:00
Rachael Alexanderson
cdd77ad5fa
- fix up a bit of math on the dither shader
2018-08-06 21:37:45 -04:00
Magnus Norddahl
7362070504
- add dithering to present shader
2018-08-07 03:03:40 +02:00
Christoph Oelckers
4a7b1aada7
Merge remote-tracking branch 'remotes/origin/modern'
...
# Conflicts:
# wadsrc/static/shaders/glsl/main.fp
2018-07-20 10:19:07 +02:00
Magnus Norddahl
8a500a25f5
- rewrite the user shader support for materials - new syntax is to create a 'Material ProcessMaterial()' function
2018-07-15 23:01:40 +02:00
Christoph Oelckers
124fe63d00
Merge branch 'master' into modern
2018-07-14 10:24:41 +02:00
alexey.lysiuk
c29651da95
- restored initial grayscale conversion in fragment shader
...
Accidental change of red color multiplier was discovered during investigation of https://forum.zdoom.org/viewtopic.php?t=61126
2018-07-02 17:31:48 +03:00
Magnus Norddahl
8eb825e25a
- fix some postprocess bugs
2018-06-30 16:44:09 +02:00
Magnus Norddahl
32d837cdf1
Merge remote-tracking branch 'gzdoom/modern' into hw_postprocess
2018-06-24 17:57:02 +02:00
Magnus Norddahl
b2fad453fa
- change tonemaps to steps
2018-06-23 19:25:49 +02:00
Christoph Oelckers
1967165633
- move view and projection matrices to DrawInfo.
2018-06-21 21:02:14 +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
612fb40f3a
- don't use uniforms related to fixed colormaps for other things.
...
The fixed colormap is a per-scene global setting that normally does not need to change ever during rendering of a scene so it's easily shoved aside into a static uniform buffer.
Having to change this buffer for inconsequential stuff should be avoided, especially when there's other uniforms that are just as good to hold these values.
2018-06-14 21:28:03 +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
d2dea17e81
- specify vertex attributes in the shader source for Vulkan compatibility.
2018-06-13 08:40:04 +02:00
Christoph Oelckers
ad7aaa8f2a
- specify fragment output locations in the shader source.
...
OpenGL has been supporting this since version 3.3 and Vulkan requires it so it's the way to go.
2018-06-12 23:52:33 +02:00
Magnus Norddahl
832e7818c8
- rewrote the blur shader so that it works the same way as the rest
2018-06-12 22:14:44 +02:00
Magnus Norddahl
49073489e5
- uniform buffers for the fxaa, blur and bloom shaders
2018-06-11 22:06:46 +02:00
Magnus Norddahl
48f753061a
- uniform buffers for the present and shadowmap shaders
2018-06-11 21:42:09 +02:00
Magnus Norddahl
6fcc79d72a
- uniform buffers for the tonemap shaders
2018-06-11 21:18:20 +02:00
Magnus Norddahl
2bde741a7e
- Uniform buffer for colormap shader
2018-06-11 21:03:55 +02:00
Magnus Norddahl
d22fb24e28
- Uniform buffers for lens shader
2018-06-11 20:58:20 +02:00
Magnus Norddahl
763c5c9769
- change ssao pass to use an uniform block
2018-06-11 20:48:43 +02:00
Christoph Oelckers
cce6c9a085
- fixed precision issue with dot product.
...
Apparently the shader math is not precise enough to ensure that two supposedly orthogonal vectors are truly orthogonal, resulting in a non-zero dot product
2018-05-24 20:31:44 +02:00
Christoph Oelckers
1266339c0f
- fixed shader compilation.
2018-05-19 21:17:58 +02:00
Christoph Oelckers
3dc6ddbcc3
- check light direction in the shader.
...
There are situations where lights on the wrong side of a linedef may be passed and those need to be skipped in the shader code.
2018-05-19 19:20:45 +02:00
Christoph Oelckers
286846a8ec
2D must consider brightmaps.
2018-04-27 08:59:59 +02:00
Christoph Oelckers
94e8d59dde
- implemented shader support for rendering the SW renderer canvas with legacy OpenGL.
2018-04-08 13:05:20 +02:00
Christoph Oelckers
221beec979
- added palette shader and fixed a few things.
2018-04-07 12:17:23 +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
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
832df6d43a
- implemented desaturation for the legacy GL renderer's 2D.
...
A lot of work that's only needed to be able to use the hardware renderer's 2D code with the software renderer.
2018-03-30 18:14:42 +02:00