1
0
Fork 0
fgdata/Effects
Stuart Buchanan 3261f4a97c WS30: MR #267: Improved texture lookups from VS
Squashed commit of the following:

commit 115511888c20c53670eba17a82c81c9af99d7302
Author: vs <vs2009@mail.com>
Date:   Mon Dec 6 18:52:06 2021 +1000

    WS30 effects and shaders:

    Changelog:

    ws30-ALS-ultra.frag:

    - Ground textures lookups use their own coordinates separate from the landclass  texture lookup.

    - Partial derivatives dFdx and Dfdy are packed together in a vec4, so simple   multiplication to scale can be done in 1 instruction. dFdx = s and t components. dFdy  = p and q components. These must be scaled properly for ground texture access as ground  texture stretching and detiling of tex coords mean textures are scaled differently.

    - Added calculation of partial derivatives for texture coordinates used by the 5 non- base textures. dFdx() and dFdy() were called for nontrivial texture coordinate manipulation.

    - New control randomise_texture_lookups added at top of ws30-ALS-ultra.frag, in the  development tools section. Setting this to 1 will do a stress test of ground texture  array lookups. A fast random number generation function is used to assign each  landclass 4 random textures from the ground texture array - this is done by .  Performance will not be as bad in the full ALS port as some texture slots will better caching in memory - e.g. have 1 or a few variants.

    - Possible optimisation: use a 2nd or 3rd texture array for some of the non-base  texture slots that typically have 256, 512, or 1024 textures. The resolutions of these  arrays should change based on the largest loaded texture size in the active regional  definitions - this will allow taking full advantage of smaller texture sizes in some  areas. The disadvantage is some texture duplication with more slots.

    - Possible optimisation: offer the option to shrink textures by 50% or 25% - for  texture slots that use large textures like base or mix slots.

    - Very temporary - reduce procedural normal map features with photoscenery active  without breaking profiling, as the inputs to shaders are effect defaults or  placeholder (by request on ML).

    ----

    ws30-ALS-ultra.vert:
    - Start of conversion of geocentic world space xyz into lat/lon coords used for ground  texture lookups. Currently commented out as it's unknown what model space coords are  in (not geocentric it seems).

    ws20-ALS-landclass-search-functions.frag:

    - Add control for changing the ground texture array lookup function for debugging in  case old compilers/GPUs have issues. tex_lookup_type: 0: normal( textureGrad(), 1:  textureLod (manual Lod calculation), 2: texture() with no partial derivative  adjustment.

    - New get6_random_integers() will extract 6 limited random values from the full  precision of a 32 bit random value.

    - Old landclass_texel_size_m references are removed since textureSize() is used. There  are no 'const in float' arguments that may cause issues on AMD compilers.

    ----

    WS30-overlay effect (Inactive):

    - ws30-overlay.eff (derived from terrain-overlay.eff). Technique no "4" is used for two passes. The 1st pass is a copy of the ALS ultra pass (technique no "5") from ws30.eff.  The 2nd pass is the same as terrain-overlay.eff. The 2nd pass uses terrain- overlay.frag from WS2.

    - grass-ALS.vert copied to ws30-ovelay-ALS.vert. To do: needs texture coords that  don't change with tiles.

    - terrain-overlay-ALS.geom copied to ws30-overlay-ALS.geom. To do: uses gl_PositionIn [i].xy for position in the horizontal plane - assumes z is vertical. Tile model space  doesn't seem to match this.

    - WS3 doesn't seem to have a way of switching references to terrain-overlay.eff (which  inherits from terrain-default.eff) to the new ws3-overlay.eff (which needs to inherit  from ws30.eff). The ws3-overlay.eff included /might/ just work without any other changes: the first pass is the WS3 als ultra settings pass, and the second overlay pass is unchanged from WS2 (the same terrain overlay shaders should probably work apart from texcoords and rawpos not being correct).

    - Materials/base/materials-base.xml: ws30Road material: uncomment line declaring terrain-default as the effect. The target effect for ws30 roads is road-*.eff and it's added to ws30Road and ws30Freeway but commented out as it's not working currently.

    - Misc: large scale transitions are turned on in ws30-ALS-landclass-search-functions.frag by default. Grow landclass borders with large scale transitions is now on by default.

    ----

    Changes after the multi-texture support commit:

    ws30-ALS-ultra.vert

    - Added documentation: WS30 model space and z up space - for future people working on WS30, and people looking through shaders to rule out possibilities e.g. when fixing bugs, or interpreting visual bug reports.

    ws30-ALS-landclass-search-functions.frag:

    - For now, lookup_ground_texture_array() also looks up the relevant texture's index  based on an integer.

    - Add get_mixed_texel() - looks up texel for this fragment and any neighbors before mixing. Moves currently shared mixing code out of 3 fragment shaders.

    Misc: changed indentation from mixed tabs/spaces to spaces in ws30-ALS-ultra frag and vert. The indentation can be changed again when the porting is complete.

    ws30-ALS vert/frag and ws30-ALS-detailed vert/frag:

    - Add varying for ground texture coordiante, currently set to gl_TexCoord[0]. Apply texture stretching dimensions in fragment shaders.

    - Misc: varying rawPos is set to vec2 for now, as relPos.z+eye_alt might be faster. Misc: keep WS2 mixing logic for now , including turning off mixing via the alpha channel of the textures

    ----

    Changes after sending material parameters in uniform arrays commit:

    - Materials parameter for rock_strata is cast into an int so rock_strata==1 should work. Misc: Left over uniform for rock strata cleaned up.

    - ws30-ALS-ultra.frag and ws30-ALS-detailed.frag: Add missing mat_shininess for photoscenery case .
2022-01-03 15:43:29 +00:00
..
Fallback HDR: Organize shadow-related files and add screen space shadows 2021-08-24 23:38:56 +02:00
HDR HDR: Implement GTAO (Ground Truth Ambient Occlusion) 2021-09-01 04:26:03 +02:00
agriculture.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
airfield.eff Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
birdswarm.eff ALS urban shader development, minor fixes 2016-08-08 09:19:22 +03:00
bowwave.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
building.eff Simplify building.eff, fix lack of orthoTexCoord 2021-04-25 21:36:02 +01:00
bumpspec.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
chrome.eff HDR: Use gl_VertexID instead of the MVP matrix in fullscreen passes 2021-08-31 18:02:38 +02:00
chute.eff Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
cityLM.eff Maintenance: cityLM Effort 2021-02-27 00:26:39 -06:00
cliffs.eff Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
cloud-impostor.eff More infrastructure for perception filtering of moonlight 2017-11-13 10:27:25 +02:00
cloud-models.eff Revert "UniformFactory: merge current uniform per <name> of effect" 2014-11-16 22:09:41 +01:00
cloud-noctilucent.eff More infrastructure for perception filtering of moonlight 2017-11-13 10:27:25 +02:00
cloud-static.eff ALS: Detailed scattering model for light on Cirrus clouds 2018-09-01 09:42:34 +03:00
cloud.eff ALS: New cloud rendering detail level with more dramatic Mie scattering at cloud fringes done inside fragment shader 2018-08-30 09:17:36 +03:00
clouds-box.eff Revert "UniformFactory: merge current uniform per <name> of effect" 2014-11-16 22:09:41 +01:00
clouds-layered.eff Revert "UniformFactory: merge current uniform per <name> of effect" 2014-11-16 22:09:41 +01:00
clouds-thick.eff Revert "UniformFactory: merge current uniform per <name> of effect" 2014-11-16 22:09:41 +01:00
clouds-thin.eff Revert "UniformFactory: merge current uniform per <name> of effect" 2014-11-16 22:09:41 +01:00
clouds-thinlayer.eff Revert "UniformFactory: merge current uniform per <name> of effect" 2014-11-16 22:09:41 +01:00
crop.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
cropgrass.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
dirt-runway.eff Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
flutter.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
forest.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
glacier.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
glass.eff HDR: Better technique ordering 2021-08-31 18:42:21 +02:00
grass.eff Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
herbtundra.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
hud.eff Another ALS HUD bugfix, cannot have two uniforms named the same 2017-04-19 09:52:53 +03:00
landmass-nowood.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
landmass-scrub.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
landmass.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
lfeat.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
light-cone.eff Revert "UniformFactory: merge current uniform per <name> of effect" 2014-11-16 22:09:41 +01:00
light-point.eff Make Compositor default 2020-11-16 13:46:30 +01:00
light-spot.eff Make Compositor default 2020-11-16 13:46:30 +01:00
lightmap.eff Fix inherits-from breaking lightmap.eff fallback 2021-04-22 10:29:59 +01:00
lightning.eff More work on rendering lighting in ALS, public domain NOAA image resources are gratefully acknowledged 2015-08-12 11:31:05 +03:00
material-diffuse.eff Revert "UniformFactory: merge current uniform per <name> of effect" 2014-11-16 22:09:41 +01:00
material-off.eff Revert "UniformFactory: merge current uniform per <name> of effect" 2014-11-16 22:09:41 +01:00
model-combined-deferred.eff Make Compositor default 2020-11-16 13:46:30 +01:00
model-combined-transparent.eff Better handling of transparent objects in Classic 2021-08-31 18:25:28 +02:00
model-combined.eff HDR: Use stencil buffer for optimization purposes 2021-08-23 12:44:26 +02:00
model-default.eff HDR: Optimize the G-Buffer and do not separate the occlusion texture 2021-08-27 00:03:43 +02:00
model-interior-display.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
model-interior.eff Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
model-pbr-transparent.eff HDR: Better technique ordering 2021-08-31 18:42:21 +02:00
model-pbr.eff HDR: Better technique ordering 2021-08-31 18:42:21 +02:00
model-transparent.eff HDR: Better technique ordering 2021-08-31 18:42:21 +02:00
model-wingflex.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
planet-aurora.eff Earthview 2.1 - parallax mapping for cloud layer, lightning at night, Rayleigh scattering in atmosphere and minor bugfixes 2017-04-05 16:50:31 +03:00
planet-cloudlayer.eff Remove requests to generate normals as these are no-ops, because 2020-05-03 07:29:34 +01:00
planet.eff Remove requests to generate normals as these are no-ops, because 2020-05-03 07:29:34 +01:00
procedural-light.eff Procedural aircraft lights for ALS - WIP 2016-02-03 09:13:30 +02:00
rain-layer.eff Groundwork for ALS g-force blackout filter, WIP 2017-03-03 19:50:13 +02:00
reflect-bump-spec.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
reflect.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
road-high.eff osm2city building, road, railway materials. 2017-05-09 14:16:44 +01:00
road-low.eff osm2city building, road, railway materials. 2017-05-09 14:16:44 +01:00
road-mid.eff osm2city building, road, railway materials. 2017-05-09 14:16:44 +01:00
road.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
rock.eff Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
runway-dds.eff Revert "UniformFactory: merge current uniform per <name> of effect" 2014-11-16 22:09:41 +01:00
runway.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
scenery-lights.eff Fixed FOV side effect on light sprite size. 2021-09-04 13:41:02 +03:00
schemes.xml HDR: Optimize the G-Buffer and do not separate the occlusion texture 2021-08-27 00:03:43 +02:00
shadow-vol.eff Make Compositor default 2020-11-16 13:46:30 +01:00
shadow.eff Make Compositor default 2020-11-16 13:46:30 +01:00
skydome.eff HDR: Organize shadow-related files and add screen space shadows 2021-08-24 23:38:56 +02:00
space-combined.eff ALS model shader: allow dirt overlay to change surface reflectivity, add grain merge reflection type to space shader 2017-06-18 09:35:32 +03:00
space.eff Experimental additional lighting options for ALS model shaders 2016-07-31 10:29:02 +03:00
stars.eff HDR: Better technique ordering 2021-08-31 18:42:21 +02:00
surface-lights-directional.eff Extend ALS flitering to more effects 2016-03-18 09:32:34 +02:00
surface-lights.eff Extend ALS flitering to more effects 2016-03-18 09:32:34 +02:00
terrain-default.eff Fix to overlays issue 2648 2021-12-05 14:09:27 +00:00
terrain-overlay.eff Fix to overlays issue 2648 2021-12-05 14:09:27 +00:00
text-default.eff Add shaders for osgText 2021-05-14 22:45:36 +02:00
thrust-flame.eff Bugfix and noise seed option for ALS thrust flame shader 2017-04-17 10:30:49 +03:00
transition-base-dirt.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
transition-base-grass-inverse.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
transition-base-grass-rock.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
transition-base-rock.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
transition.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
tree-european-deciduous.eff European deciduous trees change autumn color in ALS 2015-02-18 10:35:00 +02:00
tree-european-mixed.eff European deciduous trees change autumn color in ALS 2015-02-18 10:35:00 +02:00
tree-forest.eff Prepare ALS tree shader for filtering, add functionality for (optional) agressive optimization 2016-03-26 09:02:51 +02:00
tree-grass.eff Random vegetation shadows for ALS 2015-02-20 09:55:13 +02:00
tree.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
urban.eff Reduce shader complexity and implement graphics presets 2021-03-31 04:05:34 +02:00
water-dds.eff Revert "UniformFactory: merge current uniform per <name> of effect" 2014-11-16 22:09:41 +01:00
water-inland.eff Cleanup: 2021-05-10 11:52:28 +02:00
water.eff Add object shadows to water 2021-12-05 14:15:27 +00:00
ws30-overlay.eff WS30: MR #267: Improved texture lookups from VS 2022-01-03 15:43:29 +00:00
ws30.eff WS30: MR #267: Improved texture lookups from VS 2022-01-03 15:43:29 +00:00
ws30water.eff HDR: Water rendering 2021-08-25 04:17:09 +02:00