1
0
Fork 0
Commit graph

55 commits

Author SHA1 Message Date
Fernando García Liñán
f53a170539 HDR: Better bloom effect
We also now pre-expose our lighting before writing to the HDR buffers.
This solves some precision issues and prevents the Sun from producing
infinite values.
2023-04-13 00:30:02 +02:00
Fernando García Liñán
8af67bfb2f HDR: Complete refactoring of shader style and naming
See https://wiki.flightgear.org/Shader_Style_Guide.
2023-04-11 15:53:47 +02:00
Fernando García Liñán
c4d19877cf HDR: Significant update
- New atmosphering rendering technique based on my own work.
- Attempt to fix some remaining transparency issues.
- Use a luminance histogram for auto exposure.
- Add support for clustered shading.
- Add WS 2.0 shaders.
- Add 3D cloud shaders.
- Add orthoscenery support.
2023-04-06 00:18:29 +02:00
Fernando García Liñán
96a6e6c9bf HDR: Implement GTAO (Ground Truth Ambient Occlusion) 2021-09-01 04:26:03 +02:00
Fernando García Liñán
3459e7ddfe HDR: Use gl_VertexID instead of the MVP matrix in fullscreen passes 2021-08-31 18:02:38 +02:00
Fernando García Liñán
9f39644199 HDR: Optimize the G-Buffer and do not separate the occlusion texture
- The G-Buffer layout has been redesigned to be 96 bits per pixel. There are 24
unused bits that can be used for extra material parameters later (like
clearcoat).
- Add better debug views for the G-Buffer.
- Use octahedron normal encoding. This yields the same results as the previous
method but uses 16 bits less.
- Use rg11fb10f for the environment mapping cubemaps.
- Tweak the shadow mapping parameters and add a colored debug mode.
- Only render shadow maps for objects that inherit from model-default.eff or
model-pbr.eff instead of having a fallback Effect. Now transparent objects
should be ignored (if they are marked as such with model-transparent or
similar).
- Remove the separate occlusion texture. Now the PBR Effect expects a single
texture where R=occlusion, G=roughness and B=metallic.
2021-08-27 00:03:43 +02:00
Fernando García Liñán
9983a0c68c HDR: Water rendering 2021-08-25 04:17:09 +02:00
Fernando García Liñán
eea955168e HDR: Organize shadow-related files and add screen space shadows 2021-08-24 23:38:56 +02:00
Fernando García Liñán
eed433ce9f HDR: Use stencil buffer for optimization purposes 2021-08-23 12:44:26 +02:00
Fernando García Liñán
8662ce0a86 HDR: Add SMAA as the default antialiasing technique 2021-08-23 01:05:41 +02:00
Fernando García Liñán
212f8fdab9 HDR: Add support for glTF transparent objects 2021-08-19 01:42:32 +02:00
Fernando García Liñán
f5bc6df9fb HDR: Use a reversed depth buffer to increase precision and avoid Z-fighting 2021-08-17 20:58:48 +02:00
Fernando García Liñán
f16372ac7e HDR: Add property to show debug views of the GBuffer 2021-08-16 21:51:37 +02:00
Fernando García Liñán
4d34115177 HDR: Increase maximum distance of aerial perspective 2021-07-31 19:13:19 +02:00
Fernando García Liñán
526491790e HDR: Improve envmap pre-filtering 2021-07-31 19:13:19 +02:00
Fernando García Liñán
871654c16f HDR: Better handling of the Sun
Add transmittance to the Sun illuminance value to get correct colors at every time of day.
Also improved the Sun disk rendering.
2021-07-31 19:13:19 +02:00
Fernando García Liñán
46b1cd62f7 Fix shadows on Mac OS 2021-07-29 15:49:43 +02:00
Fernando García Liñán
af29642423 HDR: miscellaneous changes
- Add an utility linearizeDepth function to help visualize the depth buffer for debug purposes.
- Use 'color0' instead of 'color' for all color attachments.
- Do not write to the HDR buffer if a fragment doesn't need shading (depth = 1).
2021-07-29 08:45:17 +02:00
Fernando García Liñán
9b9ae5cf38 HDR pipeline: even better atmospheric scattering
Implementation of "A Scalable and Production Ready Sky and Atmosphere Rendering Technique" by Sébastien Hillaire (2020).
2021-07-28 09:40:04 +02:00
Fernando García Liñán
016585e176 HDR pipeline: Use MRT to prefilter the environment map 2021-07-26 17:21:20 +02:00
Fernando García Liñán
873ae6b3d5 Add clear masks to all compositor passes 2021-07-26 17:21:20 +02:00
Fernando García Liñán
9eaef501c7 HDR pipeline: a lot of improvements to atmospheric scattering 2021-07-26 12:11:37 +02:00
Fernando García Liñán
d58ab0d82c Change all Compositor passes implicit attachments
The default implicit attachments are color and depth now.
2021-07-24 19:23:10 +02:00
Fernando García Liñán
784c89dd61 HDR pipeline: do not use the r11g11b10f format
Not every GPU supports it under a compatibility context. This is an optimization to reduce bandwidth anyway, so we should be fine using rgb16f for now.
2021-07-24 07:04:39 +02:00
Fernando García Liñán
96313e7eb0 Initial commit of the HDR pipeline 2021-07-23 07:46:05 +02:00
Fernando García Liñán
9a9ece5054 Do not let OSG implicitly attach a color renderbuffer to the shadowmap pass 2021-05-24 23:52:02 +02:00
Fernando García Liñán
04f2ccc16b Support choosing the number of lights being displayed 2021-04-01 03:16:08 +02:00
Fernando García Liñán
21a6e20701 Tweak shadow offset parameters and cascade ranges
This should hopefully fix some shadow acne edge cases.
2021-01-05 11:24:19 +01:00
Fernando García Liñán
a5e8ffa450 Use a 16 bit depth texture for the shadow map 2021-01-05 11:23:36 +01:00
Fernando García Liñán
916322d0ed Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
Fernando García Liñán
7158dfdff3 Revert "Add clustered shading support to most Effects and shaders"
This reverts commit b3237e207a.
2020-12-22 17:22:05 +01:00
Fernando García Liñán
b3237e207a Add clustered shading support to most Effects and shaders 2020-12-22 10:53:31 +01:00
Fernando García Liñán
00b465b84f Decrease shadow mapping bias and better 3rd cascade depth range 2020-12-06 14:44:03 +01:00
Fernando García Liñán
a3a8f9123e Make Compositor default
- Remove all Compositor Effects and Shaders.
- Unify the low-spec and ALS pipelines in a single pipeline called 'Classic'.
- Readd shadow mapping.
- Move the WS30 Effect and fragment shader out of the Compositor-specific directories.
2020-11-16 13:46:30 +01:00
Stuart Buchanan
3cace276d2 WS3.0: Add tile_level, tile_width, tile_height
Add Uniforms to WS3.0 fragment shader to provide
LoD information and make sampling of adjacent points
in the landclass texture easier.
2020-11-14 21:04:30 +00:00
Stuart Buchanan
605f0e3c74 WS3.0: Add forest texture to shader
Interm shader update until texture array support available.
2020-11-12 20:47:08 +00:00
Stuart Buchanan
4aff635cdb WS3.0: Initial commit of WS3.0 rendering 2020-11-08 22:44:34 +00:00
Stuart Buchanan
d9244ac724 Fix interior effect for Compositor ALS model<2
Compositor/ALS/generic-base.vert requires shadows-include.vert
2020-05-26 20:26:05 +01:00
Stuart Buchanan
414188138d Fix terrain-overlay under Compositor/ALS
Previously this rendered as black.

