1
0
Fork 0
Commit graph

5 commits

Author SHA1 Message Date
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
Stuart Buchanan
a442615c68 WS30: Fix WS30 fragment shaders 2021-08-21 17:15:15 +01:00
Stuart Buchanan
d887e4b22d WS30: Add Texture rotation to ALS shader 2021-02-02 15:24:41 +00:00
Stuart Buchanan
d058b514f2 WS30: Add basic shaders 2021-01-23 17:15:12 +00:00