1
0
Fork 0
fgdata/Shaders
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
..
HDR WS30 - Uniform Arrays and lighting model 2021-11-10 22:58:44 +00:00
3dcloud-ALS-detailed.frag 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
3dcloud-ALS-detailed.vert 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
3dcloud-ALS.frag Add missing shader version tags for the other shaders too 2016-08-03 09:59:29 +02:00
3dcloud-ALS.vert More infrastructure for perception filtering of moonlight 2017-11-13 10:27:25 +02:00
3dcloud.frag Add missing shader version tags for the other shaders too 2016-08-03 09:59:29 +02:00
3dcloud.vert Fix for black clouds on ATI (bug 1160) 2013-12-25 23:14:04 +00:00
agriculture-ALS.frag Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
airfield-ALS.frag Implement a simple snow shader for the low quality levels 2021-01-19 11:10:44 +01:00
birds-ALS.frag Add missing shader version tags for the other shaders too 2016-08-03 09:59:29 +02:00
birds-ALS.vert ALS bird shader 2016-04-30 21:27:28 +03:00
bowwave-ALS.frag Filtering for most remaining ALS shaders 2016-04-06 09:26:49 +03:00
building-ALS.vert Fix random buildings shader errors 2021-04-16 07:46:35 +02:00
building-default.vert Fix random buildings shader errors 2021-04-16 07:46:35 +02:00
building-model-ALS-ultra.vert Fix shader-based buildings on AMD/macOS 2021-01-22 20:59:34 +00:00
chute-ALS.vert Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
cliffs-ALS.frag Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
cloud-impostor-ALS.vert More infrastructure for perception filtering of moonlight 2017-11-13 10:27:25 +02:00
cloud-noctilucent-ALS.vert More infrastructure for perception filtering of moonlight 2017-11-13 10:27:25 +02:00
cloud-shadowfunc.frag Some fixes for the ALS overlay shader 2017-09-18 12:47:21 +03:00
cloud-static-ALS-detailed.frag ALS: Fix rainbow fringing order in Cirrus clouds 2018-09-05 09:20:20 +03:00
cloud-static-ALS-detailed.vert ALS: Detailed scattering model for light on Cirrus clouds 2018-09-01 09:42:34 +03:00
cloud-static-ALS.frag Add missing shader version tags for the other shaders too 2016-08-03 09:59:29 +02:00
cloud-static-ALS.vert More infrastructure for perception filtering of moonlight 2017-11-13 10:27:25 +02:00
cloud-static.frag Add missing shader version tags for the other shaders too 2016-08-03 09:59:29 +02:00
cloud-static.vert Local Weather 1.4 by Thorsten Renk : fixes lots of graphical errors and transparency issues and provides a consistent GUI. 2012-01-03 20:21:34 +01:00
clouds-box.frag Add missing shader version tags for the other shaders too 2016-08-03 09:59:29 +02:00
clouds-box.vert Robert (dogg360): make shaders work for AMD/ATI graphics (#96,#335 related) 2011-07-04 20:20:26 +02:00
clouds-layered.frag Add missing shader version tags for the other shaders too 2016-08-03 09:59:29 +02:00
clouds-layered.vert Robert (dogg360): make shaders work for AMD/ATI graphics (#96,#335 related) 2011-07-04 20:20:26 +02:00
clouds-test.frag Add missing shader version tags for the other shaders too 2016-08-03 09:59:29 +02:00
clouds-test.vert Robert (dogg360): make shaders work for AMD/ATI graphics (#96,#335 related) 2011-07-04 20:20:26 +02:00
clouds-thick.frag Add missing shader version tags for the other shaders too 2016-08-03 09:59:29 +02:00
clouds-thick.vert Robert (dogg360): make shaders work for AMD/ATI graphics (#96,#335 related) 2011-07-04 20:20:26 +02:00
clouds-thin.frag Add missing shader version tags for the other shaders too 2016-08-03 09:59:29 +02:00
clouds-thin.vert Robert (dogg360): make shaders work for AMD/ATI graphics (#96,#335 related) 2011-07-04 20:20:26 +02:00
clouds-thinlayer.frag Add missing shader version tags for the other shaders too 2016-08-03 09:59:29 +02:00
clouds-thinlayer.vert Robert (dogg360): make shaders work for AMD/ATI graphics (#96,#335 related) 2011-07-04 20:20:26 +02:00
clustered-include.frag Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
color_temperature.frag Changing file permissions to remove execute bit 2020-09-02 09:42:36 +02:00
default.frag Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
default.vert Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
drunway-ALS.frag Implement a simple snow shader for the low quality levels 2021-01-19 11:10:44 +01:00
filters-ALS.frag Added dithering as an ALS post-processing effect to prevent banding 2019-04-21 18:53:19 +02:00
filters-ALS.vert ALS - begin infrastructure for moonlight perception filtering 2017-06-18 10:08:39 +03:00
flutter-ALS.vert Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
generic-ALS-base.vert Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
glass-ALS.frag Fix incorrect lightmap intensity with lightmap-multi=0 2021-04-15 11:12:07 +02:00
glass-ALS.vert Add an appropriate version number to all vertex shaders 2016-08-05 13:16:23 +02:00
grass-ALS.frag Make Compositor default 2020-11-16 13:46:30 +01:00
grass-ALS.geom Make Compositor default 2020-11-16 13:46:30 +01:00
grass-ALS.vert Changing file permissions to remove execute bit 2020-09-02 09:42:36 +02:00
hazes.frag Add missing shader version tags for the other shaders too 2016-08-03 09:59:29 +02:00
hud-ALS.frag Fix incorrect lightmap intensity with lightmap-multi=0 2021-04-15 11:12:07 +02:00
hud-ALS.vert ALS HUD effect approximating the appearance of light projected on the combiner 2017-02-24 09:28:54 +02:00
include_fog.frag Add missing shader version tags for the other shaders too 2016-08-03 09:59:29 +02:00
include_fog.vert Add an appropriate version number to all vertex shaders 2016-08-05 13:16:23 +02:00
light-ALS.frag Make ALS procedural light shader palatable to nouveau driver 2017-09-01 12:57:11 +03:00
light-ALS.vert Procedural aircraft lights for ALS - WIP 2016-02-03 09:13:30 +02:00
lightspot-ALS.frag ALS lightspot second projectable spot correction. 2016-10-05 14:47:44 -05:00
model-ALS-base.frag Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
model-ALS-ultra.frag Fix incorrect lightmap intensity with lightmap-multi=0 2021-04-15 11:12:07 +02:00
model-ALS-ultra.vert Make Compositor default 2020-11-16 13:46:30 +01:00
model-ALS-wingflex.vert Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
model-interior-ALS-base.frag Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
model-interior-ALS-base.vert Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
model-interior-ALS-detailed.frag Fix incorrect lightmap intensity with lightmap-multi=0 2021-04-15 11:12:07 +02:00
model-interior-ALS-detailed.vert Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
model-interior-display-ALS.frag Fix incorrect lightmap intensity with lightmap-multi=0 2021-04-15 11:12:07 +02:00
night-vision.frag Add missing shader version tags for the other shaders too 2016-08-03 09:59:29 +02:00
noise.frag Interior glass effect with dynamic environment response for ALS 2015-03-10 13:43:08 +02:00
planet-aurora.frag 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-aurora.vert 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.frag Improvements to Earthview: enable changing cloud density, fix aurora z-ordering issue, let moonlight give a relief effect to clouds 2018-01-29 09:25:38 +02:00
planet-high.frag Remove rgb normalization and relax cut on NdotL to positive or null (fix visible redcuts) 2020-07-12 18:40:38 +02:00
planet.frag Remove rgb normalization and relax cut on NdotL to positive or null (fix visible redcuts) 2020-07-12 18:40:38 +02:00
planet.vert Improvements and bugfixes for orbital rendering 2015-03-29 13:16:19 +03:00
rain-layer-ALS.frag Add missing shader version tags for the other shaders too 2016-08-03 09:59:29 +02:00
rain-layer-ALS.vert Light scattering phenomena for ALS: rainbow, halo, sundogs and light pillar 2015-12-21 13:07:32 +02:00
rain-layer.frag Add missing shader version tags for the other shaders too 2016-08-03 09:59:29 +02:00
rain-layer.vert SHADERS:fix "unified" fog function. 2012-02-14 18:39:58 +02:00
road-ALS-ultra.frag Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
rock-ALS.frag Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
runway-ALS.frag Implement a simple snow shader for the low quality levels 2021-01-19 11:10:44 +01:00
scenery-lights.frag Shader-based scenery lights. 2021-08-07 21:42:20 +03:00
scenery-lights.vert Fixed FOV side effect on light sprite size. 2021-09-04 13:41:02 +03:00
secondary_lights.frag Bugfixes for ALS light addition 2016-08-18 09:25:03 +03:00
shadows-include.frag Reorganize the shadow mapping functions 2021-06-17 18:18:27 +02:00
shadows-include.vert Tweak shadow offset parameters and cascade ranges 2021-01-05 11:24:19 +01:00
skydome-ALS.frag ALS: Detailed scattering model for light on Cirrus clouds 2018-09-01 09:42:34 +03:00
skydome-ALS.vert ALS: tentative fix for skydome monolith artifact - apparently this is a numerical accuracy issue (?) 2018-02-13 15:00:21 +02:00
space-ALS-base.frag Add missing shader version tags for the other shaders too 2016-08-03 09:59:29 +02:00
space-ALS-base.vert Add an appropriate version number to all vertex shaders 2016-08-05 13:16:23 +02:00
space-ALS-ultra.frag Fix incorrect lightmap intensity with lightmap-multi=0 2021-04-15 11:12:07 +02:00
space-ALS-ultra.vert Experimental additional lighting options for ALS model shaders 2016-07-31 10:29:02 +03:00
surface-light-ALS.frag Make ALS procedural light sprite more palatable to nouveau GPU driver 2017-03-04 10:01:45 +02:00
surface-light-ALS.vert Fix for light point sprite shader when light definition is initially small and creates nmerical issues 2019-10-06 11:26:42 +03:00
terrain-ALS-base.frag Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
terrain-ALS-detailed.frag Implement a simple snow shader for the low quality levels 2021-01-19 11:10:44 +01:00
terrain-ALS-detailed.vert Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
terrain-ALS-ultra.frag Create overlay mixing scales based on texture scale. 2021-07-26 11:13:00 +01:00
terrain-ALS-ultra.vert Add clustered shading support to most Effects and shaders 2020-12-23 11:10:34 +01:00
terrain-nocolor.frag Add missing shader version tags for the other shaders too 2016-08-03 09:59:29 +02:00
terrain-overlay-ALS.frag Make Compositor default 2020-11-16 13:46:30 +01:00
terrain-overlay-ALS.geom Make Compositor default 2020-11-16 13:46:30 +01:00
text.frag Add shaders for osgText 2021-05-14 22:45:36 +02:00
text.vert Add shaders for osgText 2021-05-14 22:45:36 +02:00
thrustflame-ALS-detailed.frag Introduce detailed version of thruster flame 2016-08-01 11:47:44 +03:00
thrustflame-ALS.frag Bugfix and noise seed option for ALS thrust flame shader 2017-04-17 10:30:49 +03:00
thrustflame-ALS.vert Improvements to flame effect 2015-05-22 10:51:54 +03:00
tree-ALS-shadow.frag ALS: do not clamp haze color in object shaders, this leads to mismatch with terrain at high light intensity 2018-02-09 14:08:01 +02:00
tree-ALS-shadow.vert Add an appropriate version number to all vertex shaders 2016-08-05 13:16:23 +02:00
tree-ALS.frag ALS: do not clamp haze color in object shaders, this leads to mismatch with terrain at high light intensity 2018-02-09 14:08:01 +02:00
tree-ALS.vert Add an appropriate version number to all vertex shaders 2016-08-05 13:16:23 +02:00
tree.frag Standardized fog 2011-12-01 20:52:59 +00:00
tree.vert Speculative fix for shader cast issue on Mac. 2013-05-31 19:50:57 +01:00
trivial.frag Add missing shader version tags for the other shaders too 2016-08-03 09:59:29 +02:00
trivial.vert Procedural Texturing 2012-08-07 09:01:14 +02:00
wake-ALS.vert ALS maintenance - reworked light curves, streamlining, minor bugfixes,... 2014-12-15 15:50:47 +02:00
water-ALS-base.frag Add object shadows to water 2021-12-05 14:15:27 +00:00
water-ALS-high.frag Improved frozen-lake texture without snow 2021-12-25 10:55:09 +01:00
water-ALS.vert Prevent water ice-textures from moving around. 2021-12-23 14:22:48 +01:00
ws30-ALS-detailed.frag WS30: MR #267: Improved texture lookups from VS 2022-01-03 15:43:29 +00:00
ws30-ALS-detailed.vert WS30: MR #267: Improved texture lookups from VS 2022-01-03 15:43:29 +00:00
ws30-ALS-landclass-search-functions.frag WS30: MR #267: Improved texture lookups from VS 2022-01-03 15:43:29 +00:00
ws30-ALS-ultra.frag WS30: MR #267: Improved texture lookups from VS 2022-01-03 15:43:29 +00:00
ws30-ALS-ultra.vert WS30: MR #267: Improved texture lookups from VS 2022-01-03 15:43:29 +00:00
ws30-ALS.frag WS30: MR #267: Improved texture lookups from VS 2022-01-03 15:43:29 +00:00
ws30-ALS.vert WS30: MR #267: Improved texture lookups from VS 2022-01-03 15:43:29 +00:00
ws30-overlay-ALS.geom WS30: MR #267: Improved texture lookups from VS 2022-01-03 15:43:29 +00:00
ws30-overlay-ALS.vert WS30: MR #267: Improved texture lookups from VS 2022-01-03 15:43:29 +00:00
ws30-q1.frag WS30: Revert to green channel for texture atlas 2021-12-18 21:55:17 +00:00
ws30.frag WS30: Revert to green channel for texture atlas 2021-12-18 21:55:17 +00:00
ws30.vert WS30 - Uniform Arrays and lighting model 2021-11-10 22:58:44 +00:00