1
0
Fork 0
Commit graph

658 commits

Author SHA1 Message Date
Stuart Buchanan
63487bbe7b WS30 ultra shader - port ambient lighting fix
commit aca259acaccffbaf1cb264be423dda72c106150e
Author: vs <vs2009@mail.com>
Date:   Sat Oct 23 22:55:56 2021 +1000

    WS30 shaders: varying fix

commit 91b194f6766d432206cb013d99e0a96cd34ff33b
Author: vs <vs2009@mail.com>
Date:   Sat Oct 23 22:17:03 2021 +1000

    WS30 ultra shader: port the ambient lighting fix.
2021-10-24 21:36:39 +01:00
Stuart Buchanan
fc42ef3fe4 WS30: Include ambient light in ALS fragment shader
Previously only the diffuse term was considered in the fragment
shader, leading to very dark scenery and deep shadows.

Now the ambient light term is also included making the scenery
much closer to the way it should be lit.
2021-10-21 21:34:53 +01:00
Stuart Buchanan
0bce3c966f WS30: landclass and texture lookups in fragment shader
commit e131ffaca7b2c934474f0e447b5852cb4c7c8d4a
Author: vs <vs2009@mail.com>
Date:   Fri Oct 15 22:19:42 2021 +1000

    WS30: landclass and texture lookups in fragment shader:

    Changelog:

    - Testing: Procedural random landclass function, get_random_landclass(). 1). Avoids a texture lookup for   profiling. 2). Creates squares of configurable size with controllable random landclass ranges - to test   landclass transition algorithms and quickly profile lots of landclasses in view. It's also possible to put   pressure on GPU memory even with 1 lookup of ground textures per fragment, by reducing size to <20m and   viewing from altitude.

    - Add ALS ultra technique as no 5, move existing ALS technique to no. 6. Add WS30-ALS-ultra frag & vert in   preparation for eventual ALS ultra port. Change comments/variables to match using a texture array instead   of atlas. Sampler name: atlas -> textureArray.

    - Testing/optimisation of de-tiling: WS30-ALS.frag: reorder perlin detiling to make noise source easier to   switch. WS30-ALS-ultra.frag: Create alternative to perlin noise used for reducing tiling that avoids a   texture lookup - to profile and optimise. This is commented out. The performance difference in the final  version depends on memory pressure versus arithmetic load of the full shader. It varies by GPU and what's  in view. In future, once a full ALS  port is done, maybe it'll be more efficient to run a higher quality  de-tiling algorithm all the time to avoid branching overhead due to effects like agriculture which need  more de-tiling. De-tiling code in shaders should /eventually/ match CPU-side de-tiling of texture masks  used for object and vegetation placement. De-tiling code in GPUs might be subject to precision and  numerical artifacts, and if so maybe the texture lookup version would work better. The same applies to  noise used for rendering WS3 water waves and collision queries. One option is to use exactly the same glsl  code, with a C++ header to convert glsl syntax e.g. https://github.com/g-truc/glm .
2021-10-21 21:31:03 +01:00
Fahim Imaduddin Dalvi
ae119f29cf Fixed FOV side effect on light sprite size.
The light sprite diminished to zero size as the FOV was decreased
(in sim zoom), and increased considerably as the FOV was increased.
This commit fixed this by taking the FOV into account to keep the light
sprite size roughly constant across the valid FOV range.
2021-09-04 13:41:02 +03: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
a789c24209 HDR: Fix model-combined when not using a normal map 2021-08-25 16:49:08 +02:00
Fernando García Liñán
beb4381ad1 HDR: Fix model-combined objects without normal maps 2021-08-25 15:16:38 +02:00
Fernando García Liñán
aaf6bb9309 HDR: Improve ACES tone mapping curve
The previous one tended to over-expose the final image.
2021-08-25 15:15:57 +02:00
Fernando García Liñán
55410e9d35 HDR: Port chrome.eff 2021-08-25 14:32:22 +02:00
Fernando García Liñán
356ff8ff34 Fix indentation 2021-08-25 04:25:09 +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
b79d09d45f HDR: Prevent materials with roughness=0 from blowing out the lighting 2021-08-22 18:01:30 +02:00
Stuart Buchanan
a442615c68 WS30: Fix WS30 fragment shaders 2021-08-21 17:15:15 +01:00
Fernando García Liñán
b52fe3bf34 HDR: Remove glass.eff minimum alpha hack 2021-08-19 20:19:55 +02:00
Fernando García Liñán
7ff31e9004 HDR: Properly handle AC3D transparent materials 2021-08-19 18:20:37 +02:00
Fernando García Liñán
765a7d88f5 HDR: Use precomputed uniforms in the skydome shader 2021-08-19 14:06:25 +02:00
Fernando García Liñán
94f4007793 HDR: Use precomputed uniforms for atmospheric scattering 2021-08-19 12:50:16 +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
05994100ea HDR: Better handling of model-combined for backwards compatibility 2021-08-18 12:27:03 +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
13df616ca6 HDR: Support glTF models 2021-08-16 17:10:01 +02:00
Fahim Imaduddin Dalvi
81af0f37c2 Shader-based scenery lights.
This commit implements shader-based scenery lights with support for
efficient rendering of a large number of lights, animations and
directionality. Detailed commit log can be found at [1]. Detailed
discussions can be found on the mailing list [2][3][4].