Fix from Thorsten Renk and vnts on the forum.

https://forum.flightgear.org/viewtopic.php?f=5&t=37161&p=368384#p368384
2020-05-23 18:48:48 +01:00
Stuart Buchanan
10d7165c54 Set correct depth ranges for randing buildings
Unlikely that we'll enable shadows for them, but they
should have logarithmic depth set anyway.
2020-04-13 17:56:49 +01:00
Stuart Buchanan
1d877850b9 Fix OSM2city buildings for Compositor using model shader
Previously osm2city buildings did not render under the
Compositor/ALS pipeline with /sim/rendering/shaders/model>0

Now it does.  Thanks to merspieler for assistance in
diagnosing the problem.
2020-04-13 17:17:45 +01:00
Fernando García Liñán
c0e2b243f6 Compositor: Fix EarthView with ALS pipeline 2020-04-04 18:12:20 +02:00
Fernando García Liñán
e1e0cf5997 Compositor: Port remaining ALS Effects to use a logarithmic depth buffer 2020-04-04 17:57:33 +02:00
Fernando García Liñán
f0ee8f23d2 Compositor: Use #version 140 for clustered shading
This fixes compatibility issues with AMD graphics cards that support a OpenGL
3.1 compatibility profile. Integrated Intel GPUs using the Mesa drivers should set the environment variable:
MESA_GL_VERSION_OVERRIDE="3.1COMPAT"
2020-04-02 21:32:05 +02:00
Fernando García Liñán
6ef32c6dac Compositor: Use depth partitioning in the low spec pipeline. 2020-03-30 19:24:04 +02:00
Stuart Buchanan
9e7afc7291 Fix random buildings in Compositor
Update Compositor Effects and Shaders with latest random/osm2city
buildings implementation.
2020-03-28 14:27:08 +00:00
Fernando García Liñán
84f0530a1d Compositor: Use a logarithmic depth buffer in the ALS pipeline.
This might not be a definitive solution to fix z-fighting issues, but it's a
good solution meanwhile and can be implemented easily on any shader just by
adding a few lines.
2020-03-22 17:27:12 +01:00
Fernando García Liñán
dd2ac0a32e - Changed location of Compositor pipelines.
- 1-bit transparency for shadow mapping.
- Several effects ported to the Compositor.
- Miscellaneous fixes to Compositor Effects.
2020-03-22 17:27:12 +01:00
Fernando García Liñán
d3e3c55fd6 Compositor: Initial support for clustered shading under the ALS pipeline 2020-03-22 17:27:12 +01:00
Fernando García Liñán
daeea22999 Compositor: Added shadow mapping to the ALS pipeline 2019-11-03 20:52:22 +01:00