3261f4a97c
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 . |
||
---|---|---|
.. | ||
HDR | ||
3dcloud-ALS-detailed.frag | ||
3dcloud-ALS-detailed.vert | ||
3dcloud-ALS.frag | ||
3dcloud-ALS.vert | ||
3dcloud.frag | ||
3dcloud.vert | ||
agriculture-ALS.frag | ||
airfield-ALS.frag | ||
birds-ALS.frag | ||
birds-ALS.vert | ||
bowwave-ALS.frag | ||
building-ALS.vert | ||
building-default.vert | ||
building-model-ALS-ultra.vert | ||
chute-ALS.vert | ||
cliffs-ALS.frag | ||
cloud-impostor-ALS.vert | ||
cloud-noctilucent-ALS.vert | ||
cloud-shadowfunc.frag | ||
cloud-static-ALS-detailed.frag | ||
cloud-static-ALS-detailed.vert | ||
cloud-static-ALS.frag | ||
cloud-static-ALS.vert | ||
cloud-static.frag | ||
cloud-static.vert | ||
clouds-box.frag | ||
clouds-box.vert | ||
clouds-layered.frag | ||
clouds-layered.vert | ||
clouds-test.frag | ||
clouds-test.vert | ||
clouds-thick.frag | ||
clouds-thick.vert | ||
clouds-thin.frag | ||
clouds-thin.vert | ||
clouds-thinlayer.frag | ||
clouds-thinlayer.vert | ||
clustered-include.frag | ||
color_temperature.frag | ||
default.frag | ||
default.vert | ||
drunway-ALS.frag | ||
filters-ALS.frag | ||
filters-ALS.vert | ||
flutter-ALS.vert | ||
generic-ALS-base.vert | ||
glass-ALS.frag | ||
glass-ALS.vert | ||
grass-ALS.frag | ||
grass-ALS.geom | ||
grass-ALS.vert | ||
hazes.frag | ||
hud-ALS.frag | ||
hud-ALS.vert | ||
include_fog.frag | ||
include_fog.vert | ||
light-ALS.frag | ||
light-ALS.vert | ||
lightspot-ALS.frag | ||
model-ALS-base.frag | ||
model-ALS-ultra.frag | ||
model-ALS-ultra.vert | ||
model-ALS-wingflex.vert | ||
model-interior-ALS-base.frag | ||
model-interior-ALS-base.vert | ||
model-interior-ALS-detailed.frag | ||
model-interior-ALS-detailed.vert | ||
model-interior-display-ALS.frag | ||
night-vision.frag | ||
noise.frag | ||
planet-aurora.frag | ||
planet-aurora.vert | ||
planet-cloudlayer.frag | ||
planet-high.frag | ||
planet.frag | ||
planet.vert | ||
rain-layer-ALS.frag | ||
rain-layer-ALS.vert | ||
rain-layer.frag | ||
rain-layer.vert | ||
road-ALS-ultra.frag | ||
rock-ALS.frag | ||
runway-ALS.frag | ||
scenery-lights.frag | ||
scenery-lights.vert | ||
secondary_lights.frag | ||
shadows-include.frag | ||
shadows-include.vert | ||
skydome-ALS.frag | ||
skydome-ALS.vert | ||
space-ALS-base.frag | ||
space-ALS-base.vert | ||
space-ALS-ultra.frag | ||
space-ALS-ultra.vert | ||
surface-light-ALS.frag | ||
surface-light-ALS.vert | ||
terrain-ALS-base.frag | ||
terrain-ALS-detailed.frag | ||
terrain-ALS-detailed.vert | ||
terrain-ALS-ultra.frag | ||
terrain-ALS-ultra.vert | ||
terrain-nocolor.frag | ||
terrain-overlay-ALS.frag | ||
terrain-overlay-ALS.geom | ||
text.frag | ||
text.vert | ||
thrustflame-ALS-detailed.frag | ||
thrustflame-ALS.frag | ||
thrustflame-ALS.vert | ||
tree-ALS-shadow.frag | ||
tree-ALS-shadow.vert | ||
tree-ALS.frag | ||
tree-ALS.vert | ||
tree.frag | ||
tree.vert | ||
trivial.frag | ||
trivial.vert | ||
wake-ALS.vert | ||
water-ALS-base.frag | ||
water-ALS-high.frag | ||
water-ALS.vert | ||
ws30-ALS-detailed.frag | ||
ws30-ALS-detailed.vert | ||
ws30-ALS-landclass-search-functions.frag | ||
ws30-ALS-ultra.frag | ||
ws30-ALS-ultra.vert | ||
ws30-ALS.frag | ||
ws30-ALS.vert | ||
ws30-overlay-ALS.geom | ||
ws30-overlay-ALS.vert | ||
ws30-q1.frag | ||
ws30.frag | ||
ws30.vert |