[1] https://sourceforge.net/u/fahimdalvi/fgdata/ci/feat/scenery-shader-lights/~/tree/
[2] (Timed animation stops working in certain configurations) https://sourceforge.net/p/flightgear/mailman/flightgear-devel/thread/4A7AC359-63B3-4D8A-815B-09823BCEFF27%40gmail.com/#msg37095923
[3] (Shader-based scenery lights) https://sourceforge.net/p/flightgear/mailman/flightgear-devel/thread/63E3C131-7662-4F59-B2E6-03208C78EF96%40gmail.com/#msg37190517
[4] (Shader-based scenery lights Part 2) https://sourceforge.net/p/flightgear/mailman/flightgear-devel/thread/74F18179-CA34-4901-A44E-15498ECC230A%40gmail.com/#msg37331695
2021-08-07 21:42:20 +03: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
467468ef3a HDR: Improve exposure and bloom handling 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
5c1c28c536 HDR: Improve PBR Effect 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
a00f7ddfaf HDR: Fix Earth appearing to be "rounder" than normal
We have to compensate for the fact that the sky-view LUT contains the view from the camera, but the skydome remains fixed on the ground.
2021-07-29 11:55:01 +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
760db3ba6d HDR: gracefully handle situations where the viewer is below the ground 2021-07-28 11:37:33 +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
James.Hester
c6b526f343 Create overlay mixing scales based on texture scale. 2021-07-26 11:13:00 +01: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
1215f1eba2 HDR pipeline: add placeholder shaders for WS 3.0 2021-07-24 13:35:53 +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
d15b61e9b5 Reorganize the shadow mapping functions
- Removed the multiple return statements, as they can be problematic with older GLSL 120 compilers
- Removed debug flags
- Moved code to separate functions for readability
- Reduced the band size to 0.1 to make more use of the higher quality cascades
2021-06-17 18:18:27 +02:00
Fernando García Liñán
49fa42faac Add shaders for osgText 2021-05-14 22:45:36 +02:00
Erik Hofman
8c01478ed8 It's now possible to create a overrides of water colour and shallowness for waterbodies through regional definitions. Note: Overrides are constant and apply throughout the waterbody. This is mainly useful for inland waterbodies.
- Added overrides as parameter values for: water floor_colour (vec3 RBG colours. Range: 0 to 1. Defaults: old inland map colour, a blue ocean colour.), water_shallowness (Same as depth map texture. Range: 0 to 1. Defaults: 1.0 inland, 0.7 ocean). The corresponding texture lookup branches are also gated by these uniform flags for performance reasons.
2021-05-10 11:52:45 +02:00
Erik Hofman
3ae3f95abd Use the alpha channel of the depth map 2021-05-09 14:26:18 +02:00
Erik Hofman
055ce55be4 Use a Gray-Alpha texture for water depth information and use the globe-colors.jpg texture for water color. 2021-05-07 15:14:56 +02:00
Erik Hofman
79e1ca771f Perfect the water depth calculation based on water colors 2021-05-03 14:36:07 +02:00
Erik Hofman
d145a52ac1 I forgot that the ocean depth was in the alpha channel but work around that by using the RGB colors to do the same 2021-05-02 13:01:52 +02:00
Fernando García Liñán
23f908665f Fix random buildings shader errors 2021-04-16 07:46:35 +02:00
Fernando García Liñán
4099044b65 Fix incorrect lightmap intensity with lightmap-multi=0 2021-04-15 11:12:07 +02:00